-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrade bot script prototype with no minimum value.ahk
121 lines (103 loc) · 1.75 KB
/
trade bot script prototype with no minimum value.ahk
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
;InputBox, betamnt,, please input the base amount of money you want to bet. please input a multiple of 10.
global Money := 1
global tradepercycle := 2
global tradeTime:=5000
global sessionLength:=100
;time should be 10 seconds
Class Instance
{
__New(direction)
{
this.errorCount :=0
this.color := "blue"
this.direction := direction
this.firstTime:=0
}
getColor()
{
found:=0
xChange := 638
while(found = 0)
{
PixelGetColor, colorVar, xChange, 708
if(colorVar = "0x3553F4" and this.firstTime = 1)
{
found:=1
;Msgbox this is red
this.errorCount := this.errorCount + 1
}
else
{
found :=1
;Msgbox this is green
this.errorCount := 0
}
this.firstTime:=1
xChange := xChange - 1
;Msgbox % xChange
}
}
bet()
{
modifier := 2**this.errorcount
;Msgbox % modifier
Var := Money * modifier
MouseClick, left, 1793, 260
MouseClick,left,1793,260
Send {BS}{BS}{BS}{BS}
Send % Var
if (this.direction = "up"){
MouseClick, left, 1745,564
}
else{
MouseClick, left,1757,670
}
if(this.direction = "up")
{
this.direction := "down"
}
else
{
this.direction := "up"
}
}
}
array := []
loop, % tradepercycle
{
Value := Mod(A_Index, 2)
if(Value = 0){
array.Push(new Instance("up"))
}
else{
array.Push(new Instance("down"))
}
}
F1::
loop
{
alpha := A_Index
for each, Instance in array
{
Instance.getColor()
if(alpha < sessionLength or Instance.errorCount != 0)
{
Instance.bet()
}
else
{
array.RemoveAt(A_Index)
}
if(Instance.errorCount >= 9){
Msgbox we lost 9 times in a row :(
Msgbox boy, you were really unlucky.
ExitApp
}
slpamnt := (tradeTime/tradepercycle)+500
sleep % slpamnt
}
}
return
F2::
ExitApp
return