Sign in to follow this  
Followers 0
Blank_101

Help with running multiple scripts at once

6 posts in this topic

I am writing a script and in that script i want it to moniter one function every 10 seconds as well as press a button every 2-5 mins. I have all the code but i do not know how to make autoit v3 run two scripts at once. Is there a way?

Share this post


Link to post
Share on other sites



you can use adlib on most functions, or use a loop to check.

while 1
dosomething()
dosomethingelse()
wend

func dosomething()
if 1=2 then exit
endfunc

func dosomething()
if 1=1 then tooltip("running",0,0)
endfunc

You can also just make your first script run your second script.


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

you can use adlib on most functions, or use a loop to check.

OK This is a piece of my code...Now i dont fully understand the adlib command....I've read the help file but i still don't full understand it. What I wanna do is make it so it scans and then checks the value of the scan and if it is 7105644 I want it to then Press the NUMPAD1 key then move on to recheck the value of $var. Now im sorta new at this so my code might be a little bad, but is there a way to make it so that it executes what the function does but doesnt make it so it waits the $random timer to recommence the script, just to set the $anti variable to 1 again.

Func Anti()
    Sleep($random)
    $anti = 1
EndFunc
$var = PixelGetColor(32, 558)
Do
    Select
  Case $var = 7105644
     If $anti = 1 Then
    $anti = 0
    $random = Random($idlemin, $idlemax)
    Send("{NUMPAD1}")
    anti()
     EndIf
                                                Sleep($scan)
     $var = PixelGetColor(32, 558)
                                                etc...

Share this post


Link to post
Share on other sites

ok, maybe this will explain adlib a bit

AdlibEnable ("count1",500); check every half second (500ms=.5 sec)
$count1=0
$count2=0
While 1
    tooltip($count2 & " - " & $count1,0,0)
    sleep(1000); wait 1 second
    $count2=$count2 + 1
Wend


Func count1()
    $count1=$count1+1
EndFunc

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

yes thanks a lot script kiddy....i got it working! :D

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

.. i do not know how to make autoit v3 run two scripts at once. Is there a way?

Just for the record .. yes, you can run multiple scripts at once. Either compiled to EXE or interpreted, or both. You can even run the same script several times concurrently.

How: you just start the first script, and then you start the second, and then ..

:D

Edited by trids

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