-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrade.sh
executable file
·112 lines (100 loc) · 2.49 KB
/
trade.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
#!/bin/bash
if [ $# -ne 2 ]; then
echo give pipe args
exit 1
fi
export PIPE="$1"
export PIPES="$1 $2"
source poke-lib.sh
while true
do
for PIPE in $PIPES
do
timeout=10
while ! check_color 301 946 28 135 149 16
do
echo "Waiting for trade complete on $PIPE"
# Check for new biggest
if check_color 301 946 240 240 240 16 ; then
click 301 946
fi
timeout=$(( timeout - 1 ))
echo "Countdown $timeout"
if [ $timeout -le 0 ]; then
echo "No trade complete $PIPE"
exit 1
fi
done
click 494,849
done
for PIPE in $PIPES
do
timeout=10
while ! check_color 115 182 233 243 223 16
do
echo "Waiting for trading screen on $PIPE"
timeout=$(( timeout - 1 ))
echo "Countdown $timeout"
if [ $timeout -le 0 ]; then
echo "No trading screen on $PIPE"
exit 1
fi
done
done
sleep 2
for PIPE in $PIPES
do
click 104 357
done
for PIPE in $PIPES
do
timeout=10
while ! check_color 199 838 150 218 149 20
do
echo "Waiting for send OK on $PIPE"
timeout=$(( timeout - 1 ))
echo "Countdown $timeout"
if [ $timeout -le 0 ]; then
echo "No send OK on $PIPE"
exit 1
fi
done
sleep 1
click 199 838
done
for PIPE in $PIPES
do
timeout=10
while ! check_color 11 521 105 208 146 20
do
echo "Waiting for send OK on $PIPE"
timeout=$(( timeout - 1 ))
echo "Countdown $timeout"
if [ $timeout -le 0 ]; then
echo "No send OK on $PIPE"
exit 1
fi
done
click 11 521
done
for PIPE in $PIPES
do
timeout=10
while ! check_color 301 946 28 135 149 16
do
echo "Waiting for trade complete on $PIPE"
# Check for new biggest
if check_color 301 946 240 240 240 16 ; then
click 301 946
fi
timeout=$(( timeout - 1 ))
echo "Countdown $timeout"
if [ $timeout -le 0 ]; then
echo "No trade complete $PIPE"
exit 1
fi
done
click 301 946
done
sleep 1
done