Skip to content

Instantly share code, notes, and snippets.

@jogonba2
Last active August 29, 2015 14:21
Show Gist options
  • Save jogonba2/8f0f90caf47af323526f to your computer and use it in GitHub Desktop.
Save jogonba2/8f0f90caf47af323526f to your computer and use it in GitHub Desktop.
NetLogo Bug Hunt Speeds random prey.
#include <windows.h>
#include <time.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
srand(time(NULL));
int x = 0;
int uppery = 170;
int downy = 600;
int leftx = 285;
int rightx = 725;
int randx = 0;
int randy = 0;
int iterations = 50000;
// LU 285,170 | RU 725,170 | RD 725,600 | LD 285,600 //
for(x=0;x<=50000;x++){
randx = rand() % (rightx-leftx+1) + leftx;
randy = rand() % (downy-uppery+1) + uppery;
SetCursorPos(randx,randy);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment