- Joined
- Apr 22, 2005
- Sythe Gold
- 23
- Messages
- 7,825
In C++[Win32]:
VB6:
C#:
This is virtually the same thing I used for my autoclicker.
Code:
#include <windows.h>
#include <stdlib.h>
void RandWait(DWORD nMinSleepTime, DWORD nMaxSleepTime)
{
srand(GetTickCount());
Sleep((rand()%nMaxSleepTime-nMinSleepTime)+nMinSleepTime);
}
VB6:
Code:
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliSeconds As Long)
Private Sub RandWait(Min As Long, Max As Long)
Randomize GetTickCount
Sleep Int(Rnd * (Max - Min)) + Min
End Sub
Code:
[DllImport("kernel32.dll")]
public static extern void Sleep(int dwMilliSeconds);
static void RandWait(int min, int max)
{
Random RandomClass = new Random();
int RandomNumber = RandomClass.Next();
Sleep((RandomNumber%(max-min))+min);
}
This is virtually the same thing I used for my autoclicker.













