SRL Archive - First Scripts

Bone Burier


hahicx

2008-07-13 07:41:37

Hi. I've made a script that withdraws and buries bones from the bank using DTMs. You need to be in or next to a F2P bank, and have (normal) bones on the first page.
I am new to SCAR. Be critical and say how I could make it better, but be nice as well :p

{
BoneBurier - written by Hahicx.
It buries bones taken from your bank using DTMs.
You must be in or next to a F2P bank, and set this up in the constant below.
The bones must be on the first page of your bank.
Be nice to this script - I'm new to Scar :P
Codes for the banks are:

* feb - Falador East Bank
* fwb - Falador West Bank
* veb - Varrock East Bank
* vwb - Varrock West Bank
* db - Draynor Bank
* eb - Edgeville Bank
* akb - Al-Kharid Bank

Written with SCAR Divi 3.15b, and SRL rev #17.
}

program BoneBurier;
{.include SRL\SRL.scar}

const
bank = 'veb';
BonesToBury = 400; //This is the minimum number of bones to bury before the script stops.

var
BoneDTM, xpos, ypos, BuryCount: integer;

function FindBoneInv: Boolean;
begin
Result:=(FindDTM(BoneDTM, xpos, ypos, MIX1, MIY1, MIX2, MIY2));
end;

function FindBoneBank: Boolean;
begin
Result:=(FindDTM(BoneDTM, xpos, ypos, 20, 50, 460, 300));
end;

procedure RightClickBury;
begin
Mouse(xpos, ypos, 5, 5, False);
Wait(30+random(20));
if(ChooseOption('ury')) then BuryCount := BuryCount + 1;
end;

procedure BuryThem;
begin
while (FindBoneInv) do
begin
FindBoneInv;
if(RBoolEx(8)) then RightClickBury else // AntiBan - randomly right clicks and chooses Bury
begin
Mouse(xpos, ypos, 5, 5, True);
BuryCount := BuryCount + 1;
end;
Wait(1800 + random(100));
end;
end;

procedure WithdrawBones;
begin
Wait(100 + random(20));
if (FindBank(bank)) then
begin
Wait(70 + random(20));
if (BankScreen) then
begin
Wait(300 + random(45));
FindBoneBank;
Mouse(xpos, ypos, 5, 5, False);
Wait(100 + random(35));
ChooseOption('All');
Wait(200 + random(50));
CloseBank;
end else
begin
WriteLn('Error: Could not find bank screen.')
Exit;
end;
end else
begin
WriteLn('Error: Could not find your bank nearby. Have you set the constant?')
Exit;
end;
end;

procedure AntiBan;
begin
if not LoggedIn then
begin
WriteLn('You aren''t logged in, exiting...')
Exit;
end;
case Random(40) of
1: BoredHuman;
2: HoverSkill('Prayer', False);
3: AlmostLogout;
4: RandomRClick;
end;
end;

procedure SetUp;
begin
SetupSRL;
ActivateClient;
BoneDTM := DTMFromString('78DA633CC0C4C0F09801055CBB70814104483' +
'302F17F2060DC0C54F390010D302291407A3F50CD6D026ACE02D5' +
'3C455561A0A080AA662F50CD5B02E61C05AAB9875F0D00A8F510E' +
'3');
Wait(500);
if not((GetCurrentTab) = 4) then
GameTab(4);
end;

begin
SetUp;
repeat
BuryThem;
WithdrawBones;
AntiBan;
until (BuryCount > BonesToBury)
FreeDTM(BoneDTM);
end.

Post any comments on how it could be improved or made more reliable.

EDIT: Thanks for the tips Hermpie. I've changed it using what you put. It's a bit smaller now :p

EDIT 2: Just realised another stupid mistake :( Fixed it. Script works reliably now :D

ShowerThoughts

2008-07-13 08:03:44

First off all good job for a first script ;)

just some advices, so it will be shorter or it will run longer :)

function FindBone: Boo[SCAR]
lean;
begin
if(FindDTM(BoneDTM, xpos, ypos, 550, 200, 740, 470)) then
begin
Result := True
end else
begin
Result := False
end;
end;

function FindBone: Boolean;
begin
Result:=(FindDTM(BoneDTM, xpos, ypos, 550, 200, 740, 470));
end;

Also
procedure RightClickBury;
begin
Mouse(xpos, ypos, 5, 5, False);
if(ChooseOption('ury')) then
begin
BuryCount := BuryCount + 1;
end else
begin
WriteLn('Could not press Bury :O');
end;
end;
procedure RightClickBury;
begin
Mouse(xpos, ypos, 5, 5, False);
Wait(10+random(40));//If rs laggs the uptext will be not there, therefore this.
if(ChooseOption('ury')) then BuryCount := BuryCount + 1;
end;
Note: you don't need that other line if you don't use a result ;)

Another:
procedure BuryThem;
begin
while (FindBone) do
begin
FindBone;
if(RBoolEx(8)) then
begin
RightClickBury; // AntiBan - randomly right clicks and chooses Bury
end else
begin
Mouse(xpos, ypos, 5, 5, True);
BuryCount := BuryCount + 1;
end;
Wait(1800 + random(100));
end;
end;

procedure BuryThem;
begin
while (FindBone) do
begin
FindBone;
if(RBoolEx(8)) then RightClickBury else // AntiBan - randomly right clicks and chooses Bury
begin
Mouse(xpos, ypos, 5, 5, True);
BuryCount := BuryCount + 1;
end;
Wait(1800 + random(100));
end;
end;

hahicx

2008-07-14 13:11:46

Anyone else got any comments?

By the way, another question - is there an equivelant of MIX1, MIY1, … for the bank screen?

mariofan12

2008-07-14 20:37:42

good job for your first script, buried 100 bones.

hahicx

2008-07-15 13:11:12

Nice :D

Did it break, or did you only want it to only bury 100? Did it work OK?

squigoth

2008-07-16 03:12:29

good but sort of slow and misses sometimes

Phillip_The_Ranga

2008-07-16 07:05:21

nice but i only got 100 bones

Faitness

2008-07-18 05:41:53

Good for starting. I even couldn't make a this kind of script. Works normally :)

H20Effect

2008-07-26 00:53:02

Perfect! I've been looking for one of these! Every once in a while I get a error and it freezes though…

Ghostman

2008-07-26 15:44:44

Nice, buried some bones but lost connection to runescape

now I can 99 in prayer

apk

2008-07-28 07:38:46

Great script, it got me my 52 prayer in the blink of an eye :D thanks a bunch :D

hootman

2008-07-30 03:22:42

Halli Luya I final found a decent looking bone burier ty

greent

2008-08-09 12:27:11

Good script mate buried 80 before i stopped manually