Jump to content

Scripting advice needed


Bert
 Share

Recommended Posts

I've made a simple bot for a flash game called "Defend your Castle" from XGenStudios.com. What it does is to do the mouse movement for you so your wrist doesn't get sore from flinging dudes to kill them. It works pretty well, but sometimes it doesn't want to work right. I didn't know if someone could make it better.

Defend Your Castle bot
;saves your wrist. 
;Just hold down the "a" key and click on the dude to kill him
;Hold down "s" and click to convert the dude.

#include <Misc.au3>
$dll = DllOpen("user32.dll")
HotKeySet("{ESC}","_exit")
$path = "VollyViewer - D:\games\vollyflash\games\Defend_your_castle.swf";or where you have the swf file. 
while 1
    while WinActive($path)
            Select 
                Case _IsPressed("41", $dll) and _IsPressed("01", $dll);"a" and left mouse - Kill
                        Do 
                            $G = _IsPressed("01", $dll)
                        until $G = 0
                        $m = MouseGetPos()
                        MouseDown("left")
                        MouseMove($m[0]+50, $m[1]-500, 1)
                        MouseUp("left")
                        MouseMove($m[0], $m[1],1)
            
                Case _IsPressed("53", $dll)and _IsPressed("01", $dll);"s" and left mouse - Convert
                        Do 
                            $G = _IsPressed("01", $dll)
                        until $G = 0
                        $m = MouseGetPos()
                        MouseDown("left")
                        MouseMove(649, 324, 1)
                        sleep(20)
                        MouseUp("left")
                        MouseMove($m[0], $m[1],1)
                Case Else
                    sleep(1)
            EndSelect       
    WEnd
    sleep(100);idle arounda
WEnd
DllClose($dll)  

func _exit()
    Exit
EndFunc
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...