Simba Code:
program new;
{$DEFINE SMART}
//{$DEFINE SRL:DEBUG}
//{$DEFINE HINTS}
//{$DEFINE DRAW}
{$I SRL/OSR.simba}
type
TMMOrbWorldMap = record
Middle: TPoint;
Bounds: TBox;
Radius: UInt8;
end;
procedure TAntiban.OpenWorldMap();
var
MMOrbWorldMap: TMMOrbWorldMap;
begin
with MMOrbWorldMap do
begin
Bounds := [545, 4, 576, 36];
Middle := [561, 20];
Radius := 15;
end;
end;
procedure DrawBankScreen(cl: TColor);
var
i: Integer;
begin
for i:=0 to High(Bankscreen.FButtons) do
begin
Smart.Image.DrawTPA(EdgeFromBox(Bankscreen.fButtons[i]), cl);
end;
for i:=0 to High(Bankscreen.FSlots) do
Smart.Image.DrawTPA(EdgeFromBox(Bankscreen.fSlots[i]), cl);
end;
procedure DrawPinScreen(cl: TColor);
var
i: Int32;
buttons: TBoxArray;
begin
PinScreen.FindButtons(buttons, Random(3000,4500));
PinScreen.SortButtons(buttons, Random(4000,6500));
for i:=0 to High(buttons) do
begin
Smart.Image.DrawBox(buttons[i], False, cl);
Smart.Image.DrawText(ToStr(i), Point(buttons[i].X1+5, buttons[i].Y1+5), cl);
end;
end;
procedure DrawCombatScreen(cl: TColor);
begin
Smart.Image.DrawBoxes(Combat.FButtons, False, cl);
Smart.Image.DrawBox(Combat.FBounds, False, cl);
end;
procedure DrawPrayerScreen(cl: TColor);
var
i: Int32;
begin
Smart.Image.DrawBoxes(Prayer.FSlots, False, cl);
Smart.Image.DrawBox(Prayer.FBounds, False, cl);
if Prayer.IsOpen() then
for i:=0 to High(Prayer.FSlots) do
if Prayer.CanActivate(EPrayerType(i)) then
Smart.Image.DrawBox(Prayer.FSlots[i], False, cl);
end;
procedure DrawShopScreen(cl: TColor);
var
i: Integer;
begin
if not ShopScreen.__Prepare() then Exit();
for i:=0 to High(ShopScreen.ItemBoxes) do
Smart.Image.DrawBox(ShopScreen.ItemBoxes[i], False, cl);
end;
procedure DrawSmithingScreen(cl: TColor);
var
i: Integer;
begin
if not SmithingScreen.__Prepare() then Exit();
for i:=0 to High(SmithingScreen.ItemBoxes) do
begin
Smart.Image.DrawBox(SmithingScreen.ItemBoxes[i], False, cl);
Smart.Image.DrawBox(SmithingScreen.ItemBoxesIcon[i], False, cl);
Smart.Image.DrawBox(SmithingScreen.ItemBoxesNames[i], False, cl);
Smart.Image.DrawBox(SmithingScreen.ItemBoxesBars[i], False, cl);
end;
end;
procedure DrawGrandExStub(cl: TColor);
begin
Smart.Image.DrawBox(GrandExchange.FBounds, False, cl);
Smart.Image.DrawBox(GrandExchange.FHeader, False, cl);
end;
procedure DrawGrandExOffer(cl: TColor);
var
i:Int32;
begin
Smart.Image.DrawBoxes(GrandExchange.Offer.FAdjBounds, False, cl);
Smart.Image.DrawBoxes(GrandExchange.Offer.LoadButtons(), False, cl);
if GrandExchange.CurrentInterface() = geSetupOffer then
begin
Smart.Image.DrawBoxes(Copy(GrandExchange.Offer.FMiscBoxes, 0, Length(GrandExchange.FMiscBoxes)-4), False, cl);
Smart.Image.DrawBox(GrandExchange.Offer.FConfimButton, False, cl);
end
else
Smart.Image.DrawBoxes(GrandExchange.Offer.FMiscBoxes, False, cl);
for i:=0 to High(GrandExchange.Offer.FButtons) do
if i <> ord(ebCollect) then
Smart.Image.DrawBox(GrandExchange.Offer.FButtons[i], False, cl);
end;
procedure DrawGrandExchange(cl: TColor);
var
curr: EGEInterface;
i,j: Int32;
begin
curr := GrandExchange.CurrentInterface();
if (curr = geOverview) then
begin
Smart.Image.DrawBoxes(GrandExchange.ExchTables, False, 1);
Smart.Image.DrawBox(GrandExchange.FButtons[ebClose], False, cl);
Smart.Image.DrawBox(GrandExchange.FButtons[ebCollect], False, cl);
Smart.Image.DrawBox(GrandExchange.FButtons[ebHistory], False, cl);
for i:=0 to High(GrandExchange.ExchTables) do
begin
Smart.Image.DrawBox(GrandExchange.OffsetToTable(i, GrandExchange.FExchBoxes[0]),False,cl);
if GrandExchange.ExchangeType(i) = etEmpty then
begin
Smart.Image.DrawBox(GrandExchange.OffsetToTable(i, GrandExchange.FOfferButtons[ord(etSell)]), False, cl);
Smart.Image.DrawBox(GrandExchange.OffsetToTable(i, GrandExchange.FOfferButtons[ord(etBuy)]), False, cl);
end
else for j:=1 to High(GrandExchange.FExchBoxes) do
Smart.Image.DrawBox(GrandExchange.OffsetToTable(i, GrandExchange.FExchBoxes[j]),False,cl);
end;
end;
end;
procedure DrawSpells(cl: TColor);
begin
Smart.Image.DrawBoxes(Spells.FSlots, False, cl);
Smart.Image.DrawBox(Spells.FBounds, False, cl);
end;
procedure DrawDepositBox(cl: TColor);
var
i: Integer;
begin
if not DepositBox.__Prepare() then Exit();
for i:=0 to High(DepositBox.ItemBoxes) do
Smart.Image.DrawBox(DepositBox.ItemBoxes[i], False, cl);
for i:=0 to High(DepositBox.Buttons) do
Smart.Image.DrawBox(DepositBox.Buttons[i], False, cl);
end;
procedure DrawInventory(cl: TColor);
begin
Smart.Image.DrawBoxes(Inventory.FSlots, False, cl);
Smart.Image.DrawBox(Inventory.FBounds, False, cl);
end;
procedure DrawEquipment(cl: TColor);
begin
Smart.Image.DrawBoxes(Equipment.FBoxes, False, cl);
Smart.Image.DrawBox(Equipment.FBounds, False, cl);
end;
procedure DrawStats(cl: TColor);
begin
Smart.Image.DrawBoxes(Stats.FSlots, False, cl);
Smart.Image.DrawBox(Stats.FBounds, False, cl);
end;
procedure DrawOptions(cl: TColor);
begin
Smart.Image.DrawBox(Options.FBounds, False, cl);
Smart.Image.DrawBoxes(Options.FTabs, False, cl);
Smart.Image.DrawBox(Options.FZoomSliderBox, False, cl);
end;
procedure DebugEverything(cl: TColor);
var
B: TBox;
begin
Smart.Image.DrawBox(srl.DefaultClientBounds, false, cl);
Smart.Image.DrawBox(MainScreen.FBounds, false, cl);
Smart.Image.DrawBox(Gametabs.FBounds, false, cl);
Smart.Image.DrawBox(Minimap.FBounds, false, cl);
Smart.Image.DrawBox(Chatbox.FBounds, false, cl);
Smart.Image.DrawBoxes(Chatbox.FLines, false, cl);
Smart.Image.DrawBoxes(Chatbox.FTabs, false, cl);
Smart.Image.DrawBox(Minimap.CompassInfo.Bounds, false, cl);
Smart.Image.DrawTPA(Minimap.MaskPoly, cl);
Smart.Image.DrawBox(Minimap.OrbInfo[MMOrbHP].TextBox, cl);
Smart.Image.DrawBox(Minimap.OrbInfo[MMOrbPrayer].TextBox, cl);
Smart.Image.DrawBox(Minimap.OrbInfo[MMOrbRun].TextBox, cl);
Smart.Image.DrawBox(Minimap.OrbInfo[MMOrbSpecialAttack].TextBox, cl);
Smart.Image.DrawCircle(Minimap.OrbInfo[MMOrbHP].Middle, Minimap.OrbInfo[MMOrbHP].Radius, false, cl);
Smart.Image.DrawCircle(Minimap.OrbInfo[MMOrbPrayer].Middle, Minimap.OrbInfo[MMOrbPrayer].Radius, false, cl);
Smart.Image.DrawCircle(Minimap.OrbInfo[MMOrbRun].Middle, Minimap.OrbInfo[MMOrbRun].Radius, false, cl);
Smart.Image.DrawCircle(Minimap.OrbInfo[MMOrbSpecialAttack].Middle, Minimap.OrbInfo[MMOrbSpecialAttack].Radius, false, cl);
Smart.Image.DrawCircle(Minimap.CompassInfo.Middle, Minimap.CompassInfo.Radius, false, cl);
Smart.Image.DrawCircle(XPBar.Button.Mean, XPBar.Button.Radius, false, cl);
Smart.Image.DrawBox(Gametabs.UpperTabs, false, cl);
Smart.Image.DrawBox(Gametabs.LowerTabs, false, cl);
Smart.Image.DrawBoxes(Gametabs.Tabs, false, cl);
// XP bar
B := [365, 0, 515, 55];
Smart.Image.DrawBox(B, false, cl);
WriteLn('Entering Infinite loop');
Repeat
if Options.IsOpen then
DrawOptions(clRed);
//if BankScreen.IsOpen Uses OCR throws errors
//DrawBankScreen(clRed);
//if PinScreen.IsOpen
//DrawPinScreen(clRed);
if Combat.IsOpen then
DrawCombatScreen(clRed);
if Prayer.IsOpen then
DrawPrayerScreen(clRed);
//if ShopScreen.IsOpen then
//DrawShopScreen(clRed);
//if SmithingScreen.IsOpen then
//DrawSmithingScreen(clRed);
if GrandExchange.IsOpen(geOverview) then
DrawGrandExchange(clRed);
//if GrandExchange.IsOpen(geOfferStatus) Same as above
//DrawGrandExOffer(clRed);
if GrandExchange.IsOpen(geSetupOffer) then
DrawGrandExStub(clRed);
if Spells.IsOpen then
DrawSpells(clRed);
//if DepositBox.IsOpen then
//DrawDepositBox(clRed);
if Inventory.IsOpen then
DrawInventory(clRed);
if Equipment.IsOpen then
DrawEquipment(clRed);
if Stats.IsOpen then
DrawStats(clRed);
wait(2000);
until false;
end;
begin
srl.Setup([soDebug,soDebugAntiban,soDebugTimeStamp]);
DebugEverything(clWhite);
end.