SRL Archive - First Scripts

First banker


zeeky111

2009-03-28 10:49:20

Here's my first script!! I'm proud of it, so please tell me if I horribly screwed the SRL, if what I used doesn't exist, or if I'm brilliant for a newb, but please don't flame… Lol.

program Bank;
{.include SRL/SRL.scar}

var
x,y: integer

const
Gtg = 'Brb, bank.';

procedure Brb;
begin
SendKeys(Gtg +chr(13));
end;

procedure Bank;
begin
SetupSRL;
if FindSymbol(x, y, 'bank') then
MMouse(x, y, 10, 10);
Wait(1000+random(50));
Mouse(x, y, 0, 0, true);
Flag;
OpenBankFast('feb');
DepositAll;
Wait(1200+random(50));
CloseBank;
end.

As of right now, all it can bank in is the Falador East Bank, due to lack of other codes.

If I did something extremely unintelligent, then let me know, and refer all major SRL screw-ups to waflight of the freddy1990.com forums, because I used his tut to make this. Link below.

http://freddy1990.com/forums/index.php?topic=3128.msg18611#msg18611

impiwimpi

2009-03-28 11:25:47

Nice, but you CAN use all banks(just change feb to veb if you want Varrock East Bank,etc.).
When you wait 10 days and get 8 more posts(no spam) then you will get acces to more tuts, scripts, etc.
As far as I can say, the script is very basic but a good start…(you might wanne take a look in the include part of your scar folder…

WT-Fakawi

2009-03-28 11:29:20

You have done a good job! I remember making scripts like that too a long time ago. It was a kick to discover it actually worked! Before you know it you'll be writing a 1000 line script. Keep it up!

zeeky111

2009-03-28 12:45:47

WT-Fakawi, you don't know how much it means to me that you said that.
Thanks a lot. If anyone really wants to use the script, be my guest. I'll also keep in mind to make it usable with all banks, although I'm not sure what string to enter to let SCAR know.

I have another question, and decided not to create another topic for it:
I know it exists, so what is the SRL for finding if a key is pressed?
I think it's IsKeyDown('x') or something like that…

impiwimpi

2009-03-28 13:33:52

From: zeeky111
WT-Fakawi, you don't know how much it means to me that you said that.
Thanks a lot. If anyone really wants to use the script, be my guest. I'll also keep in mind to make it usable with all banks, although I'm not sure what string to enter to let SCAR know.

I have another question, and decided not to create another topic for it:
I know it exists, so what is the SRL for finding if a key is pressed?
I think it's IsKeyDown('x') or something like that…

I don't really know about the key question but I think you're right
For youre bank questio you could make a const like this:
const
WhichBank : 'veb';

List of banks:
feb = Falador east bank fwb = Falador west bank
veb = Varrock east bank vwb = Varrock west bank
akb = al kharid bank db = draynor bank
eb = edgeville bank
and then you could use in script somewhere:
OpenBankFast(WhichBank);

If you want more help, you can allways visit the IRC channel or add me on MSN: Pm me

zeeky111

2009-03-28 13:41:36

Thanks again! That helped too.

Here's the updated so far:

program Bank;
{.include SRL/SRL.scar}

var
x,y: integer

const
Gtg = 'Brb, bank.';
WhichBank = 'db';

procedure Brb;
begin
SetupSRL;
SendKeys(Gtg);
end;

procedure Bank;
begin
if FindSymbol(x, y, 'bank') then
MMouse(x, y, 10, 10);
Wait(1000+random(50));
Mouse(x, y, 0, 0, true);
Flag;
OpenBankFast(WhichBank);
DepositAll;
Wait(1200+random(50));
CloseBank;
end.

EDIT: Ack! I can't download the includes, thus I can't test the script. Any solutions? I went File > Download Includes, and it came up in the debug screen, but a dialog box came up and said "Error while obtaining includes list!"

noidea

2009-03-28 13:44:17

From: impiwimpi
I don't really know about the key question but I think you're right
For youre bank questio you could make a const like this:

List of banks:
feb = Falador east bank fwb = Falador west bank
veb = Varrock east bank vwb = Varrock west bank
akb = al kharid bank db = draynor bank
eb = edgeville bank
and then you could use in script somewhere:

If you want more help, you can allways visit the IRC channel or add me on MSN: [email]lars_hulstaert@hotmail.com[/email]


btw, that should be

const
WhichBank = 'feb';

zeeky111

2009-03-28 13:56:10

From: noidea
btw, that should be

const
WhichBank = 'feb';


No, I wanted Draynor Bank.

impiwimpi

2009-03-28 13:59:44

draynor is db so just change WhichBank to 'db'

EDIT: I was first ;)

noidea

2009-03-28 14:00:32

Then

Const
WhichBank = 'db';

zeeky111

2009-03-28 14:10:21

Yeah. I changed the const to WhichBank = 'db'.

