Simba Code:
// !!!!!!!!!!! BEFORE PUBLISIHING REMOVE USER AND PASSWORD !!!!!!!!!!!!
program iSmelter;
{$i srl/srl/misc/smart.scar}
{.include srl/srl.scar}
const
TOLERANCE = 35; // Change to min which works!
var
X, Y: integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
Players[0].BoxRewards := ['Xp', 'ostume', 'oins', 'aphire', 'ssence']; // change to whatever suits
end;
procedure AntiRandoms;
begin
FindNormalRandoms; // Whenever this is called, the script will check to see if your character is in a random event
LampSkill := 'prayer'; // If you set the script to choose an experience lamp from a random event box, it will use the exp on the woddcutting skill
LevelUp; // This is an Antiban procedure, but I find it more useful when called here because AntiRandoms is usually called more often than Antiban
end;
// maybe one for open bank, one for running and one for smelting?!?!
procedure Antiban; // make this far more dynamic asap
begin
case Random(280) of // Random(x) generates a random integer from 0 to (x - 1)
0: Wait(100+random(750));
10: RandomRClick;
20: HoverSkill('smithing', False);
30: PickUpMouse;
40..42: RandomMovement;
50..52: BoredHuman;
60: ExamineInv;
70: RandomAngle(1);
80..89: mMouse(0, 0, random(750), random(500));
90: case Random(50) of
0: Typesend('cmon');
1: Typesend('lol');
2: Typesend('lagg');
3: Typesend('hmm');
4: Typesend('hurry');
5: Typesend('bored XD');
end;
100: GameTab(RandomRange(tab_Combat, tab_Notes));
end;
end;
procedure SetCompass;
var Deg: Variant;
begin
Deg := rs_GetCompassAngleDegrees;
if (Deg > 9) then // works as an approx
begin
MakeCompass(7);
end;
end;
procedure DepositAllNow;
begin
DepositAll;
Wait(1000+random(250));
end;
procedure WithdrawOresNow;
begin
Withdraw(0, 0, 28); // collum, row, amount
Wait(1000+random(250));
end;
procedure StartSmelt;
begin
X := 500;
Y := 60;
if (FindColorSpiralTolerance(X, Y, 7172802, MSX1, MSY1, MSX2, MSY2, TOLERANCE)) then
Mouse(X, Y, 0, 0, false);
ChooseOption('melt-ore');
Wait(500+random(250));
X := (220+random(80));
Y := (380+random(80));
Mmouse(X,Y, 0, 0);
while (Flag) do
if not LoggedIn then exit;
if FindNormalRandoms then exit;
Wait(200+random(350));
Wait(1000+random(250));
end;
procedure OpenBankBox;
begin
X := 16;
Y := 280;
if (FindColorSpiralTolerance(X, Y, 7105649, MSX1, MSY1, MSX2, MSY2, TOLERANCE)) then
Mouse(X, Y, 0, 0, false);
ChooseOption('se');
Wait(500+random(250));
X := (375+random(40));
Y := (290+random(35));
Mmouse(X,Y, 0, 0);
while (Flag) do
if not LoggedIn then exit;
if FindNormalRandoms then exit;
Wait(200+random(350));
Wait(900+random(150));
end;
function SelectOnScreen:boolean;
var MakeX: Integer;
begin
MakeX := BitmapFromString(17, 8, 'meJyTaFkmgRvJr76OiUhVj0cLddX' +
'z+SYCEfHqFTbchWhBRvjVE6kFWT3xWuDqgQgAUyW6TQ==');
Result := (FindBitmapToleranceIn(MakeX, X, Y, MCX1, MCY1, MCX2, MCY2, TOLERANCE));
FreeBitmap(MakeX);
end;
function ContainsOre:boolean;
var
ChosenOre: Integer;
begin
GameTab(25);
ChosenOre := BitmapFromString(18, 12, 'meJxNkv8rA3EYx6/7Bzh2t/ui7D' +
'fJplFsSEu+JF+a72k/rNVI+MW3rPmyEAuZtY1ZtxZJJBKRJpKl/F3' +
'e56Pn7np3PXf3vD7P+3mec/r8tW19PMc5HG7cywOLYjQnrmQQk/CJ' +
'CXGNp7uhZ9LVMVzXPkCUEIpKa7p9+1KKnYuRLCHc34VHJHv84frOU' +
'afPT1TFVMygdq/lg3t5/w4xz5kX4sbeQPNgyN01gXJEVc7FDWrnSj' +
'l6VFOvkLRZ4C0U7IFqHZtFOaJsCwn09U+dvmu5Ly3/DcNWEGoZmQF' +
'OlLh6go7k+K1y/KxlP6oKP5peUjNv8EwgMr1D07BKlLSeRwKzBwqF' +
'GKUknnAUgaAgouxbF/LejXz4oCRfDId6iSjrLjBGiFHMNprC9JCmp' +
'ova2SdaA8WSMSsmIJiJlWIyTYJKF/GmbHxeCEZsyyl4AAI19QdZMr' +
'aAXRDLxshiIbyBWWFKOI0S8Ktg3UAw0mqXlzo1l7KUhHPUBfgLpLa' +
'UPA==');
Result := (FindBitmapToleranceIn(ChosenOre, X, Y, 560, 214, 734, 457, TOLERANCE));
FreeBitmap(ChosenOre);
end;
begin
Smart_Server := 35; // Having the same world in all your scripts allows you to change scripts without smart restarting.
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
ClearDebug;
SetupSRL;
DeclarePlayers; // Calls the procedure, you can't forget this!
LoginPlayer; // You want your player to login, right?
repeat
if FindNormalRandoms then Break; // meant to be exit or break?!?
if not LoggedIn then Break;// Try and make it log back in?
SetCompass;// set angle up to highest also??
if (BankScreen) then // if bank is open
begin
if (InvFull) then
begin
if (ContainsOre) then
begin
CloseBank;
Wait(200+random(350)); // sleep?
end else
DepositAllNow;
end else
WithdrawOresNow;
end else
begin
if (ContainsOre) then // contains ore
begin
if (SelectOnScreen) then
begin
X := (235+random(45));
Y := (400+random(50));
Mmouse(X,Y, 0, 0);
Wait(200+random(150)); // shorten
if(IsUpText('ake All'))then
begin
Mouse(X, Y, 0, 0, true);
While (ContainsOre) do
begin
if not LoggedIn then exit;
if FindNormalRandoms then exit; // perhaps do not need ths line
LevelUp; // not needed here and does not work?!?
AntiRandoms;
Antiban;
Wait(350+random(150));
end;
end else
begin
writeln('Unable to click'); // Consider removing
Wait(100+random(50));
end;
end else
StartSmelt
end else
OpenBankBox; // open bank
end;
until(false);
end.