-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathfiremaker.simba
More file actions
296 lines (244 loc) · 7.32 KB
/
firemaker.simba
File metadata and controls
296 lines (244 loc) · 7.32 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
{$I SRL-T/osr.simba}
{$I WaspLib/osr.simba}
begin
Login.PlayerIndex := 0;
end;
type
ERSLogs = (REGULAR_LOGS, ACHEY_LOGS, OAK_LOGS, WILLOW_LOGS, TEAK_LOGS,
ARCTIC_LOGS, MAPLE_LOGS, MAHOGANY_LOGS, YEW_LOGS, BLISTER_LOGS,
MAGIC_LOGS, REDWOOD_LOGS);
var
CurrentLogs: ERSLogs := ERSLogs.OAK_LOGS;
type
EBurnerState = (
WAIT_STATE,
BURN_LOG,
CHANGE_START,
SMALL_STEP,
OPEN_BANK,
WITHDRAW_LOG,
WITHDRAW_TOOL,
CLOSE_INTERFACE,
TELEPORT,
WALK_SPOT,
LEVEL_UP,
CLOSE_CONTEXT,
END_SCRIPT
);
TLogBurner = record(TBaseBankScript)
State: EBurnerState;
NextStartingPoint: TPoint;
StartingPoints: TPointArray;
Fire: TRSObject;
Logs: TRSItem;
Tool: TRSBankWithdrawItem;
ToolSlot: Int32;
BurnTimer: TCountDown;
Material: TRSBankWithdrawItem;
end;
procedure TAntiban.Setup(); override;
begin
inherited;
Self.Skills := [ERSSkill.FIREMAKING, ERSSkill.TOTAL];
Self.MinZoom := 15;
Self.MaxZoom := 40;
end;
procedure TLogBurner.SetupLogs;
begin
case CurrentLogs of
ERSLogs.REGULAR_LOGS: Logs := 'Logs';
ERSLogs.ACHEY_LOGS: Logs := 'Achey tree logs';
ERSLogs.OAK_LOGS: Logs := 'Oak logs';
ERSLogs.WILLOW_LOGS: Logs := 'Willow logs';
ERSLogs.TEAK_LOGS: Logs := 'Teak logs';
ERSLogs.ARCTIC_LOGS: Logs := 'Arctic pine logs';
ERSLogs.MAPLE_LOGS: Logs := 'Maple logs';
ERSLogs.MAHOGANY_LOGS: Logs := 'Mahogany logs';
ERSLogs.YEW_LOGS: Logs := 'Yew logs';
ERSLogs.BLISTER_LOGS: Logs := 'Blisterwood logs';
ERSLogs.MAGIC_LOGS: Logs := 'Magic logs';
ERSLogs.REDWOOD_LOGS: Logs := 'Redwood logs';
end;
end;
procedure TLogBurner.Init(maxActions: UInt32; maxTime: UInt64); override;
begin
'AIO Firemaker';
inherited;
Self.RSW.Setup('x7789y2306');
Self.ScriptBank := RSObjects.GEBank;
Self.SetupLogs;
Tool := ['Tinderbox', 1, False];
Material := [Logs, Bank.QUANTITY_ALL, False];
StartingPoints := [[8086, 2548], [8086, 2540]];
NextStartingPoint := StartingPoints[0];
Fire := RSObjects.BurningFire;
BurnTimer.Setup(30000);
if not RSClient.IsLoggedIn() then
Login.LoginPlayer();
if not Inventory.FindItem(Tool.Item, ToolSlot) then
ToolSlot := -1;
if WLSettings.RemoteInput.HUDDebug then
begin
DebugObjectArray += @Self.ScriptBank;
DebugObjectArray += @Fire;
end;
end;
function TRSMainScreen.GetPlayerFloorBox: TBox;
var
A: Double := Minimap.GetCompassAngle(False);
Center: TPoint := Minimap.Center;
TPA: TPointArray;
begin
TPA := [Minimap.VecToMS(Vec3(Center.X - 1, Center.Y, 3), A),
Minimap.VecToMS(Vec3(Center.X + 1, Center.Y, -3), A)];
Result := TPA.Bounds();
end;
procedure TLogBurner.ChangeStartingPoint;
begin
if NextStartingPoint = StartingPoints[0] then
NextStartingPoint := StartingPoints[1]
else
NextStartingPoint := StartingPoints[0];
Fire.Coordinates := PopulateTile(NextStartingPoint, 2);
end;
function TLogBurner.SmallStep: Boolean;
var
Tile: TPoint;
Tiles: TPointArray := PopulateTile(Self.RSW.GetMyPos, [1, 1, 0, 0]);
begin
for Tile in Tiles do
begin
Fire.Coordinates := [Tile];
if Fire.Find then
begin
Self.RSW.WebWalk(Tile, 1, 0.2);
Exit(True);
end;
end;
end;
function TLogBurner.WalkNextPoint: Boolean;
begin
if Result := Self.RSW.WebWalk(NextStartingPoint, 12, 0.2) then
Self.ChangeStartingPoint;
end;
function TLogBurner.Teleport: Boolean;
begin
//if Magic.Open() and not Magic.CanActivate(ERSSPell.VARROCK_TELEPORT) then
Self.WalkNextPoint;
//else if Magic.CastSpell(ERSSpell.VARROCK_TELEPORT) then
// Wait(1200);
Result := WaitUntil(Self.RSW.AtTile(NextStartingPoint, 40), 100, 9000);
if Result then
Wait(1200);
end;
function TLogBurner.Withdraw(Item: TRSBankWithdrawItem): Boolean;
var
UseQuantityButton: Boolean := Item.Quantity <> 1;
InvCount: Int32;
begin
if Self.BankTab = -1 then
Self.BankTab := Bank.FindItemTab(Item.Item);
InvCount := Inventory.Count();
if Result := Bank.WithdrawItem(Self.BankTab, Item, UseQuantityButton) then
WaitUntil(Inventory.Count() > InvCount, 100, 3000);
end;
function TLogBurner.BurnLogs: Boolean;
var
InvCount: Int32 := Inventory.CountItem(Material.Item);
begin
WL.PreviousXP := XPBar.Read;
if Inventory.Use(ToolSlot, Material.Item) then
begin
Wait(800);
if InvCount > Inventory.CountItem(Material.Item) then
begin
if Inventory.FindItem(Material.Item) then
Inventory.SetSelectedSlot(ToolSlot);
BurnTimer.Restart(Random(-3000, 0));
repeat
Wait(100);
if Chat.LeveledUp() then
begin
Inventory.SetSelectedItem(ToolSlot);
Mouse.Move(MainScreen.GetPlayerFloorBox);
if MainScreen.IsUpText('ogs') then
Mouse.Click(MOUSE_LEFT)
else
Break;
end;
until BurnTimer.IsFinished() or XPBar.EarnedXP();
Wait(600, 800);
end;
end;
end;
function TLogBurner.GetState(): EBurnerState;
var
MyPos: TPoint;
begin
if WL.Activity.IsFinished() then
Exit(EBurnerState.END_SCRIPT);
if ChooseOption.IsOpen() then
Exit(EBurnerState.CLOSE_CONTEXT);
if Chat.LeveledUp() then
Exit(EBurnerState.LEVEL_UP);
if MainScreen.HasInterface() then
begin
if Bank.IsOpen() then
begin
if Inventory.FindItem(Tool.Item) and Inventory.FindItem(Material.Item) then
Exit(EBurnerState.CLOSE_INTERFACE);
if not Inventory.FindItem(Tool.Item) then
Exit(EBurnerState.WITHDRAW_TOOL);
if not Inventory.FindItem(Material.Item) then
Exit(EBurnerState.WITHDRAW_LOG);
end;
Exit(EBurnerState.CLOSE_INTERFACE);
end;
if (Inventory.IsSlotUsed(ToolSlot) or Inventory.FindItem(Tool.Item, ToolSlot)) and Inventory.FindItem(Material.Item) then
begin
MyPos := Self.RSW.GetMyPos();
if MyPos.WithinDistance(Self.ScriptBank.Coordinates, 12) then
Exit(EBurnerState.TELEPORT);
if Inventory.IsFull() and not MyPos.WithinDistance(NextStartingPoint, 12) then
begin
if Fire.Find then
Exit(EBurnerState.CHANGE_START);
Exit(EBurnerState.WALK_SPOT);
end;
Exit(EBurnerState.BURN_LOG);
end;
Exit(EBurnerState.Open_BANK);
end;
procedure TLogBurner.Run(maxActions: UInt32; maxTime: UInt64);
begin
Self.Init(MaxActions, MaxTime);
repeat
Self.State := Self.GetState();
Self.Action := ToStr(Self.State);
case Self.State of
EBurnerState.WAIT_STATE: Wait(800, 850);
EBurnerState.BURN_LOG: Self.BurnLogs;
EBurnerState.CHANGE_START: Self.ChangeStartingPoint;
EBurnerState.SMALL_STEP: Self.SmallStep;
EBurnerState.Open_BANK: Bank.WalkOpen();
EBurnerState.WITHDRAW_LOG: Self.Withdraw(Material);
EBurnerState.WITHDRAW_TOOL: Self.Withdraw(Tool);
EBurnerState.CLOSE_INTERFACE: MainScreen.CloseInterface();
EBurnerState.TELEPORT: Self.Teleport;
EBurnerState.WALK_SPOT: Self.WalkNextPoint;
EBurnerState.LEVEL_UP: Chat.HandleLevelUp(True);
EBurnerState.CLOSE_CONTEXT: ChooseOption.Close();
EBurnerState.END_SCRIPT: Break;
end;
Self.DoAntiban();
until Self.ShouldStop();
end;
var
LogBurner: TLogBurner;
function TRSInventory.IsSlotUsed(Slot: Int32): Boolean; override;
begin
Result := (Slot > -1) and Self.Open() and Self.IsSlotUsed(Self.GetSlotBox(Slot));
end;
begin
LogBurner.Run(WLSettings.MaxActions, WLSettings.MaxTime);
end.