Merge branch 'master' of https://github.uci.edu/rtrimana/smart_home_traffic
[pingpong.git] / automation / clicker.sh
1 #!/bin/bash
2
3 # This script does clicking action automatically
4 # We just need to set up the timer duration
5
6 # Loop variables
7 BEGIN=1
8 END=100
9 INC=1
10
11 # Range of random number (in seconds)
12 RAN_STA=100
13 RAN_END=200
14
15 for ((i=$BEGIN; i<=$END; i+=$INC));
16 do
17         #./adb shell getevent -l - use this command to get the position
18         # TP-Link switch
19         #./adb shell input tap 1002 913
20         # D-Link switch
21         #./adb shell input tap 987 346
22         # SmartThings
23         ./adb shell input tap 921 1188
24         #date +%r
25         date +"%m/%d/%Y %r"
26         #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA]
27         #RAND=$[`jot -r 1 $RAN_STA $RAN_END`]
28         #echo "Delay: $RAND seconds"
29         #sleep $[$RAND]s
30         
31         # pick a prime number > 120 seconds
32         sleep 131s
33 done