SRL Archive - First Scripts

{My First Script}Walker/Banker


Darevaine

2007-10-19 02:56:36

So, I'm trying to make a script that automates walking from Karamaja dock to Draynor bank, then deposits the lobsters once there. Right now, it's going to run tended. I may go ahead and write a bit more into it later. *shrug* I figured I'd go ahead and get my feet wet with something simple.

Right now all I have is the procedure to take the boat to the mainland from Karamaja, and I'd like some advice on it. It seems to work fine, but I haven't tested it extensively yet. If there's any glaring errors with my scripting I'd like to correct them now rather than later.


procedure BoatToMainland;

var x, y, MarkBoatTime, IsBoatTaken: Integer;

begin
MarkTime( MarkBoatTime );
repeat
if( FindColorTolerance( x, y, 3875105, 9, 3, 498, 243, 8 )) then
begin
IsBoatTaken := 0;
if( not( LoggedIn )) then exit;
// writeln( 'Customs officer color found!' );
MMouse( x, y, 0, 0 );
if( IsUpText( 'lk-to' )) then
begin
// writeln( 'Customs officer found!' );
Mouse( x, y, 0, 0, false );
Wait( 692 + Random( 1745 ));
if ChooseOption( 'Pay-Fare' ) then IsBoatTaken := 1;
end;
end;
until( IsBoatTaken = 1 ) or ( TimeFromMark( MarkBoatTime ) > 20000 );

//Find the customs officer using colors.
//Right-click on cust. off. and 'pay-fare'.

end;

The commented stuff at the end is my notes on what to do when. It doesn't need to be there, but it doesn't need to be gone either. The writeln stuff was there so I could test the code before I made it actually interact.

Anyhow, let me know what you think. I appreciate any constructive advice. :)

slackjaw7

2007-10-19 07:48:51

I'm still working on scripting. so far everything i've worked has gotten me an auto login and thats it. From my understanding and what i've seen of auto bankers, that is complicated. IDK what background you have in scripting. But when I saw a banker, I was stumped as to where to start making one of those.

Kudo's on the start. & GL on the auto banker.

Slackjaw7

Darevaine

2007-10-20 01:32:49

The banking part seems simplest to me, actually. I've already made and tested a DTM for the Draynor bankers. It seems to work all the time now. And I made a DTM for the bank counter. I'm not sure how well that'll work; I haven't gotten around to testing it yet. Also, I was looking in the SRL includes, and there already seems to be a procedure written to open each of the free world banks, so I may not even have to bother with scripting an opening procedure. Gotta test it out a bit more. :)

As for my background… I messed around in Basic years(YEARS) ago, played with C++ a bit, and most recently took a couple classes in Java… And luckily, SCAR doesn't really seem much different from Java. I suppose I'm picking it up pretty quickly. It's good to be actively programming again. Lots of fun. And $ in Runescape. ;)

rhyke

2007-10-20 03:59:18

It looks very very nice! Impressive for first script…

I am a java-er myself, but SRL looks very confusing to me so far (only 1-2 days looking at it). I will jump on the bandwagon soon enough. But up till now, I am just looking and learning.

Do you think you will have a working alpha/beta version up soon?

Darevaine

2007-10-20 14:42:51

Probably not. I'm guessing it'll take about 3-4 more weeks for me to finish it. I've got alot of other stuff going on now. Just working on it in my spare time, and breaks from doing diff. equ. and chem. homework. Heh. Mabye after my tests this week I'll spend more time on it and it'll be done in two weeks. *shrug*

Good luck with SRL. Give it a few more days… It'll sink in and you'll be off and running. If you figure out something fairly simple for your first script, and look at some specific examples from actual working scripts, it'll make the task easier.

catman

2007-10-20 14:49:51

YAY!!! when i fish i hate to walk to bank! next time ill use this:cartman: