 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
daviddd
Joined: 12 Dec 2006 Posts: 1
|
Posted: Tue Dec 12, 2006 1:03 am Post subject: Random Sleep Time...Help |
|
|
Hey, I'm no expert at all at AHK, I've been looking around and searching for parts of the code that I want to make. i've found this so far but when the code "sleeps" for the 4 seconds, it doesnt seem to change at all from 4 seconds each time. This is my script.
^m::
{
RandSleep(4000)
{
Global STime
sMaxVal= STime+(STime/15)
sMinVal= STime-(STime/15)
Random, STime, sMinVal, sMaxVal
return STime
}
Loop 28
{
PixelSearch, outx, outy, 233, 267, 370, 395,
0x0E1523,,Fast
MouseClick, Left, %outx%, %outy%, 1
Sleep 4000
}
return
}
Most likely i have things in the wrong order or missing parts, because I am new to this.. Any help would be appreciated. |
|
| Back to top |
|
 |
.AHK
Joined: 26 Apr 2006 Posts: 662 Location: USA
|
Posted: Tue Dec 12, 2006 1:40 am Post subject: |
|
|
| Code: | ^m::
Loop 28 {
PixelSearch, outx, outy, 233, 267, 370, 395, 0x0E1523,, Fast
MouseClick, Left, %outx%, %outy%, 1
Random zZzZZz, 1000, 10000
Sleep %zZzZZz%
}
return |
Thats should work. |
|
| Back to top |
|
 |
slomz
Joined: 03 Sep 2006 Posts: 608 Location: Iowa, U.S.
|
Posted: Tue Dec 12, 2006 4:27 am Post subject: |
|
|
?lol, y not just
? _________________
 |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5068 Location: imaginationland
|
Posted: Tue Dec 12, 2006 9:40 am Post subject: |
|
|
This is probably what you wanted: | Code: | ^m::
Loop 28 {
PixelSearch, outx, outy, 233, 267, 370, 395, 0x0E1523, , Fast
sTime := RandSleep(4000)
Sleep, %sTime%
}
Return
RandSleep(mid) {
min := mid * 16/15
max := mid * 14/15
Random, val, %min%, %max%
Return, Round(val)
} |
_________________
RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2") |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|