0

I have always used autoIt for windows for this but i need to do it on ubuntu or centOS now. Basicly what i want is to send an mouseclick or button after an randomized time example:

~

HotKeySet("{ESC}", "Terminate") ; hotkey for stopping script

While 1
 Sleep(Random(120000, 180000)) ;waits random between 2 and 3 minutes before sending a left mouse click 
 MouseClick("Left")
 Sleep(Random(60000, 120000)) ; wait random between 1 and 2 minutes to send O
 Send("O")
 Sleep(Random(10000, 20000)) ; waits random between 10 and 20 seconds to send a left mouse click
 MouseClick("Left")
WEnd

Func Terminate()
 Exit
EndFunc

~

is there an program wich can do this? i have looked around but i couldn't find something i can understand. Thanks in advance

RapidGainz
  • 141
  • 1
  • 1
  • 4

1 Answers1

0

In Linux you usually use a bash script to do something like this. In order to get a mouse click, you need to install xdotool:

sudo apt install xdotool

Now, you can write a simple bash-script. Just run

nano bash_script.sh

Now paste following code:

#!/bin/bash
while true
do
  sleep $((120 + RANDOM % 60))
  xdotool click 1
  sleep $((60 + RANDOM % 60))
  echo '0'
  sleep $((10 + RANDOM % 10))
  xdotool click 1
done

Run sudo chmod u+x bash_script.sh in order to make your script executable. Last, you can start your script with

sh bash_script.sh
prog2de
  • 133