BuddyBoy Posted November 29, 2007 Share Posted November 29, 2007 expandcollapse popupOpt("GUIOnEventMode", 1) Opt("MouseCoordMode", 0) Opt("PixelCoordMode", 0) #include <GUIConstants.au3> HotKeySet("{F5}", "On") HotKeySet("{ESC}", "Terminate") HotKeySet("^p", "_ToggleRun") Global $Running = 0, $MPos, $PixelColor Dim $SearchMob=0 GUICreate("TUL- The Ultimate Leveler",150,100,100,100) GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate") $Label=GUICtrlCreateLabel("F5 to turn on bot.",10,5,130,15) $Radio1=GUICtrlCreateRadio("Warrior/Trojan",10,35,130,15) $Radio2=GUICtrlCreateRadio("Archer",10,65,130,15) GUICtrlSetState ($Radio1, $GUI_CHECKED) GUISetState() While 1 If $SearchMob Then Attack() Sleep(1000) WEnd Func _ToggleRun() $Running = NOT $Running If $Running Then $MPos = MouseGetPos() $PixelColor = PixelGetColor($MPos[0], $MPos[1]) EndIf EndFunc Func On() $SearchMob=NOT $SearchMob If $SearchMob Then GUICtrlSetData($Label,"F5 to turn off bot.") Else GUICtrlSetData($Label,"F5 to turn on bot.") EndIf EndFunc Func Jump() $x=Random(0,1024,1) $y=Random(0,690,1) MouseMove($x,$y,0) Send("{CTRLDOWN}") MouseClick("Left") Send("{CTRLUP}") Sleep(900) EndFunc Func Attack() $Coords=PixelSearch(200,100,825,600,12059395,5) If NOT @error Then If BitAND(GUICtrlRead($Radio1), $GUI_CHECKED) = $GUI_CHECKED then MouseClick("left",$Coords[0]+10,$Coords[1]+20,1,0) Sleep(2200) If $Running Then If $PixelColor <> PixelGetColor($MPos[0], $MPos[1]) Then Send("{F2}") Sleep(1000) EndIf EndIf Sleep(50) Else MouseClick("right",$Coords[0]+10,$Coords[1]+20,1,0) Sleep(2200) If $Running Then If $PixelColor <> PixelGetColor($MPos[0], $MPos[1]) Then Send("{F2}") Sleep(1000) EndIf EndIf EndIf Else Jump() EndIf EndFunc Func Terminate() Exit EndFunc;==> Terminate() Ok theres my coding... Works perfectly fine... But this is where I'm having problems. MouseClick("left",$Coords[0]+10,$Coords[1]+20,1,0) Sleep(2200) If $Running Then If $PixelColor <> PixelGetColor($MPos[0], $MPos[1]) Then Send("{F2}") Sleep(1000) EndIf EndIf Sleep(50) Else MouseClick("right",$Coords[0]+10,$Coords[1]+20,1,0) Sleep(2200) If $Running Then If $PixelColor <> PixelGetColor($MPos[0], $MPos[1]) Then Send("{F2}") Sleep(1000) EndIf EndIf EndIf I need the "If $Running Then..." to let the user have time to pick there color... I tried putting it out of the func, so they could press ctrl+p before starting the bot, but it didn't work... I have 2 options (possibly more but this is what I thought could work) 1. Somehow put it outside the func so the user could press ctrl+p whenever they want before the bot starts up. (would prefer this one more) 2. Once F5 is pressed have it wait 10 seconds to give the user time to press ctrl+p and then go on with the bot... But I don't want it in a loop so that EVERYTIME it attacks a monster it has to wait 5-10 seconds... Could you just relay that 5-10 seconds ONE time and then it never happens again? Like I said there could be more possible ways, I just hope you guys can help me figure it out. (I'd prefer number 1 because then they wouldn't have to press ctrl+p everytime they press F5 to start the bot, instead they could just do it once, and it holds that in memory the whole time while the bot is or isnt running) Thanks for the help if you can figure out a way. *Hope you understood all that lol* Link to comment Share on other sites More sharing options...
BuddyBoy Posted November 29, 2007 Author Share Posted November 29, 2007 Can anyone help? It got bumped down to the 3rd page I gave some options, I know what I'm doing (at least I think so ) All I need is a tiny simple code if possible, Thanks Link to comment Share on other sites More sharing options...
Iklim Posted November 29, 2007 Share Posted November 29, 2007 (edited) I dont understand your needs. If you want the user to 'pick up a color' why not asking him at the start of your prog ? (like with an inputbox ?) hope it helps. regards. --EDIT Or add an inputbox in your gui (GUICtrlCreateEdit) ? so that the user can change it any time he wants. Edited November 29, 2007 by Iklim Iklim Link to comment Share on other sites More sharing options...
BuddyBoy Posted November 30, 2007 Author Share Posted November 30, 2007 I dont understand your needs.If you want the user to 'pick up a color' why not asking him at the start of your prog ?(like with an inputbox ?)hope it helps.regards.--EDITOr add an inputbox in your gui (GUICtrlCreateEdit) ?so that the user can change it any time he wants.Sorry if I wasn't clear.. but thats exactly what I want, but I can't figure out WHERE to put it at the beginning of the program, everywhere I tried, it didn't work...Thanks if you can help me Link to comment Share on other sites More sharing options...
Generator Posted November 30, 2007 Share Posted November 30, 2007 (edited) Add the include, and try the following..see if it works for you #include<misc.au3> Func _ToggleRun() Local $Pos, $PixelColor While Not _IsPressed("01") $Pos = MouseGetPos() $PixelColor = PixelGetColor($Pos[0], $Pos[1]) ToolTip("Press left mouse button to set color",$Pos[0],$Pos[1],"Capturing",0,0) WEnd If _IsPressed("01") Then $Picked=PixelGetColor($Pos[0], $Pos[1]) Return $Picked EndIf EndFunc Edited November 30, 2007 by Generator Link to comment Share on other sites More sharing options...
BuddyBoy Posted November 30, 2007 Author Share Posted November 30, 2007 I'm a bit confused on your script there. I don't have an _IfPressed variable...? And where do I put that code in, and do I take my code out from my script as well? I put that in my ToggleRun() and it says If _IfPressed() must have a Then statement... Could you explain your script a little bit more, that would be great! Thank you very much Link to comment Share on other sites More sharing options...
Generator Posted November 30, 2007 Share Posted November 30, 2007 I'm a bit confused on your script there. I don't have an _IfPressed variable...?And where do I put that code in, and do I take my code out from my script as well?I put that in my ToggleRun() and it says If _IfPressed() must have a Then statement...Could you explain your script a little bit more, that would be great!Thank you very much Put the include at very top, and replace your _ToggleRun(), and change the variable name. Link to comment Share on other sites More sharing options...
BuddyBoy Posted December 1, 2007 Author Share Posted December 1, 2007 (edited) I know what to do with the code... But how does that solve my ctrl+p problem? I'm a bit confused, I'm not criticizing you, I'm just asking, how that can do with my ctrl+p anytime problem xD Thanks, Buddyboy Edited December 1, 2007 by BuddyBoy Link to comment Share on other sites More sharing options...
Generator Posted December 1, 2007 Share Posted December 1, 2007 I know what to do with the code... But how does that solve my ctrl+p problem? I'm a bit confused, I'm not criticizing you, I'm just asking, how that can do with my ctrl+p anytime problem xDThanks, BuddyboyI just realized the function's purpose is to ToggleRun, looked through your code, you can do this.Add a variable name and make the $variable=0In the _ToggleRun function, make an if statement.If Not $variable then;The loop i posted to select color, use your own way if you prefer$variable=1EndIfThis way, the color check will only be toggled once, and if you want to reselect color, just change the $variable to 0 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