Simba Code:
function DismissAllRandoms: Boolean;
var
Npc, Random, MyIndex: Integer;
Npcs: TReflectNPCArray;
Randoms: TStringArray;
begin
Randoms := ['dunce', 'molly', 'niles', 'miles', 'giles', 'sandwich lady',
'drunken dwarf', 'highwayman', 'dr jekyll', 'cap' 'n hand',
'security guard', 'rick turpentine', 'mysterious old man',
'frog', 'null', 'mime', 'sergeant damien', 'freaky forester',
'strange plant', 'postie pete', 'tilt', 'flippa', 'leo',
'pillory guard', 'evil bob'];
Npcs.GetAll();
MyIndex := TReflectLocalPlayer.GetPlayerIndex;
for Npc := 0 to High(Npcs) do
begin
if (Npcs[Npc].GetInteractingIndex() = MyIndex) then
begin
for Random := 0 to High(Randoms) do
begin
if (Pos(Randoms[Random], Lowercase(Npcs[Npc].GetName())) > 0) then
begin
if R_InteractTile(Npcs[Npc].GetTile(), 'Dismiss', 0, 0, 50) then
begin
MyPlayer.FFlag(0);
Wait(RandomRange(500, 5000));
Reflect.Logger.Status('Dismissed random: ' + Npcs[Npc].GetName);
Result := True;
end;
end;
end;
end;
end;
end;
function R_InteractTile(Tile: TPoint; Action: string; X: integer = 0; Y: integer = 0; Z: integer = 0): Boolean;
var
RSTile: TPoint;
begin
if R_TileOnMS(Tile, RSTile, X, Y, Z) then
begin
Reflect.Mouse.Move(RSTile, 3, 3);
if Reflect.Text.IsUpText(Action) then
begin
Reflect.Mouse.Click(MOUSE_LEFT);
Result := Reflect.Mouse.DidClick(true, 1000);
end
else
begin
if Reflect.Text.OptionExists(Action) then
begin
Reflect.Mouse.Click(MOUSE_RIGHT);
Result := Reflect.Text.ChooseOption(Action);
end;
if not Result then
Reflect.Antiban.HumanRandomMouse;
end;
end;
end;
function R_TileOnMS(Tile: TPoint; OutputPoint: TPoint; X: integer = 0; Y: integer = 0; Z: integer = 0): Boolean;
var
TempBox: TBox;
begin
OutputPoint := Reflect.Tiles.TileToMS(Tile, X, Y, Z);
TempBox := IntToBox(MSX1, MSY1, MSX2, MSY2);
Result := PointInBox(OutputPoint, TempBox);
end;