Jump to content

Flash Bot Help


mrnoob
 Share

Recommended Posts

So, I am trying to automate this flash game(http://www.newgrounds.com/portal/view/410537) just for fun and practice. Basically what you have to do is shoot the target before the computer, and the close you are to the bullseye, the more damage you do.However, the games cursor has a delay on it, and more much slower then your mouses cursor; this makes it more difficult to program a bot. If you play the game once, it will be much easier to see what my code it doing, but if you dont have time, this image will help. http://img80.imageshack.us/my.php?image=shootgamebs5.jpg

Right now, my problem is with this line of code :

CODE
($farY - 654) = $slope($farx - 367)

It work if the above line is altered such that $farY is less then 357 rather then greater :

CODE
While $farY < 357 AND $farX < 934

CODE
Opt("MouseCoordMode", 1) ;screen mode

HotKeySet("z","_set")

HotKeySet("x", "_shoot")

HotKeySet("p", "_pause")

HotKeySet("t", "_close")

func _set()

mousemove(367, 654, 40)

EndFunc;==>EndFunc

Func _shoot()

local $left = $Bulleye[0]-15

local $top = $Bulleye[1]-30

local $right = $Bulleye[0]-5

local $bottom = $Bulleye[1]+30

local $slope = abs(($Bulleye[1]-654)/($Bulleye[0]-367))

local $farX = $bulleye[1]

local $fary = $bulleye[0]

local $Bulleye = PixelSearch(480, 383, 778, 661, 0xD8681F, 0, 1)

While $farY > 357 AND $farX < 934

($farY - 654) = $slope($farx - 367)

$Farx=$farx+1

WEnd

MouseMove($farX, $farY, 1)

Sleep(30)

$curSum = PixelChecksum($left, $top, $right, $bottom, 1)

Do

;these lines are just for testing

;mousemove($left, $top, 40)

;mousemove($right, $top, 40)

;mousemove($right, $bottom, 40)

;mousemove($left, $bottom, 40)

;nmousemove($left, $top, 40)

$curCheck = PixelChecksum($left, $top, $right, $bottom, 1)

until $curSum <> $curCheck

MouseClick("$farY",$bulleye[0], $Bulleye[1], 1, 0)

EndFunc ;==>EndFunc

Func _close()

Exit

EndFunc;==>EndFunc

Func _Pause()

while 1

sleep(50)

Wend

EndFunc;==>EndFunc

While 1

sleep(50)

WEnd

Edited by mrnoob
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...