SRL Archive - RS3 Outdated / Broken Scripts

My procedure dump.


Jason2gs

2007-03-17 01:11:21

I do believe this kind of thing goes here.

Anyways, hi :)

I've put together a few simi-useful procedures here, and decided to share them with the rest of this community :p


procedure ClickToContinueEx(Times:Integer);
var
Done : Integer;
begin
repeat
ClickToContinue;
Wait(500 + Random(500));
Done := Done + 1;
until(Times = Done);
end;

Well, I got tired of typing in "ClickToContinue" over and over again, so I made a procedure for multiples of that command.


procedure NPCFinder(NPCColor, Tol: Integer; Name: String);
var
Tries : Integer;
begin
repeat
if(FindColorSpiralTolerance(x, y, NPCColor, MSX1, MSY1, MSX2, MSY2, Tol))then
Wait(500 + Random(100));
MMouse(x, y, 1, 1);
Tries := Tries + 1;
if(Tries >= 5)then
begin
KeyDown(37);
Wait(1000 + Random(500));
KeyUp(37);
Tries := 0;
end;
until(IsUpText(Name));
Mouse(x, y, 0, 0, False);
ChooseOption(x, y, 'Talk');
end;

This one and the next are pretty much in the same boat. They're just very simple ways of opening doors/talking to NPCs.


procedure DoorOpener(DoorColor, Tol:Integer);
var
Tries : Integer;
begin
repeat
Wait(500 + Random(100));
if(FindColorSpiralTolerance(x, y, DoorColor, MSX1, MSY1, MSX2, MSY2, Tol))then
MMouse(x, y, 1, 1);
Tries := Tries + 1;
if(Tries >= 5)then
begin
KeyDown(37);
Wait(1000 + Random(1000));
KeyUp(37);
Tries := 0;
end;
until(IsUpText('Door') or IsUpText('Gate'));
if(IsUpText('Open'))then
begin
Writeln('Found a door.');
Mouse(x, y, 0, 0, False);
ChooseOption(x, y, 'Open');
Writeln('Opened door.');
end;
if(IsUpText('Close'))then
begin
Writeln('Door was already open.');
Exit;
end;
end;

Enjoy! Tell me what you think them.

I'll add more later on ;)

Hobbit

2007-03-17 01:39:38

very nice…can i use em in my tut runner?

Jason2gs

2007-03-17 02:03:50

Sure, that's what they're here for :)

3Garrett3

2007-03-17 16:01:52

So for the NPC thing, could we use that to trade too? I have been trying to find this out for a while. I would just change talk to trade wouldnt i?

Jason2gs

2007-03-17 18:59:20

Thats correct.

If you're going to use it some of the time for talking and some of the time for trading, you could just take out "Talk", and tell scar what to do each time you use the command. Not that hard, eh?

Hobbit

2007-03-18 01:19:17

also in the local variables you need to add x,y

and its really weird..when i have procedure in its own scar window the parameter guide thing pops up liek it should…but when im doing it in my script it wont pop up :confused: owell it still works

Jason2gs

2007-03-18 13:11:25

In SRL the variables x and y are already declared. The functions use the command "ChooseOption" which is SRL. If you're going to use these procedures, you'll need SRL. (Unless you're going to modify it.)

Hobbit

2007-03-18 21:31:40

yah i got that….but dont u get dupicate idintifer error if you dont put in local vars?

whales

2007-03-18 21:34:57

From: Hobbit
yah i got that….but dont u get dupicate idintifer error if you dont put in local vars?


If you have SRL included and you were to Declare X and Y then you would get a duplicate identifier error. If this is what you mean

Hobbit

2007-03-18 21:45:08

if you declaired it in global vars at begining of script yes, but in local right after title of procedure before begin, no you don't i just tested to be sure, well it has no harm so just to be safe i'm declaring in local vars…but it does work without

whales

2007-03-18 22:17:47

From: Hobbit
if you declaired it in global vars at begining of script yes, but in local right after title of procedure before begin, no you don't i just tested to be sure, well it has no harm so just to be safe i'm declaring in local vars…but it does work without


Ok thats what I figured. Always good to be sure :)

~alex~

2007-03-29 03:19:50

Thanks man really needed the Npc finder. Is it okay if I edit it slightly? Just so if it doesn't find the npc it wont stop te entire script. Ill still give ya full credit :D

Jason2gs

2007-03-29 15:36:28

From: ~alex~
Thanks man really needed the Npc finder. Is it okay if I edit it slightly? Just so if it doesn't find the npc it wont stop te entire script. Ill still give ya full credit :D


Take it, modify it, do whatever you want to it. ;)

If someone posts a script, I don't believe that they have any right to say it can't be edited to someone elses likings.

Hobbit

2007-03-29 17:29:04

have u posted this in the new srl procedures section?..cause i think this would be a good thing to have

Smartzkid

2007-03-29 17:32:59

I think that's Members only, isn't it?

Hobbit

2007-03-29 17:36:08

no clue…i'll check and see then edit this post yes or no

edit: yes…oops nvm then

Jason2gs

2007-03-29 18:29:07

You can post it there if you want ;)

Hobbit

2007-03-30 00:28:47

why u want me to do it for u? lol

Jason2gs

2007-03-30 13:40:32

Tis members' only. I'm not a member ;)

You said it would be a good thing to have there, so if you want to, feel free to post it :)

Hobbit

2007-03-30 17:49:37

nah i think you got good chance of becomeing member whenever you apply so you can do it :p

Jason2gs

2007-03-30 18:56:50

Heh :p

Thanks, mate ;)