Disciples Posted July 31, 2009 Share Posted July 31, 2009 Ok, here is my first question... If you have more than 1 Func in a while loop, could you make it so they are running at the same time? Or are they already. EX: I have a script, where it attacks in one func, but the other func exits if hit a certain amount of times. So If I have them in the same loop, would it be so the life func goes into effect as soon as I lost (x) amount of health? Or how does that work? And my second one is how can I make it so if a rectangle has a color, then if it changes to a different color it will react. I was thinking like this... If (xxx,xxx,xxx,0xXXXXXX) = (0xXXXXXX) Then MouseClick("left",xxx,xxx) Would that work? Thanks for your time! Link to comment Share on other sites More sharing options...
Developers Jos Posted July 31, 2009 Developers Share Posted July 31, 2009 1. no 2. Check the helpfile for PixelChecksum() SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Disciples Posted July 31, 2009 Author Share Posted July 31, 2009 1. no2. Check the helpfile for PixelChecksum()kk thanks. So should I have them run in different loops? Or different scripts? Link to comment Share on other sites More sharing options...
bogQ Posted July 31, 2009 Share Posted July 31, 2009 kk thanks. So should I have them run in different loops? Or different scripts? more then one script on one game isnt something that is easy to control First sugestion: one loop with "Select...Case...EndSelect " (look in the help file) example expandcollapse popupWhile 1 Select;select the first correct case, first r hp and mp so that you dont die Case "0x"&Hex(PixelGetColor ( x , y, 6) <> $hpcollor rechargehp() Case "0x"&Hex(PixelGetColor ( x , y, 6) <> $mpcollor rechargehp() Case "0x"&Hex(PixelGetColor ( x , y, 6) = $Selectedmob ;$Selectedmob = position and collor on last pixel so that you know that your not attacking mob that someone else is attacking first autoattackmob() Case Else selectmob() EndSelect Sleep(100) WEnd Func rechargehp() Send("{=}") EndFunc Func rechargemp() Send("{-}") EndFunc Func autoattackmob() Send("{1}") Do Sleep(100) If "0x"&Hex(PixelGetColor ( x , y, 6) <> $hpcollor Then ;$hpcollor = position and collor on minimal hp before recharging rechargehp() Sleep(1000) Send("{1}");start attacking if recharge stoped attack function ElseIf "0x"&Hex(PixelGetColor ( x , y, 6) <> $mpcollor Then ;$mpcollor = position and collor on minimal mp before recharging rechargehp() Sleep(1000) Send("{1}") EndIf Until "0x"&Hex(PixelGetColor ( x , y, 6) <> $Selectedmob_HP ;$Selectedmob_HP = position and collor on first pixel so that you know if you kiled mob EndFunc Func selectmob() Do $coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 ) Until IsArray($coord) MouseClick("",$coord[0],$coord[1]) EndFunc Second sugestion: dont try to bot, play the game, youl have more fun when playing instead of looking to the screen while the bot is playing. TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Disciples Posted July 31, 2009 Author Share Posted July 31, 2009 more then one script on one game isnt something that is easy to control First sugestion: one loop with "Select...Case...EndSelect " (look in the help file) example expandcollapse popupWhile 1 Select;select the first correct case, first r hp and mp so that you dont die Case "0x"&Hex(PixelGetColor ( x , y, 6) <> $hpcollor rechargehp() Case "0x"&Hex(PixelGetColor ( x , y, 6) <> $mpcollor rechargehp() Case "0x"&Hex(PixelGetColor ( x , y, 6) = $Selectedmob ;$Selectedmob = position and collor on last pixel so that you know that your not attacking mob that someone else is attacking first autoattackmob() Case Else selectmob() EndSelect Sleep(100) WEnd Func rechargehp() Send("{=}") EndFunc Func rechargemp() Send("{-}") EndFunc Func autoattackmob() Send("{1}") Do Sleep(100) If "0x"&Hex(PixelGetColor ( x , y, 6) <> $hpcollor Then ;$hpcollor = position and collor on minimal hp before recharging rechargehp() Sleep(1000) Send("{1}");start attacking if recharge stoped attack function ElseIf "0x"&Hex(PixelGetColor ( x , y, 6) <> $mpcollor Then ;$mpcollor = position and collor on minimal mp before recharging rechargehp() Sleep(1000) Send("{1}") EndIf Until "0x"&Hex(PixelGetColor ( x , y, 6) <> $Selectedmob_HP ;$Selectedmob_HP = position and collor on first pixel so that you know if you kiled mob EndFunc Func selectmob() Do $coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 ) Until IsArray($coord) MouseClick("",$coord[0],$coord[1]) EndFunc Second sugestion: dont try to bot, play the game, youl have more fun when playing instead of looking to the screen while the bot is playing. Thanks! I'll look into that. And TBH, I am most likely not gonna use the bot at all. I just want to have it accomplished etc. Link to comment Share on other sites More sharing options...
Disciples Posted August 1, 2009 Author Share Posted August 1, 2009 Hmm. Ok I tried the case one, but I don't think I am doing it right? Here is the script : expandcollapse popupHotKeySet("{F3}", "_Start") ; ====> Start HotKeySet("{F5}", "_Stop") ; ====> Pause HotKeySet("{ESC}", "_Exit") ; ====> Exit (terminate script) Global $ON = False While 1 $ON = True Sleep(10) WEnd Func _Start() MouseClick ("left", 610,223) sleep(100) $ON = True EndFunc ;==>_Start Func _Stop() $ON = False EndFunc ;==>_Stop Func _Exit() $ON = False Exit EndFunc ;==>_Exit While 1 Select;select the first correct case, first r hp and mp so that you dont die Case $checksum = PixelChecksum(220,151,232,165) ; Wait for the region to change, the region is checked every 100ms to reduce CPU load While $checksum = PixelChecksum(220,151,232,165) Sleep(100) WEnd MouseClick("left", 745,327) LifeMonitor() Case $checksum = PixelChecksum(417,151,420,164) ; Wait for the region to change, the region is checked every 100ms to reduce CPU load While $checksum = PixelChecksum(417,151,420,164) Sleep(100) WEnd enterfight() Case $Colors = StringSplit("0x6B0967,0x663340,0xffff93,0x4C4C00,0x9f772B,0xBfBf99", ",") For $x = 1 To $Colors[0] $coord = PixelSearch(445,339,689,381, $Colors[$x]) ;searches for monster, if not found keeps searching search() EndSelect sleep(100) Wend Func LifeMonitor() MouseClick("left", 745,327) EndFunc Func enterfight() MouseClick("left", 606,229) EndFunc Func search() If Not @error Then MouseClick("left",503,349) sleep(50) MouseClick("left",502,365) sleep(50) MouseClick("left",508,355) sleep(50) MouseClick("left",510,375) sleep(50) MouseClick("left",513,371) sleep(50) Return EndIf Next If @error Then MouseClick("left",256,326) EndIf Once again, thanks to anyone who has any time to possibly check over this to see what I am doing wrong, or if It is set up correct etc. 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