Deleting unused VPN scripts.
[pingpong.git] / automation / clickers1.sh
1 #!/bin/bash
2
3 # This script does clicking action automatically
4 # We just need to set up the timer duration
5
6 # Parameters:
7 # $1 : device identification (run "adb devices" to figure out)
8
9 # Loop variables
10 BEGIN=1
11 END=100
12 #END=2
13 INC=1
14 DEVICE=$1
15
16 # Range of random number (in seconds)
17 RAN_STA=100
18 RAN_END=200
19
20 for ((i=$BEGIN; i<=$END; i+=$INC));
21 do
22         
23         date +"%m/%d/%Y %r"
24         #./adb shell getevent -l - use this command to get the position
25         # Click on screen
26         #./adb -s "$DEVICE" shell input tap 500 1500
27         # TP-Link switch
28         #./adb -s "$DEVICE" shell input tap 1002 913
29         # TP-Link bulb on/off
30         #./adb -s "$DEVICE" shell input tap 994 560
31         # D-Link switch
32         #./adb -s "$DEVICE" shell input tap 987 346
33         # D-Link motion sensor
34         #./adb -s "$DEVICE" shell input tap 975 840
35         # SmartThings plug
36         #./adb -s "$DEVICE" shell input tap 921 1188
37         #./adb -s "$DEVICE" shell input tap 533 653
38         # WeMo, WeMo Insight, LiFX bulbs, Hue bulbs with ST-app
39         #./adb -s "$DEVICE" shell input tap 533 653
40         # WeMo
41         #./adb -s "$DEVICE" shell input tap 981 532
42         # WeMo Insight
43         #./adb -s "$DEVICE" shell input tap 981 326
44         # Kwikset doorlock
45         #if (( $i % 2 ))
46         #then
47                 # locking
48         #       ./adb -s "$DEVICE" shell input tap 153 1211
49         #else
50                 # unlocking
51         #       ./adb -s "$DEVICE" shell input tap 520 1211
52         #fi
53         # Hue bulb
54         #./adb -s "$DEVICE" shell input tap 923 383
55         # Lifx bulb
56         #./adb -s "$DEVICE" shell input tap 506 580
57         # Amcrest camera
58         #if (( $i % 2 ))
59         #then
60                 # live view
61         #       ./adb -s "$DEVICE" shell input tap 92 139
62         #       ./adb -s "$DEVICE" shell input tap 92 139
63         #else
64                 # stop live view (go to playback)
65         #       ./adb -s "$DEVICE" shell input tap 92 139
66         #       ./adb -s "$DEVICE" shell input tap 92 250
67         #fi
68         # Arlo camera
69         #if (( $i % 2 ))
70         #then
71                 # live view
72                 #./adb -s "$DEVICE" shell input tap 532 740
73         #       ./adb -s "$DEVICE" shell input tap 533 653
74         #else
75                 # stop live view
76                 #./adb -s "$DEVICE" shell input tap 101 1012
77         #       ./adb -s "$DEVICE" shell input tap 533 653
78         #       ./adb -s "$DEVICE" shell input tap 533 653
79         #       ./adb -s "$DEVICE" shell input tap 533 653
80         #fi
81         # Blossom - turning on/off 1 zone
82         #if (( $i % 2 ))
83         #then
84                 # start watering
85         #       ./adb -s "$DEVICE" shell input tap 538 1597
86         #else
87                 # stop watering
88         #       ./adb -s "$DEVICE" shell input tap 496 1533
89         #fi
90         # Blossom - change mode active/hibernate
91         #./adb -s "$DEVICE" shell input tap 1002 1176
92         # Dlink siren
93         #./adb -s "$DEVICE" shell input tap 994 802
94         # Nest thermostat
95         #if (( $i % 2))
96         #then
97                 # start fan
98         #       ./adb -s "$DEVICE" shell input tap 524 1668
99         #       ./adb -s "$DEVICE" shell input tap 936 1709
100         #else
101                 # stop fan
102         #       ./adb -s "$DEVICE" shell input tap 524 1668
103         #       ./adb -s "$DEVICE" shell input tap 679 1702
104         #fi
105         # Alexa
106         #if (( $i % 2))
107         #then
108                 # Using Google Translate and 
109                 #       having her speak to Alexa
110                 # Question 1
111         #        ./adb -s "$DEVICE" shell input tap 907 145
112         #        ./adb -s "$DEVICE" shell input tap 543 692
113         #       ./adb -s "$DEVICE" shell input tap 148 775
114         #else
115                 # Question 2
116         #        ./adb -s "$DEVICE" shell input tap 907 145
117         #        ./adb -s "$DEVICE" shell input tap 463 1668
118         #       ./adb -s "$DEVICE" shell input tap 148 775
119         #fi
120         #date +%r
121         #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA]
122         #RAND=$[`jot -r 1 $RAN_STA $RAN_END`]
123         #echo "Delay: $RAND seconds"
124         #sleep $[$RAND]s
125
126         # TP-Link bulb - change colors & intensity
127         #if (( $i % 2 ))
128         #then
129                 # color 1 - horizontal
130                 #./adb -s "$DEVICE" shell input tap 250 1000
131                 # color 3 - vertical
132                 #./adb -s "$DEVICE" shell input tap 500 1250
133                 # intensity change
134         #        ./adb -s "$DEVICE" shell input tap 150 1405
135         #else
136                 # color 2 - horizontal
137                 #./adb -s "$DEVICE" shell input tap 750 1000
138                 # color 4 - vertical
139                 #./adb -s "$DEVICE" shell input tap 500 750
140                 # intensity change
141         #        ./adb -s "$DEVICE" shell input tap 950 1405
142         #fi
143         # Hue bulb - change intensity
144         #if (( $i % 2 ))
145         #then
146                 # intensity change (bright)
147         #        ./adb -s "$DEVICE" shell input tap 300 550
148         #else
149                 # intensity change (dimmed)
150         #        ./adb -s "$DEVICE" shell input tap 800 550
151         #fi
152         # Arlo camera - arm/disarm
153         #if (( $i % 2 ))
154         #then
155                 # Arm
156         #        ./adb -s "$DEVICE" shell input tap 500 500
157         #else
158                 # Disarm
159         #        ./adb -s "$DEVICE" shell input tap 500 750
160         #fi
161         # Arlo camera - record
162         #./adb -s "$DEVICE" shell input tap 515 923
163         #./adb -s "$DEVICE" shell input tap 524 883
164         # Arlo camera - sound (on/off)
165         #./adb -s "$DEVICE" shell input tap 70 850
166         # Nest thermostat mode change (heat/cool)
167         #if (( $i % 2))
168         #then
169                 # auto (heat/cool)
170         #       ./adb -s "$DEVICE" shell input tap 110 1700
171         #       ./adb -s "$DEVICE" shell input tap 110 1600
172         #else
173                 # off
174         #       ./adb -s "$DEVICE" shell input tap 110 1700
175         #       ./adb -s "$DEVICE" shell input tap 110 1700
176         #fi
177         # Nest thermostat mode change (start/stop eco mode)
178         #./adb -s "$DEVICE" shell input tap 350 1700
179         #./adb -s "$DEVICE" shell input tap 350 1600
180         # Sengled bulb - ON/OFF
181         #./adb -s "$DEVICE" shell input tap 550 800
182         # Sengled bulb - intensity
183         #if (( $i % 2 ))
184         #then
185                 # 1%
186         #        ./adb -s "$DEVICE" shell input tap 70 1150
187         #else
188                 # 100%
189         #        ./adb -s "$DEVICE" shell input tap 1020 1150
190         #fi
191         # Rachio sprinkler - ON/OFF
192         #if (( $i % 2 ))
193         #then
194                 # ON
195         #        ./adb -s "$DEVICE" shell input tap 900 1500
196         #        ./adb -s "$DEVICE" shell input tap 300 600
197         #        ./adb -s "$DEVICE" shell input tap 800 1700
198         #        ./adb -s "$DEVICE" shell input tap 800 1700
199         #else
200                 # OFF/PAUSE
201         #        ./adb -s "$DEVICE" shell input tap 920 1650
202         #fi
203         # Rachio sprinkler - standby/active
204         #if (( $i % 2 ))
205         #then
206                 # Standby mode
207         #        ./adb -s "$DEVICE" shell input tap 700 700
208         #        ./adb -s "$DEVICE" shell input tap 700 1100
209         #else
210                 # Active mode
211         #        ./adb -s "$DEVICE" shell input tap 600 700
212         #fi
213         # Ring doorbell - ring alerts
214         ./adb -s "$DEVICE" shell input tap 1000 570
215         # Ring doorbell - motion alerts
216         #./adb -s "$DEVICE" shell input tap 1000 750
217         # Ecobee thermostat - ON/OFF
218         #if (( $i % 2 ))
219         #then
220                 # ON (Auto)
221         #        ./adb -s "$DEVICE" shell input tap 550 550
222         #else
223                 # OFF
224         #        ./adb -s "$DEVICE" shell input tap 550 650
225         #fi
226         # Ecobee thermostat - fan ON/Auto
227         #if (( $i % 2 ))
228         #then
229                 # ON
230         #        ./adb -s "$DEVICE" shell input tap 900 650
231         #else
232                 # Auto
233         #        ./adb -s "$DEVICE" shell input tap 700 650
234         #fi
235         # Nest camera - ON/OFF
236         #./adb -s "$DEVICE" shell input tap 1020 320
237         # Nest camera - Audio Talk/Done
238         #./adb -s "$DEVICE" shell input tap 550 1650
239         # Nest camera - Mic ON/OFF
240         #./adb -s "$DEVICE" shell input tap 1020 630
241         # Roomba - ON/OFF
242         #if (( $i % 2 ))
243         #then
244                 # ON
245         #        ./adb -s "$DEVICE" shell input tap 550 950
246         #else
247                 # OFF
248         #        ./adb -s "$DEVICE" shell input tap 550 950
249         #        sleep 1s # need a short sleep here
250         #        ./adb -s "$DEVICE" shell input tap 550 1600
251         #        sleep 1s # need a short sleep here
252         #        ./adb -s "$DEVICE" shell input tap 550 950
253         #fi
254         # Amazon plug - ON/OFF
255         #./adb -s "$DEVICE" shell input tap 550 700
256         # Ring Alarm - Arm/Disarm
257         #if (( $i % 2 ))
258         #then
259                 # Arm (Away)
260         #        ./adb -s "$DEVICE" shell input tap 850 350
261         #else
262                 # Disarm
263         #        ./adb -s "$DEVICE" shell input tap 300 350
264         #fi
265
266         # pick a prime number > 120 seconds
267         sleep 131s
268         #sleep 13s
269 done
270 #ssh root@192.168.1.1 "kill -9 19327 19332"