-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathAlcherHelper.simba
More file actions
202 lines (165 loc) · 5.05 KB
/
AlcherHelper.simba
File metadata and controls
202 lines (165 loc) · 5.05 KB
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
{
Alcher helper
Author: ineedbot
Date: 06/02/2022
It alchs for you
}
program AlcherHelper;
{$DEFINE SRL_USE_REMOTEINPUT}
{$I SRL/osr.simba}
{$F-}
{$include_once Utils/Utils.simba}
type
ECastType = (
ALCH,
TELE,
BOTH
);
const
EMODE = ECastType.BOTH;
var
ClickTimer, MouseInvMoveTimer, MouseMoveTimer, MagicTabOpenTimer: TCountDown;
uptxt: String;
nats, laws: TRSItem;
xp: Int32;
alchB, teleB, B: TBox;
curTab: ERSGameTab;
begin
// general setup
Login.AddPlayer('', '');
Script.AntiBanEnergy.SetupBiometrics();
Script.AntiBanEnergy.BoxPTRad := 0.3;
Script.AntiBan.Name := 'Antiban';
Script.SleepRate := 50;
Mouse.Speed := 17 + Round(BioRandomFixed() * 10) + Random(-2, 2);
Script.BaseMouseSpeed := Mouse.Speed;
Script.MaxTiredMouseSpeed := 10;
MainScreen.UpTextFilter := TOCRAnyColorRule.Create(85, 75);
// setup and gather init info
GameTabs.Open(ERSGameTab.INVENTORY);
Mouse.Click(Inventory.GetSlotBox(27), MOUSE_RIGHT);
GameTabs.Open(ERSGameTab.MAGIC);
Magic.GetSpellBox(ERSSpell.CAMELOT_TELEPORT, teleB);
Magic.GetSpellBox(ERSSpell.HIGH_LEVEL_ALCHEMY, alchB);
GameTabs.Open(ERSGameTab.INVENTORY);
alchB := alchB.OverlappingArea(Inventory.GetSlotBox(11));
GameTabs.Open(ERSGameTab.MAGIC);
ClickTimer.Init(1);
MouseInvMoveTimer.Init(1);
MouseMoveTimer.Init(1);
MagicTabOpenTimer.Init(1);
nats := 'Nature rune';
laws := 'Law rune';
if EMODE = ECastType.TELE then
B := teleB
else
B := alchB;
// setup our mouse
Mouse.Move(B, True);
// do it forever!
while True do
begin
// dont spin loop!
Wait(Script.MainLoopWaitAmount(False));
Script.UpdateMouseSpeed();
// logged in.
if not RSClient.IsLoggedIn() then
continue;
// make sure we have supplies
curTab := GameTabs.GetCurrentTab();
uptxt := MainScreen.GetUpText().Strip();
if curTab = ERSGameTab.INVENTORY then
begin
if ((EMODE = ECastType.BOTH) or (EMODE = ECastType.ALCH)) and not Inventory.FindItem(nats) or not Inventory.IsSlotUsed(11) then
continue;
if ((EMODE = ECastType.BOTH) or (EMODE = ECastType.TELE)) and not Inventory.FindItem(laws) then
continue;
end;
// both mode!
if EMODE = ECastType.BOTH then
begin
// lets cast alch
xp := XPBar.ReadXPBar();
if (curTab <> ERSGameTab.MAGIC) and (Random() < 0.7) then
GameTabs.Open(ERSGameTab.MAGIC);
// activate the spell
Mouse.Click(alchB, MOUSE_LEFT);
WaitCheckFocused(0, 750, wdLeft);
Mouse.Click(alchB, MOUSE_LEFT);
WaitCheckFocused(95, 750, wdLeft);
// hover next
if Random() < 0.9 then
Mouse.Move(teleB);
// wait for xp
if not XPBar.WaitChange(xp, SRL.SkewedRand(2500, 2000, 3000)) then
continue;
WaitCheckFocused(0, 1000, wdLeft);
// lets cast tele
xp := XPBar.ReadXPBar();
Mouse.Click(teleB, MOUSE_LEFT);
WaitCheckFocused(0, 750, wdLeft);
// hover next
if Random() < 0.9 then
Mouse.Move(alchB);
// wait for xp
if not XPBar.WaitChange(xp, SRL.SkewedRand(2500, 2000, 3000)) then
continue;
// wait
if not Script.IsFocusing() then
Wait(1500, SRL.SkewedRand(1750, 1500, 3333), wdLeft)
else
Wait(1450, SRL.SkewedRand(1500, 1500, 2000), wdLeft);
continue;
end;
// make sure our uptext is valid
// make sure our mouse is in position
if not Mouse.Position().InBox(B) or
not ('Use' in uptxt) and not ('Cast' in uptxt) and not ('Teleport' in uptxt) and not ('Alch' in uptxt) then
begin
if MouseInvMoveTimer.IsFinished() then
begin
Mouse.Move(B, True);
MouseInvMoveTimer.Restart(30000);
end;
continue;
end
else
MouseInvMoveTimer.Restart(30000);
// make sure we see the magic tab every once in a while
if curTab <> ERSGameTab.MAGIC then
begin
if MagicTabOpenTimer.IsFinished() then
begin
GameTabs.Open(ERSGameTab.MAGIC);
Mouse.Move(B);
end;
end
else
MagicTabOpenTimer.Restart(10000);
// check if we should wiggle our mouse
if MouseMoveTimer.IsFinished() then
begin
Mouse.Move(Mouse.Position().Random(-4, 4, True));
Wait(SRL.SkewedRand(100, 0, 1000));
if not Mouse.Position().InBox(B) then
Mouse.Move(B);
if Random() < 0.95 then
MouseMoveTimer.Restart(SRL.SkewedRand(1000 * 60 * 20, 1000 * 60 * 15, 1000 * 60 * 30))
else if Random() < 0.8 then
MouseMoveTimer.Restart(SRL.SkewedRand(1000 * 60 * 5, 1000 * 60 * 2, 1000 * 60 * 8))
else
MouseMoveTimer.Restart(SRL.SkewedRand(1000 * 60 * 10, 1000 * 60 * 1, 1000 * 60 * 50));
end;
// check if we should click
if ClickTimer.IsFinished() then
begin
Mouse.Click(MOUSE_LEFT);
if Random() < 0.95 then
ClickTimer.Restart(SRL.SkewedRand(100, 50, 200))
else if Random() < 0.9 then
ClickTimer.Restart(SRL.SkewedRand(500, 50, 1000))
else
ClickTimer.Restart(SRL.SkewedRand(1000, 50, 10000));
end;
end;
end.