Tinutron Posted May 23, 2009 Share Posted May 23, 2009 how can i make the function fight know, what $MobHP is? expandcollapse popup#include <winapi.au3> $Count = 1 $Count2 = 1 Opt("PixelCoordMode", 0) While 1 Do $Fight = Fight() Until $Count = 30 ExitLoop WEnd Func Fight() $TrayTip = "Monster: " & $Count TrayTip("Fight", $TrayTip, 30) If $Count2 > 6 Then Sleep(500) ControlClick("Game", "", "", "middle") $Count2 = 0 EndIf Sleep(500) ControlSend("Game", "", "", "{TAB}", 0) sleep(500) ControlSend("Game", "", "", "3", 0) Do MobHp() Sleep(500) Until $MobHP = 0 $Count = $Count +1 $Count2 = $Count2 +1 EndFunc Func MobHP() Global Const $PROCESS_VM_OPERATION = (0x0008) Global Const $PROCESS_VM_READ = (0x0010) Global $Process="game.exe" Global $Pointer = 0x13E49640 $handle=_WinAPI_OpenProcess(BitOR($PROCESS_VM_OPERATION,$PROCESS_VM_READ),False,ProcessExists($Process)) $s=DllStructCreate("int") Local $read _WinAPI_ReadProcessMemory($handle,$Pointer,DllStructGetPtr($s),DllStructGetSize($s),$read) Global $MobHP = DllStructGetData($s,1) _WinAPI_CloseHandle($handle) EndFunc Link to comment Share on other sites More sharing options...
Bert Posted May 23, 2009 Share Posted May 23, 2009 How will this script get around the anti bot programs such as punk buster used in online games? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Tinutron Posted May 23, 2009 Author Share Posted May 23, 2009 (edited) He still says "WARNING: $MobHP: possibly used before declaration." EDIT: There is no anti-cheat software, it is just for a crappy asiagrinder Edited May 23, 2009 by Tinutron Link to comment Share on other sites More sharing options...
Tinutron Posted May 23, 2009 Author Share Posted May 23, 2009 Ok, this fixed my problem, but now i have anotherone, after 1 kill the script terminates and throws out this error: script.au3 (56) : ==> Can not redeclare a constant.: Global Const $PROCESS_VM_OPERATION = (0x0008) Global Const ^ ERROR ->03:16:17 AutoIT3.exe ended.rc:1 Link to comment Share on other sites More sharing options...
Tinutron Posted May 23, 2009 Author Share Posted May 23, 2009 fixed it... sometimes i'm just stupid... thank you all, for your great help Link to comment Share on other sites More sharing options...
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