Sign in to follow this  
Followers 0
JeEnYuS

Need assistance with loops

5 posts in this topic

Alright so im new to this. Basically I am writing a basic script for just clicking/dragging on the screen and i want the whole script to loop but inside that loop i want another section to loop by itself, if you catch my drift. Example, my script movements are a, b, c, and d. I want the whole script to continuous loop but say every 20 minutes i want c and d to loop inside this loop. Do you get what I'm saying? I tried to look for something similar to this in the forum but i can't seem to find it.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I'm a little confused but would this work for you?

$begin = TimerInit()
While 1
    Sleep(100)
    If TimerDiff($begin) > 5000 Then
        MsgBox(0, "", "5 seconds have passed")
        $begin = TimerInit()
    EndIf
WEnd

Not quite sure if thats the best way to do it but I'm not totally sure what you want to do.

PS. Welcome to the foum!

Edited by someone

While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites

I am not totally following you (posting code will help), but you can try using adlibenable :

AdlibEnable( "runmeevery20minutes", 20 * 60 * 1000 )
While 1
    Sleep(10)
    ;do stuff here
WEnd
Func runmeevery20minutes()
    MsgBox(0, "Trigger", "It has been 20 minutes" )
EndFunc

Share this post


Link to post
Share on other sites

forgive me if i do this wrong..like i said this is my first time to this forum as actually playing with scripts..so im sure these scripts extremely..uh..noobie lol

i am going to merge these 2 scripts once i finish the main one

this is the main script

Run("C:/Program Files/Guild Wars/gw.Exe" )
Sleep(10000)
MouseClick( "left", 908, 415)
Sleep(90000)
MouseClick( "left", 853, 557)
MouseClick( "left", 853, 557) 
Sleep(1000)
MouseClickDrag( "left", 532, 391, 640, 400)
Sleep(1000)
MouseClick("left", 272, 173)
Sleep(1000)
MouseClick("left" 882, 561)
Sleep(1000)
MouseClick("left", 656, 408)
Sleep(1000)oÝ÷ ÚØb²+-ërÝj¼¬r¸©¶,ÛaÊ'zÚ+ºw¯z¼¶Òh§º×¬jëh×6Run("c:/program files/guild wars/gw.exe")
Sleep(10000)
Send( "g" )
Sleep(1000)
MouseClick( "left", 361, 137)
Sleep(20000)
Send( "g" )
Sleep(1000)
MouseClick( "left", 596, 165)
Sleep(10000)
Send( "v" )
Send( "{SPACE}" )  
Sleep(5000)
MouseClick( "left", 543, 485)
Sleep(1000)
MouseClick( "left", 526, 435)
Send( "g")
sleep(1000)
MouseClick( "left", 361, 137)
Sleep(10000)
Send("g")
Sleep(1000)

so basically i want the main script looping consistently but every 20 minutes i want the secondary script to kick in for me..i know this isn't a very technical script..im still learning this stuff :P..i hope this helps to help me out..i wish to learn a lot more of scripting...i find it rather fun so far :)

Share this post


Link to post
Share on other sites

I am not totally following you (posting code will help), but you can try using adlibenable :

AdlibEnable( "runmeevery20minutes", 20 * 60 * 1000 )
While 1
    Sleep(10)
    ;do stuff here
WEnd
Func runmeevery20minutes()
    MsgBox(0, "Trigger", "It has been 20 minutes" )
EndFunc
so would this be the script i need to do what i want?

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