-
Notifications
You must be signed in to change notification settings - Fork 0
/
switchAccounts.sh
executable file
·217 lines (194 loc) · 2.94 KB
/
switchAccounts.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#!/bin/bash
COUNT=2
DELAY=200
CARD_NUMBER=6111009155198613
CARD_SECURITY=42826123
PAGE_LOAD_DELAY=2000
sd() {
if [ $# -eq 0 ]
then
sleep `bc <<<"scale=3; $DELAY/1000"`
else
sleep `bc <<<"scale=3; $1/1000"`
fi
}
selectURL() {
xdotool key Control_L+l
sd
}
rmURL() {
xdotool key Shift_L+Delete
sd
}
backspace() {
xdotool key BackSpace
sd
}
click() {
xdotool click 1
sd
}
fill() {
str="$@"
for i in $(eval echo "{0..${#str}}")
do
char="${str:$i:1}"
if [ "$char" == ' ' ]
then
xdotool key space
elif [ "$char" == ':' ]
then
#xdotool key 'shift+semicolon'
xdotool key colon
elif [ "$char" == '.' ]
then
xdotool key period
elif [ "$char" == '/' ]
then
xdotool key slash
elif [ "$char" == '_' ]
then
xdotool key underscore
elif [ "$char" == '@' ]
then
xdotool key at
else
xdotool key "$char"
fi
done
sd
}
enter() {
xdotool key Return
sd
}
up() {
xdotool key Up
sd
}
down() {
xdotool key Down
sd
}
left() {
xdotool key Left
sd
}
right() {
xdotool key Right
sd
}
tab() {
xdotool key Tab
sd
}
move() {
xdotool mousemove "$1" "$2"
sd
}
mover() {
xdotool mousemove_relative -- "$1" "$2"
sd
}
getTo() {
URL="$1"
move 391 182
click
selectURL
fill "$URL"
rmURL
enter
sd $PAGE_LOAD_DELAY
}
log_in() {
email=$1
getTo starbucks.com
move 429 179
click
sd $PAGE_LOAD_DELAY
move 186 485
click
fill "$email"
tab
fill LE_PASSWORd123
enter
sd $PAGE_LOAD_DELAY
}
log_out() {
getTo starbucks.com
move 391 182
click
move 377 352
click
sd $PAGE_LOAD_DELAY
}
addCard() {
#move 191 350
#click
#sd $PAGE_LOAD_DELAY
getTo starbucks.com/account/card
move 99 467
click
sd $PAGE_LOAD_DELAY
move 444 640
click
sd $PAGE_LOAD_DELAY
tab
tab
fill $CARD_NUMBER
tab
fill $CARD_SECURITY
tab
tab
tab
enter
#tab
#fill "Michael"
#tab
#fill "Black"
#tab
#fill "3549 Iowa Avenue"
#tab
#fill "Apt C4"
#tab
#fill "Riverside"
#tab
#fill "California"
#tab
#fill "92521"
#tab
#fill "9093592050"
#tab
#tab
#fill "April"
#tab
#fill "20"
#tab
#fill "Seattle"
#enter
sd $PAGE_LOAD_DELAY
sd $PAGE_LOAD_DELAY
}
removeCard() {
getTo starbucks.com/account/card
move 101 775
click
sd $PAGE_LOAD_DELAY
move 226 777
click
tab
fill " "
tab
enter
sd $PAGE_LOAD_DELAY
}
while [ 1 -lt 2 ]
do
for address in `./permute [email protected] $COUNT`
do
log_in "$address"
addCard
removeCard
log_out
done
done