stackover Posted January 25, 2007 Posted January 25, 2007 (edited) I have 2 functions. When I press Alt+F5 start first function but when I press again Alt+F5 second function dont work correctly... I need stop fisrt function and start second.. Who can help.. cOde below: expandcollapse popupFunc AEMode1() HotKeySet ("!{F5}", "AEMode2") $ChangingAEBot =1 Call("AE") EndFunc Func AEMode2() HotKeySet ("!{F5}", "AEMode1") $ChangingAEBot =2 Call("AE") EndFunc Func AE() Do If $ChangingAEBot = 1 Then MouseUp ("Right") Sleep (80) MouseMove($AE1_LX, $AE1_LY ,1) Call ("SkillBotAE") MouseMove($AE1_RX, $AE1_RY ,1) Call ("SkillBotAE") EndIf If $ChangingAEBot = 2 Then MouseUp ("Right") Sleep (80) MouseMove($AE1_RDX, $AE1_RDY ,1) Call ("SkillBotAE") MouseMove($AE1_DX, $AE1_DY ,1) Call ("SkillBotAE") MouseMove($AE1_LDX, $AE1_LDY ,1) Call ("SkillBotAE") EndIf Until $ChangingAEBot > 10 EndFunc I already tryed all tipes of loop you can imagine .. I dont know what is wrong... Edited January 25, 2007 by stackover
Developers Jos Posted January 25, 2007 Developers Posted January 25, 2007 Help Per GOD ? Why post a second thread on the same subject ? 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.
stackover Posted January 25, 2007 Author Posted January 25, 2007 (edited) Coz I already posted 3 threads and no1 answer me ... sry for inconvenience. Edited January 25, 2007 by stackover
stackover Posted January 25, 2007 Author Posted January 25, 2007 (edited) I dunno... but it should look more like... expandcollapse popupGlobal $ChangingAEBot = 1 HotKeySet ("!{F5}", "AEMode1") While 1 Sleep(50) WEnd Func AEMode1() HotKeySet ("!{F5}", "AEMode2") $ChangingAEBot =1 Call("AE") EndFunc Func AEMode2() HotKeySet ("!{F5}", "AEMode1") $ChangingAEBot =2 Call("AE") EndFunc Func AE() If $ChangingAEBot = 1 Then MouseUp ("Right") Sleep (80) MouseMove($AE1_LX, $AE1_LY ,1) Call ("SkillBotAE") MouseMove($AE1_RX, $AE1_RY ,1) Call ("SkillBotAE") EndIf If $ChangingAEBot = 2 Then MouseUp ("Right") Sleep (80) MouseMove($AE1_RDX, $AE1_RDY ,1) Call ("SkillBotAE") MouseMove($AE1_DX, $AE1_DY ,1) Call ("SkillBotAE") MouseMove($AE1_LDX, $AE1_LDY ,1) Call ("SkillBotAE") EndIf EndFunc Lary sorry .. I only post a part of my code ... I set variable as global too and have a loop for bots run ... But not work.. Other thing .. I need a infinity loop in function AE()... once started .. only modify If conditions Edited January 25, 2007 by stackover
improbability_paradox Posted January 25, 2007 Posted January 25, 2007 A variation of Larry's code. Don't know if this will help as I can't see the rest of your code and as Larry indicated there is probably an issue in that part rather than what you posted. But anyway, give this a shot. expandcollapse popupGlobal $ChangingAEBot = 0 HotKeySet ("!{F5}", "AEMode1") While 1 if $ChangingAEBot <> 0 then AE() else Sleep(50) endif WEnd Func AEMode1() HotKeySet ("!{F5}", "AEMode2") $ChangingAEBot =1 EndFunc Func AEMode2() HotKeySet ("!{F5}", "AEMode1") $ChangingAEBot =2 EndFunc Func AE() If $ChangingAEBot = 1 Then MouseUp ("Right") Sleep (80) MouseMove($AE1_LX, $AE1_LY ,1) Call ("SkillBotAE") MouseMove($AE1_RX, $AE1_RY ,1) Call ("SkillBotAE") EndIf If $ChangingAEBot = 2 Then MouseUp ("Right") Sleep (80) MouseMove($AE1_RDX, $AE1_RDY ,1) Call ("SkillBotAE") MouseMove($AE1_DX, $AE1_DY ,1) Call ("SkillBotAE") MouseMove($AE1_LDX, $AE1_LDY ,1) Call ("SkillBotAE") EndIf EndFunc Instead of performing an infinite loop inside of the function AE(), the function AE() is called an infinite number of times via the first loop. That way (as is also the case with Larry's original variation of your code) the functions AEMode1() and AEMode2() will be able to finish.
stackover Posted January 25, 2007 Author Posted January 25, 2007 (edited) Lets try diferent... I ll post code for someone test. expandcollapse popup$AE1_LX=285 $AE1_LY=247 $AE1_LUX=305 $AE1_LUY=203 $AE1_LUUX=361 $AE1_LUUY=177 $AE1_UX=434 $AE1_UY=177 $AE1_RUUX=489 $AE1_RUUY=203 $AE1_RUX=512 $AE1_RUY=247 $AE1_RX=489 $AE1_RY=290 $AE1_RDX=434 $AE1_RDY=318 $AE1_DX=361 $AE1_DY=318 $AE1_LDX=305 $AE1_LDY=290 Global $ChangingAEBot = 0 Global $Time4SkillBotAE = 1500 Func AE() While 1 If $ChangingAEBot = 1 Then MouseUp ("Right") Sleep (80) MouseMove($AE1_LX, $AE1_LY ,1) Call ("SkillBotAE") MouseMove($AE1_RX, $AE1_RY ,1) Call ("SkillBotAE") MouseMove($AE1_LUUX, $AE1_LUUY ,1) Call ("SkillBotAE") MouseMove($AE1_RUUX, $AE1_RUUY ,1) Call ("SkillBotAE") MouseMove($AE1_LDX, $AE1_LDY ,1) Call ("SkillBotAE") MouseMove($AE1_RDX, $AE1_RDY ,1) Call ("SkillBotAE") MouseMove($AE1_LUX, $AE1_LUY ,1) Call ("SkillBotAE") MouseMove($AE1_RUX, $AE1_RUY ,1) Call ("SkillBotAE") MouseMove($AE1_UX, $AE1_UY ,1) Call ("SkillBotAE") MouseMove($AE1_DX, $AE1_DY ,1) Call ("SkillBotAE") EndIf If $ChangingAEBot = 2 Then MouseUp ("Right") Sleep (80) MouseMove($AE1_LX, $AE1_LY ,1) Call ("SkillBotAE") MouseMove($AE1_LUX, $AE1_LUY ,1) Call ("SkillBotAE") MouseMove($AE1_LUUX, $AE1_LUUY ,1) Call ("SkillBotAE") MouseMove($AE1_UX, $AE1_UY ,1) Call ("SkillBotAE") MouseMove($AE1_RUUX, $AE1_RUUY ,1) Call ("SkillBotAE") MouseMove($AE1_RUX, $AE1_RUY ,1) Call ("SkillBotAE") MouseMove($AE1_RX, $AE1_RY ,1) Call ("SkillBotAE") MouseMove($AE1_RUX, $AE1_RUY ,1) Call ("SkillBotAE") MouseMove($AE1_RDX, $AE1_RDY ,1) Call ("SkillBotAE") MouseMove($AE1_DX, $AE1_DY ,1) Call ("SkillBotAE") MouseMove($AE1_LDX, $AE1_LDY ,1) Call ("SkillBotAE") EndIf WEnd EndFunc Func SkillBotAE() $ContSkillBotAE = TimerInit() Do MouseDown ("Right") Call ("Desfoque") Send (" ") MouseUp ("Right") Send (" ") Sleep(60) Until TimerDiff($ContSkillBotAE) > $Time4SkillBotAE EndFunc Func AEMode1() HotKeySet ("!{F5}", "AEMode2") $ChangingAEBot = 1 Call("AE") EndFunc Func AEMode2() HotKeySet ("!{F5}", "AEMode1") $ChangingAEBot = 2 Call("AE") EndFunc While (1) Sleep(1) WEnd Thats my code .. dont got error .. only cant make second if in AE() works ... T_T Edited January 25, 2007 by stackover
stackover Posted January 25, 2007 Author Posted January 25, 2007 (edited) Larry. thanks but this will stop in one loop. need it once started dont stop more .... only change between Ifs in AE()... Lol .. I already tryed thounds ways T_T My script start first IF perfectly but when I press F5 to set variable to second IF... Second If dont work.. mouse dont move... Edited January 25, 2007 by stackover
stackover Posted January 25, 2007 Author Posted January 25, 2007 I did now .. Didnt Work .. Mouse dont move if $ChangingAEBot = 2 I give up =[
Moderators SmOke_N Posted January 25, 2007 Moderators Posted January 25, 2007 this works... so your expectations or logic elsewhere is malignant.Lar.Is that like a coding melanoma? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
stackover Posted January 25, 2007 Author Posted January 25, 2007 God . now i know problem .. I have in script other function set as F5 .. when I tryed click alt+f5 .. the right clicks in script couldnt press alt ... or dont capture ALT pressing .. but .. thanks for all that help me
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