Jump to content
Sign in to follow this  
Busser

Have 2 macros in 1 program

Recommended Posts

Busser

hi i was wandering if it is possible to have 2 macros running at different times so i can do this

MACRO 1

While 1

WinActivate("CABAL")

Send("{F2}")

Send("{2}")

Sleep(300500)

If Not @error Then

EndIf

Wend

MACRO 2

While 1

WinActivate("CABAL")

Send("{F4}")

Send("{9}")

Sleep(150500)

If Not @error Then

EndIf

Wend

it is for a game if you didn't figure that out, but they have to be runned seprate but with the same macro if that is possible i have looked in the help file and icould not see anything on it that icould find

so any help would be great

THanx for read

Busser

Share this post


Link to post
Share on other sites
ZoSTeR

You could use two timer variables:

$timer1 = TimerInit()
$timer2 = TimerInit()
While 1
    sleep(50)
    
    $diff1 = TimerDiff($timer1)
    If $diff1 >= 2000 Then
        ConsoleWrite("1: " & $diff1 & @CRLF)
        $timer1 = TimerInit()
    EndIf
    
    $diff2 = TimerDiff($timer2)
    If $diff2 >= 500 Then
        ConsoleWrite("2: " & $diff2 & @CRLF)
        $timer2 = TimerInit()
    EndIf
WEnd

And please use the [ AutoIt ] tags or at least a different color. I nearly went blind :)

Share this post


Link to post
Share on other sites
i542

hi i was wandering if it is possible to have 2 macros running at different times so i can do this

MACRO 1

While 1

WinActivate("CABAL")

Send("{F2}")

Send("{2}")

Sleep(300500)

If Not @error Then

EndIf

Wend

MACRO 2

While 1

WinActivate("CABAL")

Send("{F4}")

Send("{9}")

Sleep(150500)

If Not @error Then

EndIf

Wend

it is for a game if you didn't figure that out, but they have to be runned seprate but with the same macro if that is possible i have looked in the help file and icould not see anything on it that icould find

so any help would be great

THanx for read

Busser

My eyes...

While 1
    WinActivate("CABAL")
        Send("{F2}")
        Send("{2}")
        Sleep(300500)
         WinActivate("CABAL")
        Send("{F4}")
        Send("{9}")
        Sleep(150500)
     If Not @error Then
EndIf

Wend
This script activates window CABAL, sends F2, then 2, waits 300 seconds, activates CABAL again, sends F4, 9, waits 150 seconds then all again :)

I can do signature me.

Share this post


Link to post
Share on other sites
Busser

basicly i want to have both of those macros running in 1 just like they would of ran if i made them seperate and had 2 macros running so there seprate but 1

hopefully that makes sence

i jsut want it so that i don't have to have like 2-5 different macros running on my at one time jsut combine them into one but have then run sepratly in that one

hahahah

HAY this makes sence in my head

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  

×