|
Post by willingtolearnnewbie on Mar 2, 2020 5:46:04 GMT
Goodday sirs, is there a way to loop some codes for a specified amount of time and then execute another loop for another specified amount of time then loop both infinitely?
|
|
|
Post by Exilereven on Mar 2, 2020 12:57:52 GMT
You want Timer()
It's in quick api
|
|
|
Post by willingtolearnnewbie on Mar 3, 2020 7:04:12 GMT
You want Timer() It's in quick api Goodday sir, i made script like this --loop 1 While true do Reg:existsClick(image.png) Wait(10) Break --i put break to exit this infinite loop and to execute the 2nd loop End --loop 2 While timer:check() <= 30 do Reg:existsClick(image1.png) Wait(2) Reg:existsClick(image2.png) Wait(1) End However, the second while loop ends, and starts the loop again from the first while loop, how can i make the 2nd while loop to continuously execute command within a specific amount of time? Cant figure how will i use timer on it, please help
|
|
|
Post by Exilereven on Mar 4, 2020 19:20:16 GMT
Use this link to see an example. ankulua.boards.net/thread/13/advanced-methods#TimerHere is kind of what your code could look like. --loop 1 while true do reg:existsClick('image.png', 1) wait(10) break --i put break to exit this infinite loop and to execute the 2nd loop end --loop 2 local _timer = Timer() --this is where time starts while (_timer:check() <= 30) do reg:existsClick('image1.png', 1) wait(2) reg:existsClick('image2.png', 1) wait(1) end _timer:set() --to reset timer.
|
|
|
Post by willingtolearnnewbie on Mar 5, 2020 16:32:42 GMT
Use this link to see an example. ankulua.boards.net/thread/13/advanced-methods#TimerHere is kind of what your code could look like. --loop 1 while true do reg:existsClick('image.png', 1) wait(10) break --i put break to exit this infinite loop and to execute the 2nd loop end --loop 2 local _timer = Timer() --this is where time starts while (_timer:check() <= 30) do reg:existsClick('image1.png', 1) wait(2) reg:existsClick('image2.png', 1) wait(1) end _timer:set() --to reset timer. Many thanks sir, it helped me alot more power!
|
|