SRL Archive - First Scripts

Tea Theif then Drop


Raskolnikov

2007-11-12 02:13:34

This is for the tea stall in Varrock. I hope you like it! When you vote by the way, please tell me (if it didn't go well at all) why it didn't compile or run. Oh and this has been tested on Scar 3.12 and SRL 4. The new bank function is a beta. If you have a solution to any bugs in the bank beta, please post them here.

program StallThief; //Thanks HyperSecret and rogeruk
{.include SRL/SRL.scar}
var
x, y, HowManyDone, SaveLife, a, b, BankDTM, Time, tea,
TeaStole: Integer;
Angle: Extended;

const
HowManyTea = 308; //How many teas to steal and drop
Bank = true; //Would you like to bank the tea

procedure Progress;
begin
Writeln('Thieved and dropped ' + IntToStr(HowManyDone) + ' teas.');
Writeln('Saved your life ' + IntToStr(SaveLife) + ' times.');
end;

procedure Thief;
begin
HowManyDone := 0; //Don't bother with this!
Disguise('Mozilla Firefox');
ActivateClient;
Wait(1000);
repeat
if (FindObjCustom(x, y, ['steal-', 'from', 'steal',
'-from', 'steal-from'], [9151923, 7829377, 2244947], 4)) then
begin
if (InvFull) and (Bank = false) then
begin
DropAll;
end;
if (InvFull) and (Bank = true) then
begin
BankDTM := DTMFromString('78DA630C606260C86540018C8C8C101AC6F70' +
'0AAC94755F3E70F13AA9A5020BF0855CDDBB70CA86A7C806A0A09' +
'981303E41713501340D81C0085D70E66');
Tea := BitmapFromString(27, 20,
'beNqtlE1Pk0EURnHLb9CkECESa' +
'FOFkgahAQwNjRvWLmGHOyMCQRPTAHEhBURBkG9oCKZEExYswI2y4l' +
'd5wgNPJtOWFclp83Y6c+beO/ed/kxL08O2x4/E8652kcsm/WyyT1u' +
'henyot/NFTwr0s6aQOSBzTbmQRJOlHehOtrcmnnW0CG3kCTCcy0Ch' +
'PxMNvhzsAcZDNDP1pJmPdvRyTwg9tvEtoUe8JH8tjDLVX3puaHgAy' +
'/NzP0ql7S/LoBEv5xuzItEuEqpWGneOUsGbV43rC5+3lhahvP79aG' +
'NDWptDIaWrFyGemvw6PDjZ34OzSgXnHRG6UNqUBHdXViC0SaXw/py' +
'evh4bdQxCEeayaYiKjOpwbRVIEwmBQWV3ByS8vDjf//bVQi1Uwyjl' +
'cCPmH29uajk4TQbxX/37C0SolI0jpCHBJ5K/Fv4ulxUVnp/bW5wFE' +
'BInnk4kRNSQPpR7F0Ypo42EyhQ4KVpINhlcw3ptwyC2Tx/ez05PG4' +
'6G2IDnj+8mdChy+g11DX2HuGfU0sWpSYFkfmZG8BPh2/FxcGPXSzl' +
'sbIIpFYuWhHIYKRRAQtcwbOxIqPipmNKkITkIQSmIsOZtIyfC6pR1' +
'1gSgxsZJBfz+uvfC8EJhdDnY6WvKTQLaK+zk0Ma/1LA73VZdw+gyz' +
'N9eKZowMpyDm5l9KbdH4T/UCNnT');
if (InvFull) and (Bank = true) then
begin
Mouse(52, 94, 0, 0, true);
Wait(4000);
if (FindSymbol(a, b, 'bank')) then
begin
Mouse(a, b, 0, 0, true);
end;
begin
MarkTime(Time);
repeat
if not (Loggedin) then Break;
OpenBankQuiet('varrock east');
until (BankScreen or (TimeFromMark(Time) > 120000));
if (BankScreen) then
begin
Writeln('In the bank!!!');
TeaStole := CountItemBmpTol(tea, 28);
Deposit(1, 28, 2);
CloseBank;
Writeln('We have banked ' + IntToStr(TeaStole) + ' teas.');
RunBack;
end;
FreeBitMap(tea);
end;
end;
end;
FindTalk; //Anti-random here for you
FindNormalRandoms; //Another anti-random
if (FindFight) then
begin
RunAwayDirection('N');
Wait(10000 + Random(2000));
RunBack;
SaveLife := SaveLife + 1;
end;
MMouse(x, y, 0, 0);
Mouse(x, y, 0, 0, true);
HowManyDone := HowManyDone + 1;
Wait(10000);
end;
until (HowManyDone = HowManyTea);
Progress;
end;

begin
SetupSRL;
Thief;
end.

Edit: The next version is out!!! This has MMouse and Mouse instead of those others. It also has a part in the proggie where it says how many times it saved your life.

Please post your progress reports!
Thanks,
Cut em2 it

n3ss3s

2007-11-12 08:58:23

Read the SRL Wiki, replace MoveMouse with MMouse(X, Y, RandomX, RandomY) and ClickMouse with Mouse(X, Y, RandomX, RandomY, Left)

Raskolnikov

2007-11-12 12:26:46

Thanks, my next version has that in there.

Edit:
how about you make it BANK? too it will be kind of cool and creative =) jus a suggestion or i will probally make 1 of these =P but gj


I will but I have to read a few more tuts on banking and why would someone want to bank tea?

Thanks rogeruk but I thought that you put two spaces even after an if. As far as the banking goes, I now have a beta for banking. This has never been tested so if it works for you please tell me.

P1nky

2007-11-12 12:29:14

how about you make it BANK? too it will be kind of cool and creative =) jus a suggestion or i will probally make 1 of these =P but gj

rogeruk

2007-11-12 13:16:51

Standards fixed :D.

program StallThief;
{.include SRL/SRL.scar}
var
x, y, HowManyDone, SaveLife: Integer;
const
HowManyTea = 308; //How many teas to steal and drop

procedure Thief;
begin
HowManyDone := 0; //Don't bother with this!
SetupSRL;
Disguise('Mozilla Firefox');
ActivateClient;
Wait(1000);
repeat
if (FindObjCustom(x, y, ['steal-', 'from', 'steal', '-from', 'steal-from'], [9151923, 7829377, 2244947], 4)) then
begin
if (InvFull) then
begin
DropAll;
end;
FindTalk; //Anti-random here for you
FindNormalRandoms; //Another anti-random
if (FindFight) then
begin
RunAwayDirection('N');
Wait(10000 + Random(2000));
RunBack;
SaveLife := SaveLife + 1;
end;
MMouse(x, y, 0, 0);
Mouse(x, y, 0, 0, true);
HowManyDone := HowManyDone + 1;
Wait(10000);
end;
until (HowManyDone = HowManyTea);
end;

procedure Progress;
begin
Writeln('Thieved and dropped ' + IntToStr(HowManyDone) + ' teas.');
Writeln('Saved your life ' + IntToStr(SaveLife) + 'times.');
end;

begin
Thief;
Progress;
end.

You are using SaveLife in the script, but you have only decared Save as an integer. (Fixed in code above)

Raskolnikov

2007-11-12 16:22:12

The next version is out with a banking beta. Please post any bugs you may see in the banking beta. If you have solutions to the bugs, please post them!

Cut em2 it

josh81193

2007-11-25 11:39:11

i have been lookin for 1 of these! :D
you should put declare players, a guide at beggining for noobs, and multi-player

well those would just be nice anyways ;)