Sign in to follow this  
Followers 0
stackover

Please Help Per GOD

10 posts in this topic

#1 ·  Posted (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:

Func 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 by stackover

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Coz I already posted 3 threads and no1 answer me ... sry for inconvenience.

Edited by stackover

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I dunno... but it should look more like...

Global $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 by stackover

Share this post


Link to post
Share on other sites

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.

Global $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.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Lets try diferent... I ll post code for someone test.

$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 by stackover

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 by stackover

Share this post


Link to post
Share on other sites

I did now .. Didnt Work .. Mouse dont move if $ChangingAEBot = 2

I give up =[

Share this post


Link to post
Share on other sites

this works... so your expectations or logic elsewhere is malignant.

Lar.

Is that like a coding melanoma?

[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0