-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathquest_helper.simba
More file actions
99 lines (74 loc) · 1.71 KB
/
quest_helper.simba
File metadata and controls
99 lines (74 loc) · 1.71 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
//This script is made to be used with runelite and quest helper
{$I SRL/osr.simba}
{$I WaspLib/osr.simba}
begin
Login.PlayerIndex := 0;
end;
type
EState = (
WAIT_STATE,
CONTINUE_CHAT,
CHOOSE_CHAT_OPTION
);
TScript = record(TBaseScript)
State: EState;
end;
procedure TAntiban.Setup(); override;
begin
inherited;
Self.Skills := [ERSSkill.TOTAL];
Self.MinZoom := 15;
Self.MaxZoom := 40;
end;
procedure TScript.Init(maxActions: UInt32; maxTime: UInt64); override;
begin
'Quest Helper';
inherited;
if not RSClient.IsLoggedIn() then
Login.LoginPlayer();
end;
function TScript.HasChatOption: Boolean
begin
Result := Chat.GetOptions([11710976, CHAT_COLOR_WHITE]) <> [];
end;
function TScript.ChooseChatOption: Boolean;
var
Options: TRSChatboxOptionArray;
begin
Options := Chat.GetOptions([11710976]);
if Options = [] then
Options := Chat.GetOptions([CHAT_COLOR_WHITE]);
if Options = [] then
Exit;
Result := True;
Mouse.Click(Options[0].Bounds, MOUSE_LEFT);
end;
function TScript.GetState(): EState;
begin
if ChooseOption.IsOpen() then
Exit(WAIT_STATE);
if Chat.HasContinue then
Exit(CONTINUE_CHAT);
if Self.HasChatOption then
Exit(CHOOSE_CHAT_OPTION);
Exit(WAIT_STATE);
end;
procedure TScript.Run(maxActions: UInt32; maxTime: UInt64);
begin
ClearDebug();
Self.Init(MaxActions, MaxTime);
repeat
Self.State := Self.GetState();
Self.SetAction(ToStr(Self.State));
case Self.State of
WAIT_STATE: Wait(500, 800);
CONTINUE_CHAT: Chat.ClickContinue(True);
CHOOSE_CHAT_OPTION: Self.ChooseChatOption;
end;
until False;
end;
var
Script: TScript;
begin
Script.Run(WLSettings.MaxActions, WLSettings.MaxTime);
end.