Jump to content

how to make 2 loops work


Domis
 Share

Recommended Posts

How to make theese both loops working at the same time?

Global $loot
Global $es

Opt("SendKeyDownDelay", 30)
Opt("MouseClickDelay", 30)

HotKeySet("{F10}", "Isjungti")
HotKeySet("{INSERT}", "Loot")
HotKeySet("{Home}", "Help")
HotKeySet("{Delete}", "EvilSpirit")
Func Isjungti()
    TrayTip("Exit!", "Botas isjungiamas", 2, 1)
    Sleep(2000)
    Exit
EndFunc

Func Loot()
    $loot = NOT $loot
    If $loot Then 
        TrayTip("Loot", "Loot funkcija ijungta", 2, 1)
    Else 
        TrayTip("Loot", "Loot funkcija isjungta", 2, 1)
    EndIf
    Do
        Send("{SPACE}")
        Sleep(100)
    Until NOT $loot
EndFunc

Func Help()
    TrayTip("Info", "Loot funkcija INSERT", 2, 1)
EndFunc

Func EvilSpirit()
    $es = NOT $es
    If $es Then
        TrayTip("Evil Spirit", "Evil Spirit funkcija ijungta" & $es, 2, 1)
        WinActivate("MU")
        Send("{ENTER}")
        Send("/Request off")
        Send("{Enter}")
    Else
        TrayTip("Evil Spirit", "Evil Spirit funkcija  isjungta" & $es, 2, 1)
    EndIf
    Do
        Sleep(100)
        MouseMove(405, 280)
        Send("{1}")
        MouseClickDrag("Right", 405, 280, 405, 250, 10)
    Until NOT $es
EndFunc

While 1
    Sleep(100)
WEnd
Link to comment
Share on other sites

How to make theese both loops working at the same time?

Put conditional execution of both inside the While/WEnd loop. The HotKeySet() functions only toggle the flags for what to run:

Global $loot, $es

Opt("SendKeyDownDelay", 30)
Opt("MouseClickDelay", 30)

HotKeySet("{F10}", "Isjungti")
HotKeySet("{INSERT}", "Loot")
HotKeySet("{Home}", "Help")
HotKeySet("{Delete}", "EvilSpirit")

While 1
    If $loot Then
        ;
        ; Do some "loot" stuff here
        ;
    EndIf
    If $es Then
        ;
        ; Do some "es" stuff here
        ;
    EndIf
    Sleep(100)
WEnd

Func Isjungti()
    TrayTip("Exit!", "Botas isjungiamas", 2, 1)
    Sleep(2000)
    Exit
EndFunc   ;==>Isjungti

Func Help()
    TrayTip("Info", "Loot funkcija INSERT", 2, 1)
EndFunc   ;==>Help

Func Loot()
    $loot = Not $loot
EndFunc   ;==>Loot

Func EvilSpirit()
    $es = Not $es
EndFunc   ;==>EvilSpirit
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...