Jump to content

Recommended Posts

Posted (edited)

so, I was playing this game, curveball<go ahead and grab it and the script> when I started to mess with autoit, so I wrote this script to auto play it...

; open curveball in IE
$CURVESWF = "N:\curveball\curveball.swf"
$IE = "iexplore.exe"
;Run( "C:\program files\internet explorer\iexplore.exe n:\curveball\curveball.swf" , "","")

HotKeySet("{Esc}", "escape")

WinWait("N:\curveball\curveball.swf", "",)
WinActivate("N:\curveball\curveball.swf", "",)
WinWaitActive("N:\curveball\curveball.swf", "",)
WinMove("N:\curveball\curveball.swf", "", "", "", 800, 600)

;start game
$BAIL = 0
MouseClick("left", 400, 320, 1, "") 

$prev=1
$moveto=2
AdlibEnable("nostanding")

While 1
   $MOVETO = PixelSearch(124, 154, 676, 524, 0xA0FFB2, 10, 2)
   If Not @error Then 
      MouseMove($MOVETO[0], $MOVETO[1], 0)
   EndIf
Wend

Func escape()
   Exit
EndFunc  ;==>escape

Func nostanding()
   If ($prev == $moveto) Then MouseClick("left", 400, 320, 1, "")
EndFunc  ;==>nostanding

you need to edit the script to get the window titles right, depending on what you open curveball.swf with (I use IE) btw, the script will get me to 8th level in the latest unstable, it would only get me to about 4th or 5th on the stable version...

my question being, how could I make it better?

faster?

how would I make it notice that the pixel hasn't moved for a second and then send a click?

edit tried to figure out no moving thing, see NoStanding function above, doesn't seem to work right though...

anyways, I'm sure no one cares :D

Edited by emmanuel

"I'm not even supposed to be here today!" -Dante (Hicks)

Posted

so, the question being, how can I detect that the required pixel location hasn't changed, for say, 1 second?

"I'm not even supposed to be here today!" -Dante (Hicks)

Posted

I can't help you with the topic. But really I'd to know where is the fun of let a game play by itself... I like playing games, not seeing demos...

Maybe the fun is making the script?

Or there is some sort of gain playing (level ups, money...)?

Posted

Check the help file for the function PixelGetColor.

Here's an example what you can use:

While 1
$Match1 = PixelGetColor(200, 400)
Sleep(1 * 1000)
$Match2 = PixelGetColor(200, 400)
If $Match1 = $Match2 Then MouseClick("left")
WEnd
Posted

  ezzetabi said:

I can't help you with the topic. But really I'd to know where is the fun of let a game play by itself... I like playing games, not seeing demos...

Maybe the fun is making the script?

Or there is some sort of gain playing (level ups, money...)?

I was having 'fun' (I was an addict) playing the game, and I was just learning autoit, so I thought I'd get some experiance with the pixelget function... So, yeah, the fun was in the challenge. There's no gain from it, it's a standalone swf game, and the script doesn't even play it any better than I do anyways...

@SlimShady: Thanks, I think I'll give that a shot in a adlib func, only running every second or so...

"I'm not even supposed to be here today!" -Dante (Hicks)

  • 2 weeks later...
Posted

i have improved it a litle bit:

  Quote

HotKeySet("{Esc}", "escape")

;WinWait("K:\curveball.swf", "", )

WinActivate("K:\WebsitesDB\curveball.swf", "", )

WinWaitActive("K:\WebsitesDB\curveball.swf", "", )

WinMove("K:\WebsitesDB\curveball.swf", "", "", "", 800, 600 )

HotKeySet("{Esc}", "escape")

;start game

Dim $bail = 0

Dim $moveto

MouseClick("left" ,400 ,320 ,1 ,"")

do

$moveto = PixelSearch(113, 145, 689, 540, 0xFCFFFD , 10 , 4)

If Not @error Then

MouseMove( $moveto[0], $moveto[1] ,0 )

EndIf

until $bail = 1

Func escape()

$bail = 1

EndFunc

it has won 8th level with 25085 points now.

AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)

Posted

Yes, I made something very similar to this, i think it got to level 8 on my 1.5 ghz 512 ddr (decent) computer...

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

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
  • Recently Browsing   0 members

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