Jump to content

Break in script.


Guest tanja
 Share

Recommended Posts

Guest tanja

I'm making simple script, and I want to:

- send "2" (works)

- put on right mouse button few times (works)

- make 10 seconds break (that's my problem)

- send "3" (works)

- put on right mouse button few times (works)

I tried to do break with "sleep" but can't (script is still working, but not "sleeping" when should).

Code of this one function:

$i = 0
func start()
$i = 0
While $i <= 10
Send(2)
MouseClick("right", 300, 400, 5)

; Here I want script to do nothing for 10 seconds...

Send(3)
MouseClick("right", 300, 400, 10)
wend
endfunc

Oh, one question more: how to do something between few loops with code like this one? I mean I want to make for example five loops like this one, and then send "xyz", and again do five loops...

Edited by tanja
Link to comment
Share on other sites

I'm making simple script, and I want to:

- send "2" (works)

- put on right mouse button few times (works)

- make 10 seconds break (that's my problem)

- send "3" (works)

- put on right mouse button few times (works)

I tried to do break with "sleep" but can't (script is still working, but not "sleeping" when should).

Code of this one function:

$i = 0
func start()
$i = 0
While $i <= 10
Send(2)
MouseClick("right", 300, 400, 5)

; Here I want script to do nothing for 10 seconds...

Send(3)
MouseClick("right", 300, 400, 10)
wend
endfunc

<{POST_SNAPBACK}>

Read about Sleep()

If you need 10 secs., write:

Sleep(10000)
Edited by Josbe
Link to comment
Share on other sites

Guest tanja

Doesn't work as I said.

I'll try to do it again but it won't...

Here's other thing works like "sleep"? Maybe it can't be cause that's pretty fast loop and I've a few functions inside? (one key is starting one function what is looping without end).

Edited by tanja
Link to comment
Share on other sites

Doesn't work as I said.

I'll try to do it again but it won't...

Here's other thing works like "sleep"? Maybe it can't be cause that's pretty fast loop and I've a few functions inside? (one key is starting one function what is looping without end).

<{POST_SNAPBACK}>

Doesn't work ?

Show an error?

Don't pause the script?

Very fast/slow?

Link to comment
Share on other sites

Doesn't work as I said.

I'll try to do it again but it won't...

have you read the post of josbe? sleep() expects its argument in MILISECONDS, not seconds. So, if you want to sleep for 10 seconds, you'll have to specify a value of 10*1000 ==> sleep(10000) and NOT sleep(10).

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

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...