Btw, can anyone help me? My computer won't let me download includes from SCAR, so I can't test it. I'm not asking you to test it, but is there any way for me to get the includes a different way?

impiwimpi

2009-03-28 14:12:27

Did you tryed it with this guide : http://www.villavu.com/forum/showthread.php?t=17890

zeeky111

2009-03-28 14:24:41

Works, thank you!

zeeky111

2009-03-28 14:30:07

One more problem: (sorry for 2x post)

I get this:
Line 2: [Error] (2:24): 'BEGIN' expected in script C:\Program Files\SCAR 3.15\Scripts\RS Scripts\Bank(proto).scar

When I compile this:
program Bank;
{.include SRL/SRL.scar};

var
x,y: integer;

const
WhichBank = 'db';

begin
if FindSymbol(x, y, 'bank') then
MMouse(x, y, 10, 10);
Wait(1000+random(50));
Mouse(x, y, 0, 0, true);
Flag;
OpenBankFast(WhichBank);
DepositAll;
Wait(1200+random(50));
CloseBank;
end.

I took out the procedure because I only wanted it to bank. It really never worked, though it seems like it will eventually…

Smarter Child

2009-03-28 17:33:03

Fix:

program Bank;
{.include SRL/SRL.scar}

var
x,y: integer;

const
WhichBank = 'db';

begin
if FindSymbol(x, y, 'bank') then
MMouse(x, y, 10, 10);
Wait(1000+random(50));
Mouse(x, y, 0, 0, true);
Flag;
OpenBankFast(WhichBank);
DepositAll;
Wait(1200+random(50));
CloseBank;
end.

For the script in the beginning, don't use SendKeys, it will get you banned, use TypeSend which also clicks enter for you.

GJ on your first basic script.

Hint: Use
 tags.
:)

zeeky111

2009-03-29 15:10:43

Okay, I tweaked it, and it doesn't work, still…
program Bank;
{.include SRL/SRL.scar}

var
x,y: integer;

const
WhichBank = 'db';

procedure Bank;
begin
if FindSymbol(x, y, 'Bank') then
begin
Mousespeed := 7;
MMouse(x, y, 10, 10);
Wait(1000+random(50));
Mouse(x, y, 0, 0, true);
Flag;
OpenBankFast(WhichBank);
DepositAll;
Wait(1200+random(50));
CloseBank;
end else;
end;

begin
ClearDebug;
WriteLn('Debug cleared.');
SetupSrl;
WriteLn('SRL set up.');
Wait(5000);
WriteLn('Banking initiated.');
Bank;
WriteLn('All items deposited.');
WriteLn('Shutting down.');
Wait(1000);
WriteLn(' ________');
WriteLn(' /____ /');
WriteLn(' / ___/ ');
WriteLn(' \______\ ');
WriteLn(' ');
WriteLn('A Zeeky111 Proggy');
end.

googy00

2009-04-05 10:13:42

good one there not sure i seen this before but im new so idk

Smarter Child

2009-04-05 11:43:09

With your tweaked version, when compiled i get this:

Successfully compiled (2624 ms)

Maybe, your not at latest SRL?

zeeky111

2009-04-06 18:07:09

Rofl, that may be it.
I'll try… And I'll edit this post with future concerns about this script in particular. :norris:

royalmarket

2009-04-06 21:20:36

nice, u can bank all tho

zeeky111

2009-04-06 21:28:18

From: royalmarket
nice, u can bank all tho

Would you or anyone else care to elaborate?
Is BankAll or DepositAll a function I'm not seeing?
:confused:

EDIT: I tried tweaking it yet a bit more by adding a failsafe.
Now, the script compiles beautifully, but goes directly to the failsafe.
Not sure if it's an error not visible to the "compiler" or what, so here's the script:
program Bank;
{.include SRL/SRL.scar}

var
x,y: integer;

const
WhichBank = 'vwb';

procedure Idle;
begin
while not IsKeyDown(chr(13)) do
Wait(10);
end;

procedure Bank;
begin
if FindSymbol(x, y, 'Bank') then
begin
Mousespeed := 7;
MMouse(x, y, 10, 10);
Wait(1000+random(50));
Mouse(x, y, 0, 0, true);
Flag;
OpenBankFast(WhichBank);
DepositAll;
Wait(1200+random(50));
CloseBank;
end else
Begin
WriteLn('Failsafe initiated. Error encountered.');
TerminateScript;
end;
end;

begin
ClearDebug;
WriteLn('Debug cleared.');
SetupSrl;
WriteLn('SRL set up.');
WriteLn('Waiting. Press Enter to continue.');
Idle;
Wait(5000);
WriteLn('Banking initiated.');
Bank;
WriteLn('All items deposited.');
WriteLn('Shutting down.');
Wait(1000);
WriteLn(' ________');
WriteLn(' /____ /');
WriteLn(' / ___/ ');
WriteLn(' \______\ ');
WriteLn(' ');
WriteLn('A Zeeky111 Proggy');
end.