DarkCoder
2011-12-18 15:02:34
How Long have You Played Runescape?
4 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
A bit of HTML and Javascript to start with then went into Java.
Are you a member of any other communities?
Powerbot (Script Writer)
Tell us about yourself…
Please show us one (or multiple) of your scripts.
4 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
A bit of HTML and Javascript to start with then went into Java.
Are you a member of any other communities?
Powerbot (Script Writer)
Tell us about yourself…
From: DarkCoder
Hmm, basically I am a 'script writer' rank from Powerbot whom has a good knowledge of Java whom has come over as this is both a working bot but also an amazing community! Logically I am very good a programming in terms of figuring the flow and stuff of scripts although have never had a single lesson on programming in my life.
I script because I enjoy scripting, the 'buzz' and the challenge really appeals to me, along with being able to see the results in the end working. I am competitive, and do a fair share of sports but generally a honest and nice guy. My main interest other than coding would have to be sleeping :)
Thanks and look forward to the feedback!
(I can provide links to pb scripts which I have made using reflection if interested)
Please show us one (or multiple) of your scripts.
// !!!!!!!!!!! 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;
// maybe one for open bank, one for running and one for smelting?!?!
procedure Antiban; // make this far more dynamic asap
begin
case Random(480) 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(150) of
0: Typesend('cmon');
1: Typesend('lol');
2: Typesend('lagg');
3: Typesend('hmm');
4: Typesend('hurry');
5: Typesend('bored :P');
end;
100: GameTab(RandomRange(tab_Combat, tab_Notes));
end;
end;
procedure SetCompass;
var Deg: Variant;
begin
Deg := rs_GetCompassAngleDegrees;
if (Deg > 9) or (Deg < 3) then // works as an approx
begin
MakeCompass(7);
end;
end;
procedure CloseBankNow;
begin
CloseBank;
Wait(200+random(350)); // sleep?
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 ClickGoldBar;
var GoldBar: Integer;
begin
GoldBar := BitmapFromString(17, 8, 'meJyTaFkmgRvJr76OiUhVj0cLddX' +
'z+SYCEfHqFTbchWhBRvjVE6kFWT3xWuDqgQgAUyW6TQ==');
X := 590;
Y := 227;
if (FindBitmapSpiralTolerance(GoldBar, X, Y, 560, 214, 734, 457, TOLERANCE)) then
begin
Mouse(X, Y, 6, 6, true);
Wait(1000+random(250)); // shorten
end;
FreeBitmap(GoldBar);
end;
procedure StartCraft;
begin
X := 245;
Y := 135;
if (FindColorSpiralTolerance(X, Y, 7569541, MSX1, MSY1, MSX2, MSY2, TOLERANCE)) then
Mouse(X, Y, 0, 0, false);
ChooseOption('forge');
Wait(500+random(250));
while (Flag) do
begin
if not LoggedIn then exit;
if FindNormalRandoms then exit;
Wait(200+random(350));
end;
Wait(1000+random(250));
end;
procedure StartSmelt;
begin
X := 500;
Y := 60;
if (FindColorSpiralTolerance(X, Y, 7040957, 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
begin
if not LoggedIn then exit;
if FindNormalRandoms then exit;
Wait(200+random(350));
end;
Wait(1000+random(250));
end;
procedure OpenBankBox;
begin
X := 16;
Y := 280;
if (FindColorSpiralTolerance(X, Y, 7303028, 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
begin
if not LoggedIn then exit;
if FindNormalRandoms then exit;
Wait(200+random(350));
end;
Wait(900+random(150));
end;
procedure RelocateMouse;
begin
X := (235+random(45));
Y := (400+random(50));
Mmouse(X,Y, 0, 0);
Wait(200+random(150)); // shorten
end;
function CheckItems:boolean;
// Checks if an item within the inventory has been left clicked
var count: Integer;
begin
for count := 1 to 28 do
begin
if (ItemActivated(count)) then
begin
Result := true;
Exit;
end;
end;
Result := false;
end;
function MakeSelect:boolean;
var MakeY: Integer;
begin
MakeY := BitmapFromString(19, 18, 'meJyFkmlLAkEcxv0SoXu5Hh+194' +
'WhloVpaSaJWYaJ5pGmeG6akimJYRiFkiQVRBH0jCubjGbLvNDd+c1' +
'z/EelmjysM8p5UtpoU1foy8vY+lb993D7ad6fF06qCqUvPwPkj6UF' +
'FOuKC6EatMRkZ5qS1wKWdSeF07ou94j9MkWBc1mNNQCfQvhal38yN' +
'r8oasIGyupVDwUytiDnzWgjDWgZ6u/Gm08F1FdH+ssXfWmAr+xuTG' +
'P20c0cZBEQG7DNUHszND5wAn7IIJyI53foDZ1rNo4oVnvW0mUfSEB' +
'pSFgFlIZ4L17cEzZUgzfGHqZYMd3FHqJbHRFWBksD9CZmeviKzqGL' +
'EdCiiTZOJt1KQ4IAv3qFE/TGmqOsJcauJ7nNNETVJi8tmuzgcDksF' +
'lQ4X+6XsqW4rYwQrGAQFIjDkQVtEFFpCGOMKTxNcfYs78hj7kvLtl' +
'nDclJIIw6zFgE4TWljt7P9TAwjaaGPTjA44tMaJ9HGFO8skvcW/1w' +
'QKeAWtjG4iU/IbedA8S6JPyyqV/bmgsQwLny6Sy4M5MY+idxOWXBX' +
'cD//opSGEQfjIGPCEDM9/IVPxhFZDMq6ZCXa2A+H0AKlzOIHTVFw2g==');
Result := (FindBitmapToleranceIn(MakeY, X, Y, MSX1, MSY1, MSX2, MSY2, TOLERANCE)); // narrow this down on screen?!?
FreeBitmap(MakeY);
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 ContainsBar:boolean;
var
ChosenBar: Integer;
begin
GameTab(25);
ChosenBar := BitmapFromString(17, 8, 'meJyTaFkmgRvJr76OiUhVj0cLddX' +
'z+SYCEfHqFTbchWhBRvjVE6kFWT3xWuDqgQgAUyW6TQ==');
Result := (FindBitmapToleranceIn(ChosenBar, X, Y, 560, 214, 734, 457, TOLERANCE));
FreeBitmap(ChosenBar);
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?
// wait before this!?!?
SetAngle(true);
repeat
if FindNormalRandoms then Break; // meant to be exit or break?!?
if not LoggedIn then Break;// Try and make it log back in?
SetCompass;
/////////// IF BANK IS OPEN ////////////
if (BankScreen) then
begin
if (InvFull) then
begin
if (ContainsOre) then
CloseBankNow
else
DepositAllNow;
end else
WithdrawOresNow;
////// IF INVENTORY CONTAINS ORE ///////
end else if (ContainsOre) then
begin
if (SelectOnScreen) then
begin
if(IsUpText('ake All'))then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, true);
while (ContainsOre) do // design fail safe
begin
if not LoggedIn then exit;
if FindNormalRandoms then exit; // perhaps do not need ths line
LevelUp; // does not work?!?
LampSkill := 'summoning';
Antiban;
Wait(350+random(150));
end;
end else
RelocateMouse;
end else
StartSmelt
////// IF INVENTORY CONTAINS BAR ///////
end else if (ContainsBar) then
begin
if (MakeSelect) then
begin
X := (122+random(16)); // perhaps more dynamic
Y := (280+random(16));
Mouse(X, Y, 0, 0, false);
if (ChooseOption('ake All')) then
begin
Wait(1000+random(150));// if select2 on screen then make all things
While (ContainsBar) do
begin
if not LoggedIn then exit;
if FindNormalRandoms then exit; // perhaps do not need ths line
LevelUp; // does not work?!?
LampSkill := 'summoning';
Antiban;
Wait(350+random(150));
end;
end else
Wait(350+random(150)); // CheckItems
end else if (CheckItems) then
begin
StartCraft; // else if selected gold bar - use on furnace
Wait(200+random(150));
end else // select a gold bar
ClickGoldBar // ';' here?
////// ELSE OPEN OUR BANK ///////
end else
OpenBankBox;
until(false);
end.