Simba Code:
program Cosher;
{$Define SMART}
{$I SRL-6/SRL.Simba}
{$i srl-6/lib/misc/srlplayerform.simba}
{$I SPS/lib/SPS-RS3.Simba}
// -----------------------------------------------------------------------------
// --------- customize user values here ------------------
// -----------------------------------------------------------------------------
var
StartingXP : Integer;
FoundColours : TPointArray;
SortedColours : T2DPointArray;
SearchBox : TBox;
const
Version := '1.1';
MiniBreak := 20000;
MiniBreakDelta := 15000;
MiniBreakChance := 6;
SessionTime := 240;
SearchColour := 3490645;
BirdColour := 4521983;
ColourAdj := ColorSetting(2, 0.05, 0.18);
MM_DIR := MM_DIRECTION_NORTH;
// -----------------------------------------------------------------------------
// FindVolunteer()
//
// Attmepts to find the trainer and lure him
// -----------------------------------------------------------------------------
function FindVolunteer: Boolean;
var
i, h: Integer;
p: Tpoint;
begin
FindColorsTolerance(FoundColours, SearchColour, SearchBox, 7, ColourAdj);
if (Length(FoundColours) < 1) then
begin
Writeln('Volunteer Not Found');
Exit(false);
end;
SortedColours := FoundColours.ToATPA(20, 20);
SortATPAFromMidPoint(SortedColours, Point(randomRange(mainscreen.playerpoint.x,
mainscreen.playerpoint.x), mainscreen.playerpoint.y));
h := High(SortedColours);
for i := 0 to h do
begin
if (Length(SortedColours[i]) < 50) then
Continue;
Mouse(SortedColours[i][random(High(SortedColours[i]))], MOUSE_MOVE, MOUSE_HUMAN);
if IsMouseOverText(['alk', '-to', 'Cosh', 'volun', 'teer'], 500) then
begin
fastclick(mouse_right);
Wait(450+RandomRange(50,100));
chooseOption._select(['ure', 'Lure'], MOUSE_LEFT, true, 1.00, 300);
Wait(500+RandomRange(500,1000));
Exit(true);
end
else
begin
Writeln('Volunteer Not Found');
Exit(false);
end;
end;
end;
// -----------------------------------------------------------------------------
// GoThruChat()
//
// If we are chatting navigate out of the chat and return true.
// If we are not chatting (lure failed), return false.
// -----------------------------------------------------------------------------
function GoThruChat : Boolean;
begin
if (conversationBox.areTalking()) then
begin
conversationBox.continue(true, true);
Wait(200+Random(100));
conversationBox.continue(true, true);
Wait(500+Random(100));
Exit(true);
end;
Exit(false);
end;
// -----------------------------------------------------------------------------
// KnockKnock()
//
// Attempts to knock out the trainer after he has been lured.
// -----------------------------------------------------------------------------
function KnockKnock: Boolean;
var
i, h: Integer;
t: TTimeMarker;
begin
FindColorsTolerance(FoundColours, SearchColour, SearchBox, 7, ColourAdj);
if (Length(FoundColours) < 1) then
Exit;
SortedColours := FoundColours.ToATPA(20, 20);
SortATPAFromMidPoint(SortedColours, Point(randomRange(mainscreen.playerpoint.x,
mainscreen.playerpoint.x), mainscreen.playerpoint.y));
h := High(SortedColours);
for i := 0 to h do
begin
if (Length(SortedColours[i]) < 50) then
Continue;
Mouse(SortedColours[i][random(High(SortedColours[i]))], MOUSE_MOVE, MOUSE_HUMAN);
if IsMouseOverText(['alk', '-to', 'Cosh', 'volun', 'teer'], 500) then
begin
fastclick(mouse_right);
Wait(500);
chooseOption._select(['nock', '-out'], MOUSE_LEFT, true, 1.00, 300);
Exit(true);
end
else
begin
Writeln('Volunteer Not Found');
Exit(false);
end;
end;
end;
// -----------------------------------------------------------------------------
// TripleLoot()
//
// Spam quick option selects for looting.
// The fifth click has a 70% change of going off.
// -----------------------------------------------------------------------------
function TripleLoot : Boolean;
var
MouseX, MouseY : Integer;
begin
mouseSpeed := 35;
mouseOval(365, 217, 10, 10, MOUSE_RIGHT);
chooseOption.select(['oot']);
mouseSpeed := 32;
mouseOval(365, 217, 10, 10, MOUSE_RIGHT);
chooseOption.select(['oot']);
FindColorsTolerance(FoundColours, BirdColour, SearchBox, 8, ColourAdj);
if (Length(FoundColours) >= 1) then
begin
writeln('Failed Knocking out');
Exit(false);
end;
mouseSpeed := 30;
mouseOval(365, 217, 10, 10, MOUSE_RIGHT);
chooseOption.select(['oot']);
mouseSpeed := 28;
mouseOval(365, 217, 10, 10, MOUSE_RIGHT);
chooseOption.select(['oot']);
mouseSpeed := 25;
mouseOval(365, 217, 10, 10, MOUSE_RIGHT);
chooseOption.select(['oot']);
mouseSpeed := 20;
Exit(True);
end;
// -----------------------------------------------------------------------------
// fixScreenSettings()
//
// Tries to set the screen the way we want it
// Adapted from bonsaiPowerMiner
// -----------------------------------------------------------------------------
procedure fixScreenSettings();
begin
mainscreen.setZoom(false);
mainscreen.setangle(MS_ANGLE_HIGH);
minimap.setAngle(MM_DIR);
end;
// -----------------------------------------------------------------------------
// AntiBan()
//
// Performs random Anti-Ban movements
// Adapted from limoCosher
// -----------------------------------------------------------------------------
procedure AntiBan;
begin
Case Random(200) Of
1: begin
writeln('Antiban activated: Hovering Thieving.');
HoverSkill(SKILL_THIEVING);
end;
2: begin
writeln('Antiban activated: Hovering random skill.');
hoverRandomSkill();
end;
4: begin
writeln('Antiban activated: MiniWait');
Wait(2500 + random(4500));
end;
6: begin
writeln('Antiban activated: PickUpMouse');
PickUpMouse();
end;
7: begin
writeln('Antiban activated: Random Movement');
wait(randomRange(400,900));
smallRandomMouse(randomRange(50, 230));
wait(randomRange(400,900));
end;
8: begin
writeln('Antiban activated: RandomRClick');
mouseOffClient(OFF_CLIENT_RANDOM);
wait(randomRange(5500, 10400));
end;
end;
end;
// -----------------------------------------------------------------------------
// mainFunction()
//
// main loop that runs the program
// -----------------------------------------------------------------------------
var
found, i : Boolean;
TotalBreak, fail : Integer;
begin
fail := 0;
disableSRLDebug := true;
SetupSRL();
fixScreenSettings();
SearchBox := IntToBox(
mainscreen.playerpoint.x,
mainscreen.playerpoint.y-70,
mainscreen.playerpoint.x+200,
mainscreen.y2
);
while (true) do
begin
if(fail > 10) then
begin
Writeln('Too many failures, Exiting');
Break;
end;
if(GetTimeRunning() >= SessionTime*60000) then
begin
writeln('Session Ended');
Exit();
end;
found := FindVolunteer();
Wait(350+RandomRange(20,350));
if(found = true) then
begin
if(GoThruChat() = true) then
begin
Wait(100+RandomRange(50,150));
KnockKnock();
Wait(700+RandomRange(50,100));
if(TripleLoot() = true) then
begin
Wait(950+RandomRange(100,200));
fail := 0;
end
else
Wait(3050+RandomRange(100,400));
end
else
Wait(1000+RandomRange(500,1000));
end
else
begin
fail := fail + 1;
Writeln('Failed: ', fail, ' times');
end;
if(RandomRange(1,200) < MiniBreakChance) then
begin
TotalBreak := MiniBreak+Random(MiniBreakDelta);
Writeln('MiniBreak Active For: ', TotalBreak, 'ms');
Wait(TotalBreak);
end;
AntiBan();
end;
end.