Adding Kwikset doorlock.
[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         
18         date +"%m/%d/%Y %r"
19         #./adb shell getevent -l - use this command to get the position
20         # TP-Link switch
21         #./adb shell input tap 1002 913
22         # TP-Link bulb on/off
23         ./adb shell input tap 994 560
24         # D-Link switch
25         #./adb shell input tap 987 346
26         # SmartThings
27         #./adb shell input tap 921 1188
28         # WeMo
29         #./adb shell input tap 981 532
30         # WeMo Insight
31         #./adb shell input tap 981 326
32         # Kwikset doorlock
33         #if (( $i % 2 ))
34         #then
35                 # locking
36         #       ./adb shell input tap 153 1211
37         #else
38                 # unlocking
39         #       ./adb shell input tap 520 1211
40         #fi
41         #date +%r
42         #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA]
43         #RAND=$[`jot -r 1 $RAN_STA $RAN_END`]
44         #echo "Delay: $RAND seconds"
45         #sleep $[$RAND]s
46         
47         # pick a prime number > 120 seconds
48         sleep 131s
49 done