Klickgeschwindigkeit
Weiß jemand wie man unter Linux (Shell) programmieren kann, das man 10 Sekunden lang klickt und dann jeden Mausklick zählt um sie am Ende dann durch 10 zu teilen?
Please also mark the comments that contributed to the solution of the article
Content-Key: 290175
Url: https://administrator.de/contentid/290175
Printed on: April 27, 2024 at 03:04 o'clock
6 Comments
Latest comment
Hä?
Ich glaub das ist mal wieder so ein Ecstasy-Schlucker-Wettbewerb wer die Maus als erster mit seinen epileptischen Bewegungen schrotten kann Wohl ein Nikolaus-Scherz
Oder mit xbindkeys arbeiten ginge auch.
Grüße Uwe
#!/bin/bash
action ()
{
read -p "Press enter to start the click orgy ;-P"
xbindkeys
t_start=$(date +"%s")
touch "$counter"
while [[ $(date +"%s") -lt $(($t_start + 10)) ]] ;do
clear
echo "Total clicks: "$(cat "$counter" | wc -l)
sleep .2
done
clear
numclicks=$(echo "scale=2;$(cat $counter | wc -l)/10" | bc)
echo "Final result clicks/s: $numclicks"
if (( $(bc <<< "$numclicks < 6") ));then
echo "You are a lame asshole, my friend!"
else
echo "WOW you are on LSD sir"
fi
killall xbindkeys >/dev/null 2>&1
rm "$counter" >/dev/null 2>&1
read -n 1 -p 'Startover (y/n) ?:' startover
shopt -s nocasematch
if [[ $startover == y ]] ;then action ;fi
clear
}
counter="/tmp/counter.txt"
killall xbindkeys >/dev/null 2>&1
echo -e "\"echo 1 >>$counter\"\n b:1">~/.xbindkeysrc
action
rm ~/.xbindkeysrc >/dev/null 2>&1