Bower Posted November 7, 2008 Posted November 7, 2008 Okay, first off I would like to say I am bran new to scripting. I have always tried to do it but never have gotten very far. I am trying to make a program so that it will move my character in Graal Online like every 2mins. I took an antiAFK bot that I found for WoW and tried to edit it, but when I press 'f9' it only moves my character once then like ends it i think. I basically need it to keep moving my character until I hit 'f10' Not sure if itll matter but Graal (The game I am trying to make this work for) is a 2D game. ; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.2.0 ; Author: The-Chad <chadscrib@gmail.com> <----- Guy I am trying to edit it from ; Website: OnlineGameHacker <www.OnlineGameHacker.com> ; Script Function: Anti Afk ; ; ---------------------------------------------------------------------------- HotKeySet("{F9}", "hide") HotKeySet("{F10}", "show") AutoItSetOption("WinTitleMatchMode", 4) While 1 Sleep(1000) WEnd Func hide() Global $Show = 0 Global $handle = WinGetHandle("classname=GxWindowClassD3d") WinSetState($handle, "", @SW_MINIMIZE) WinSetState($handle, "", @SW_HIDE) If @error Then MsgBox(0, "error", "couldnt find Graal") Else While 1 $unique = Random(1, 4, 1) If $unique = 1 Then ControlSend($handle, "", "", "{UP DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{UP UP}") ControlSend($handle, "", "", "{DOWN DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{DOWN UP}") Sleep(200000 + Random(5000, 15000, 1)) ElseIf $unique = 2 Then ControlSend($handle, "", "", "{RIGHT DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{RIGHT UP}") ControlSend($handle, "", "", "{LEFT DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{LEFT UP}") Sleep(200000 + Random(5000, 15000, 1)) ElseIf $unique = 3 Then ControlSend($handle, "", "", "{DOWN DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{DOWN UP}") ControlSend($handle, "", "", "{UP DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{UP UP}") Sleep(200000 + Random(5000, 15000, 1)) ElseIf $unique = 4 Then ControlSend($handle, "", "", "{LEFT DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{LEFT UP}") ControlSend($handle, "", "", "{RIGHT DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{RIGHT UP}") Sleep(200000 + Random(5000, 15000, 1)) EndIf If $Show > 0 Then ExitLoop WEnd EndIf EndFunc ;==>hide Func show() Global $Show = 1 WinSetState("Graal Online", "", @SW_SHOW) WinSetState("Graal Online", "", @SW_MAXIMIZE) WinActivate($handle, "") EndFunc ;==>show Basically all I changed was where it says "Graal" or "Graal Online" You can reply here or e-mail me or IM me i dont care just need the help! Kyrule@gmail.com sn - KyruleBower
system24 Posted November 7, 2008 Posted November 7, 2008 Just a very small fix. I hope it would help. expandcollapse popupHotKeySet("{F9}", "hide") HotKeySet("{F10}", "show") AutoItSetOption("WinTitleMatchMode", 4) While 1 Sleep(1000) WEnd Func hide() Global $Show = 0 Global $handle = WinGetHandle("classname=GxWindowClassD3d") WinSetState($handle, "", @SW_MINIMIZE) WinSetState($handle, "", @SW_HIDE) If @error Then MsgBox(0, "error", "couldnt find Graal") Else While $Show > 0 $unique = Random(1, 4, 1) If $unique = 1 Then ControlSend($handle, "", "", "{UP DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{UP UP}") ControlSend($handle, "", "", "{DOWN DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{DOWN UP}") Sleep(200000 + Random(5000, 15000, 1)) ElseIf $unique = 2 Then ControlSend($handle, "", "", "{RIGHT DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{RIGHT UP}") ControlSend($handle, "", "", "{LEFT DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{LEFT UP}") Sleep(200000 + Random(5000, 15000, 1)) ElseIf $unique = 3 Then ControlSend($handle, "", "", "{DOWN DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{DOWN UP}") ControlSend($handle, "", "", "{UP DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{UP UP}") Sleep(200000 + Random(5000, 15000, 1)) ElseIf $unique = 4 Then ControlSend($handle, "", "", "{LEFT DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{LEFT UP}") ControlSend($handle, "", "", "{RIGHT DOWN}") Sleep(100 + Random(1, 50, 1)) ControlSend($handle, "", "", "{RIGHT UP}") Sleep(200000 + Random(5000, 15000, 1)) EndIf WEnd EndIf EndFunc;==>hide Func show() Global $Show = 1 WinSetState("Graal Online", "", @SW_SHOW) WinSetState("Graal Online", "", @SW_MAXIMIZE) WinActivate($handle, "") EndFunc;==>show [center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center]
Bower Posted November 7, 2008 Author Posted November 7, 2008 Alright well I started over, that script got to confusing to try and edit so I actually am reading the help file lol. Right now I am working on a script so that it will log me into the game and log me into the server then it will start the antiafk bot. Anyone know how its possible to make a keystroke on an inactive window so that I can still use my computer when the bot is running?
system24 Posted November 7, 2008 Posted November 7, 2008 Since you are reading the help file, search for ControlSend. [center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now