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
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
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