Simba Code:
program SimpleSuperheat;
{$DEFINE SMART}
{$IFDEF SMART}
{$i SRL\SRL\Misc\SMART.scar}
{$ENDIF}
{$i SRL\SRL.scar}
var
Global: TPoint;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Pin := '';
Players[CurrentPlayer].Loc := 'Banking';
Active := True;
Strings[0] := 'Gold';
Integers[0] := 7500;
Booleans[0] := True;
end;
end;
type TOre = record
UpText: TStringArray;
Color: Integer;
Tolerance: Byte;
Amount: Byte;
end;
var
TOreArray: Array [0..1] of TOre;
BreakIn, BreakFor: Integer;
function CreateOre(Color, Tolerance: Integer): Integer;
var
DMP: TDTMPointDef;
DSP: Array [0..5] of TDTMPointDef;
TempTDTM: TDTM;
begin
DMP.x := 450;
DMP.y := 108;
DMP.AreaSize := 5;
DMP.AreaShape := 0;
DMP.Color := Color;
DMP.Tolerance := Tolerance;
DSP[0].x := 450;
DSP[0].y := 108;
DSP[0].AreaSize := 5;
DSP[0].AreaShape := 0;
DSP[0].Color := Color;
DSP[0].Tolerance := Tolerance;
DSP[1].x := 460;
DSP[1].y := 112;
DSP[1].AreaSize := 1;
DSP[1].AreaShape := 0;
DSP[1].Color := 131072;
DSP[1].Tolerance := 255;
DSP[2].x := 446;
DSP[2].y := 121;
DSP[2].AreaSize := 1;
DSP[2].AreaShape := 0;
DSP[2].Color := 131072;
DSP[2].Tolerance := 255;
DSP[3].x := 434;
DSP[3].y := 108;
DSP[3].AreaSize := 1;
DSP[3].AreaShape := 0;
DSP[3].Color := 131072;
DSP[3].Tolerance := 255;
DSP[4].x := 463;
DSP[4].y := 101;
DSP[4].AreaSize := 1;
DSP[4].AreaShape := 0;
DSP[4].Color := 131072;
DSP[4].Tolerance := 255;
DSP[5].x := 438;
DSP[5].y := 115;
DSP[5].AreaSize := 1;
DSP[5].AreaShape := 0;
DSP[5].Color := 131072;
DSP[5].Tolerance := 255;
TempTDTM.MainPoint := DMP;
TempTDTM.SubPoints := DSP;
Result := AddDTM(TempTDTM);
end;
procedure DeclareOres;
begin
case Players[CurrentPlayer].Strings[0] of
'Iron':
with TOreArray[0] do
begin
UpText := ['ron ore'];
Color := 1449523;
Tolerance := 20;
Amount := 28;
end;
'Steel':
begin
with TOreArray[0] do
begin
UpText := ['ron ore'];
Color := 1449523;
Tolerance := 20;
Amount := 14;
end;
with TOreArray[1] do
begin
UpText := ['oal'];
Color := 1778724;
Tolerance := 20;
Amount := 14;
end;
end;
'Gold':
with TOreArray[0] do
begin
UpText := ['old ore'];
Color := 1741495;
Tolerance := 15;
Amount := 28;
end;
'Mithril':
begin
with TOreArray[0] do
begin
UpText := ['ithril ore'];
Color := 5256757;
Tolerance := 20;
Amount := 5;
end;
with TOreArray[1] do
begin
UpText := ['oal'];
Color := 1778724;
Tolerance := 20;
Amount := 20;
end;
end;
'Adamantite', 'Adamant':
begin
with TOreArray[0] do
begin
UpText := ['damantite ore'];
Color := 4081469;
Tolerance := 20;
Amount := 3;
end;
with TOreArray[1] do
begin
UpText := ['oal'];
Color := 1778724;
Tolerance := 20;
Amount := 18;
end;
end;
'Runite', 'Rune':
begin
with TOreArray[0] do
begin
UpText := ['unite ore'];
Color := 5722435;
Tolerance := 20;
Amount := 3;
end;
with TOreArray[1] do
begin
UpText := ['oal'];
Color := 1778724;
Tolerance := 20;
Amount := 24;
end;
end;
end;
end;
procedure CheckObjective(Time: Integer);
var
arA, arP, arAP: TPointArray;
P: TPoint;
begin
if (not(GameTab(tab_Objectives))) then
Exit;
FindColors(arA, 42516, 595, 387, 691, 401);
FindColors(arP, 5844, 595, 387, 691, 401);
arAP := CombineTPA(arA, arP);
if Length(arAP) < 1000 then
begin
if (not(GameTab(tab_Stats))) then
Exit;
case (Random(2)) of
0: P := SkillToCoords('Smithing');
1: P := SkillToCoords('Magic');
end;
Mouse(P.x, P.y, 10, 10, False);
if (WaitOptionMulti(['et', 'bjective'], 1500)) then
begin
Wait(RandomRange(500, 1000));
TypeSend('99');
if (not(GameTab(tab_Objectives))) then
Exit;
end;
end;
MouseBox(585, 383, 701, 405, 3);
Wait(Time);
Exit;
end;
procedure TakeBreak;
var
Time: Array [0..2] of Integer;
i: Integer;
begin
if Players[CurrentPlayer].Booleans[0] = False then
Exit;
if GetSystemTime > BreakIn then
begin
BreakFor := GetSystemTime + RandomRange(5 * 60000, 10 * 60000);
LogOut;
ConvertTime(BreakFor, Time[0], Time[1], Time[2]);
WriteLn('Breaking for ' + IntToStr(Time[0]) + ' Hours, ' + IntToStr(Time[1]) + ' Minuites, and ' + IntToStr(Time[2]) + ' Seconds.');
repeat
Wait(100);
i := i + 1
if (i > 300) then
begin
ConvertTime(BreakFor - GetSystemTime, Time[0], Time[1], Time[2]);
i := 0;
WriteLn('Time remaining ' + IntToStr(Time[0]) + ' Hours, ' + IntToStr(Time[1]) + ' Minuites, and ' + IntToStr(Time[2]) + ' Seconds.');
end;
until (GetSystemTime > BreakFor);
BreakIn := GetSystemTime + RandomRange(180 * 60000, 240 * 60000);
LogInPlayer;
end;
end;
function WaitBankScreen(Time: Integer): Boolean;
var
t: LongInt;
begin
Result := False;
t := GetSystemTime + Time;
while (GetSystemTime < t) do
begin
if (BankScreen) then
begin
Result := True;
Exit;
end;
if (Length(Players[CurrentPlayer].Pin) = 4) then
if (PinScreen) then
begin
InPin(Players[CurrentPlayer].Pin);
Wait(RandomRange(1500, 3000));
ClickToContinue;
end;
Wait(RandomRange(20, 30));
end;
end;
procedure RandomHuman;
begin
case (Random(500)) of
0: CheckObjective(RandomRange(1000, 3000));
1: HoverSkill('Smithing', False);
2: HoverSkill('Magic', False);
3: PickupMouse;
4: BoredHuman;
5: ExamineInv;
6: RandomMovement;
7: RandomAngle('Up');
8: RandomRClick;
9:
begin
MakeCompass(Random(360));
Wait(RandomRange(500, 1000));
MakeCompass('N');
end;
end;
end;
function FindChest(): Boolean;
var
ATPA: T2DPointArray;
TPA: TPointArray;
P: TPoint;
CTS, h, i: Integer;
t, l: LongInt;
begin
MakeCompass('N');
SetAngle(True);
t := GetSystemTime;
repeat
if ((GetSystemTime - t) > 20000) then
Break;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.2, 0.2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 0, MSX1, MSY1, MSX2, MSY2, 0);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(CTS);
if Length(TPA) < 1 then
Continue;
ATPA := TPAToATPAEx(TPA, 30, 30);
SortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY - 15));
l := GetSystemTime;
h := High(ATPA);
for i := 0 to h do
begin
if ((GetSystemTime - l) > 15000) then
Break;
if (BankScreen) then
begin
Result := True;
Break;
end;
if (Length(ATPA[i]) < 75) then
Continue;
P := MiddleTPA(ATPA[i]);
MMouse(P.x, P.y, 3, 3);
if (not (WaitUpTextMulti(['ank chest', 'Bank', 'chest'], 1500))) then
Continue;
GetMousePos(P.x, P.y);
Mouse(P.x, P.y, 0, 0, False);
if (not(WaitOption('Use', 1500))) then
Continue;
if (WaitBankScreen(1500)) then
begin
Result := True;
Break;
end;
Wait(500);
end;
until (Result);
if (Result) then
Exit
else
begin
P := Point(MSCX, MSCY - 15);
{if FindObjTPA(P.x, P.y, color, tol, cts, height, width, mincount, ['ank chest', 'Bank' 'chest']) then
begin
Mouse(P.x, P.y, 0, 0, False);
if WaitOption('Use', 1500) then
if WaitBankScreen(5000) then
begin
Result := True;
Exit;
end else
Exit;
end; }
end;
end;
function Bank(): Boolean;
var
DTM, i, l, t: Integer;
a: Extended;
P: TPoint;
begin
a := SymbolAccuracy;
l := 0;
Result := False;
repeat
if FindChest then
Break;
if BankScreen then
Break;
if (l >= 5) then
Exit;
if (FindSymbol(P.x, P.y, 'Bank')) then
begin
Mouse(P.x, P.y, 1, 1, True);
Flag;
end else
SymbolAccuracy := SymbolAccuracy - 0.1;
l := l + 1;
until (False);
SymbolAccuracy := a;
t := 0;
repeat
Deposit(1, 27, True);
t := t + 1;
if t > 5 then
Exit;
Wait(750);
until (InvCount <= 1);
FixBankTab;
FixBank;
DTM := CreateOre(TOreArray[0].Color, TOreArray[0].Tolerance);
for i := 0 to 5 do
begin
if (not(FindDTM(DTM, P.x, P.y, MBX1, MBY1, MBX2, MBY2))) then
begin
FreeDTM(DTM);
Exit;
end;
MouseBox(P.x - 10, P.y - 10, P.x + 10, P.y + 10, 3);
if (WaitUpTextMulti(TOreArray[0].UpText, 1500)) then
begin
GetMousePos(P.x, P.y);
Mouse(P.x, P.y, 0, 0, False);
if (TOreArray[0].Amount = 14) then
if (WaitOption('ithdraw-14', 1500)) then
Break;
if (TOreArray[0].Amount = 28) then
if (WaitOption('ithdraw All', 1500)) then
Break;
if (TOreArray[0].Amount < 28) then
if (WaitOption('ithdraw-x', 1500)) then
begin
Wait(RandomRange(500, 750));
TypeSend(IntToStr(TOreArray[0].Amount));
Break;
end;
end;
end;
FreeDTM(DTM);
if (TOreArray[1].Color <> 0) then
begin
DTM := CreateOre(TOreArray[1].Color, TOreArray[1].Tolerance);
for i := 0 to 5 do
begin
if (not(FindDTM(DTM, P.x, P.y, MBX1, MBY1, MBX2, MBY2))) then
begin
FreeDTM(DTM);
Exit;
end;
MouseBox(P.x - 10, P.y - 10, P.x + 10, P.y + 10, 3);
if (WaitUpTextMulti(TOreArray[1].UpText, 1500)) then
begin
GetMousePos(P.x, P.y);
Mouse(P.x, P.y, 0, 0, True);
if (TOreArray[1].Amount = 14) then
if (WaitOption('ithdraw-14', 1500)) then
Break;
case Random(25) of
0..24: if (WaitOption('ithdraw All', 1500)) then Break;
25:
begin
if (WaitOption('ithdraw-x', 1500))then
begin
Wait(RandomRange(750, 1500));
TypeSend(IntToStr(TOreArray[1].Amount));
Break;
end;
end;
end;
end;
end;
FreeDTM(DTM);
end;
CloseBank;
Wait(RandomRange(500, 750));
if (not(GameTab(tab_Inv))) then
Exit;
DTM := CreateOre(TOreArray[0].Color, TOreArray[0].Tolerance);
Result := (CountItemsIn('inv', 'SRL_DTM', DTM, []) = TOreArray[0].Amount);
FreeDTM(DTM);
end;
function CastLoop(): Boolean;
var
Bitmap, DTM, i: Integer;
P: TPoint;
begin
DTM := CreateOre(TOreArray[0].Color, TOreArray[0].Tolerance);
Bitmap := BitmapFromString(14, 7, 'meJw9kDEKwkAQRdmNJrFIbpBecPE' +
'MizewtRAsUnsAsbH1CKmtrdNYpYq9jYXYKEFE1EZZEN86IAzhzf9/' +
'Z2ej41ynpR5tqUD1I1sHswvV0pZKehuUaPXUcQ6TgVFUZ44Ch92DV' +
'hktR+Ss13/gk6bACseLwe7uLZXJhPbwBjAfMamaf5Ka7q+EuQsLwJ' +
'JlAPP64PplGGJreH08Sxhgjr/UFHxJOucIyFtwadPTmyQgy5CUZcS' +
'dLB+0AK0k/eSq4Tn8li8k64Ze');
GameTab(28);
i := 0;
repeat
if (GetCurrentTab = tab_Magic) then
begin
if (not(FindBitmapToleranceIn(Bitmap, Global.x, Global.y, MIX1, MIY1, MIX2, MIY2, 20))) then
begin
Result := False;
Exit;
end;
MouseBox(Global.x - 1, Global.y - 12, Global.x + 15, Global.y + 10 , 3);
if WaitUpTextMulti(['Cast', 'uperheat'], 1000) then
begin
GetMousePos(P.x, P.y);
Mouse(P.x, P.y, 0, 0, True);
end else
Continue;
end else
begin
GameTab(tab_Magic);
Continue;
end;
if (WaitUpTextMulti(['ast', 'uperheat', 'tem', '->'], 1500)) and (GetCurrentTab = tab_Inv) then
begin
if (FindDTM(DTM, P.x, P.y, MIX1, MIY1, MIX2, MIY2)) then
begin
MouseBox(P.x - 10, P.y - 10, P.x + 10, P.y + 10, 3);
if (WaitUpTextMulti(TOreArray[0].UpText, 1000)) then
begin
GetMousePos(P.x, P.y);
Mouse(P.x, P.y, 0, 0, True);
i := i + 1;
RandomHuman;
Wait(RandomRange(150, 750));
GameTab(tab_Magic);
end else
begin
RandomHuman;
GameTab(tab_Magic);
Continue;
end;
end else
begin
GetMousePos(P.x, P.y);
Mouse(P.x, P.y, 0, 0, False);
WaitOption('Cancel', 1000);
Break;
end;
end else
begin
GameTab(tab_Magic);
Continue;
end;
until (i >= TOreArray[0].Amount);
GameTab(tab_Inv);
Wait(1000);
Result := (not(FindDTM(DTM, P.x, P.y, MIX1, MIY1, MIX2, MIY2)));
FreeDTM(DTM);
FreeBitmap(Bitmap);
end;
function MainLoop(): Boolean;
var
State: String;
begin
BreakIn := GetSystemTime + RandomRange(180 * 60000, 240 * 60000);
State := Players[CurrentPlayer].Loc;
LogInPlayer;
repeat
case (State) of
'Banking': if (Bank) then State := 'Casting' else Break;
'Casting': if (CastLoop) then State:= 'Banking' else Break;
end;
TakeBreak;
until (False);
Result := True;
end;
begin
{$IFDEF SMART}
SMART_Server := 81;
SMART_Members := True;
SMART_Signed := True;
{$ENDIF}
SetUpSRL;
DeclarePlayers;
DeclareOres;
MainLoop;
LogOut;
end.