Jump to content

Sleep() Micro Secs


Recommended Posts

Hello all,

I created a simple test loop to sleep for certain amt of time and submit to a particular php website(to cast votes for myself :think: ). My question is that if I do tat, and that the website is able to get the timing as precise to microsecs(php can get microsecs timing?), they would know it would be a non human since the microsecs part would always be the same interval? how do i randomise around this such that it would behave like a human has submit the entry?

thanks for your help guys.

Link to comment
Share on other sites

You could use a random number to sleep instead of using the same number during each loop. You might want to take a look at the Random() function in the help file.

; Sleep anywhere from 1 to 5 seconds
$Amount = Random(1000, 5000, 1)
Sleep($Amount)
Link to comment
Share on other sites

You could use a random number to sleep instead of using the same number during each loop. You might want to take a look at the Random() function in the help file.

; Sleep anywhere from 1 to 5 seconds
$Amount = Random(1000, 5000, 1)
Sleep($Amount)
hi Emperor,

indeed i could use a random function. but the microsecs would still be the same? Help anyone??

Edited by derrick
Link to comment
Share on other sites

hi Emperor,

indeed i could use a random function. but the microsecs would still be the same? Help anyone??

HI,

no they won't thats what the Random func is for. :think:

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

HI,

no they won't thats what the Random func is for. :think:

So long,

Mega

HI,

or have a look at:

While 1
    ToolTip(@Hour & ':' & @Min & ':' & @Sec & ':' & _MSec())
    Sleep(1)
WEnd

Exit

Func _MSec()
    Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort')
    DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime))

    $sMilliSeconds = StringFormat('%03d', DllStructGetData($stSystemTime, 8))
    
    $stSystemTime = 0
    
    Return $sMilliSeconds
EndFunc

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

HI,

or have a look at:

While 1
    ToolTip(@Hour & ':' & @Min & ':' & @Sec & ':' & _MSec())
    Sleep(1)
WEnd

Exit

Func _MSec()
    Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort')
    DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime))

    $sMilliSeconds = StringFormat('%03d', DllStructGetData($stSystemTime, 8))
    
    $stSystemTime = 0
    
    Return $sMilliSeconds
EndFunc

So long,

Mega

Hi Mega,

maybe i need some explanation :think: You mean that tat if

$time=random(1,1000,1)

sleep($time)

sleep(1) would generate a different microsecs as sleep(2)?

Link to comment
Share on other sites

Hi Mega,

maybe i need some explanation :think: You mean that tat if

$time=random(1,1000,1)

sleep($time)

sleep(1) would generate a different microsecs as sleep(2)?

Hi,

try this to check: I cannot say 100 %, but I seems like that ...

$begin = TimerInit()
Sleep(1)
$dif = TimerDiff($begin)
ConsoleWrite("Time Difference " & $dif)

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Hi,

try this to check: I cannot say 100 %, but I seems like that ...

$begin = TimerInit()
Sleep(1)
$dif = TimerDiff($begin)
ConsoleWrite("Time Difference " & $dif)

So long,

Mega

ha the value of the time difference is 14.91083665050776. This is in terms of wat unit?

Link to comment
Share on other sites

ha the value of the time difference is 14.91083665050776. This is in terms of wat unit?

HI,

that's because your system needs a little time to do the things. :( Try it with lets say Sleep(2000) or even 3000 and then you'll see it is much better. :think:

For $i=1 To 10
$begin = TimerInit()
Sleep(2000)
$dif = TimerDiff($begin)
ConsoleWrite($i & " Time Difference " & $dif & @CR)
Next

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

HI,

that's because your system needs a little time to do the things. :) Try it with lets say Sleep(2000) or even 3000 and then you'll see it is much better. :think:

For $i=1 To 10
$begin = TimerInit()
Sleep(2000)
$dif = TimerDiff($begin)
ConsoleWrite($i & " Time Difference " & $dif & @CR)
Next

So long,

Mega

ha you have been great help :( thanks. I love this forum. Very fast help!!! ;)

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