SRL Archive - Outdated Tutorials

Ultimate Basic Functions Guide


Richard

2008-03-28 18:13:51

The Tut for Basic SCAR Functions

This is the long tut I said I would work on so that beginners would find this helpful to start with as this is going to cover the use of most basic SCAR functions. I will be adding more functions to it when I get more time.


Waiting

Wait(milliseconds: integer);

This is one of the most used function in SCAR, as you might have guessed it waits the time specified in the milliseconds bit (1 second = 1000 milliseconds). You will use this for auto-talkers if you make them, to wait between speech and many other things. You will always want to use this because it waits, I mean you wouldn't want a script that just did everything before it had finished the previous thing.

If you find that you want to add random time so that the script is not detectable. All you have to do is add
+random(milliseconds: integer);
So that it will wait anywhere between your first value and you first value plus your random value. You want to add randomness as it will not get you banned.

Example: If you wanted you script to wait 1 second plus a random second you would right the function out like this:
Wait(1000+random(1000));

So theres you first easy functions lets move onto the next one…


Moving the Mouse

Mouse(coordx, coordy, rancoordx, rancoordy :integer, left mouse click: boolean);

This is a very basic function but many people miss-use it by not adding the random coordinates, if you don’t want to get people banned, add something like 3 in the “rancoordx” “and rancoordy” so that there will be an offset, also know as a random ammount added on to the coords. You want to use this function because it is the safest mouse moving functions out there, and it has randomness, making it very undetecable.

The first coords are the coords within the client you are using. The normal RS client is about 700 by 600.

The last bit with the Boolean is which mouse click you want to use, True means left, False means right.

Example: Lets say you wanted to move to 100x and 100y, with the randomness of 5, and you wanted to do a left click:
Mouse(100,100,5,5,True);

There you go, another well used function, onto the third…


Typing into the Client

TypeSend(text: string);

Another commonly used function, it will basically type like a human into the client you are using. You want to use this as 1: It talks! and 2: Its very undetectable because its human-like.

One thing I must tell you is that you must ALWAYS put apostrophes ( ‘s ) around the text otherwise you will get an error.

This is very easy and quick to use, just type in the message you want, put apostrophes either side of your text, if it has apostrophes it will be in pink writing, and you are a good to go!

Example: I want to type “iMacro” into the client I’m using.
TypeSend('iMacro');

And there you go, a way to talk in RS, now for the fourth one…


Typing in the Debug Box

WriteLN(text: string);

This is exactly the same to use as TypeSend, just that it types the message into the debug box(the box at the bottom, used for debugging :)). So I don’t think I’ll need to explain how to use it as its the same as TypeSend, except you write WriteLN instead. You will want this as you can make sig with it, proggies, and information to the user.

Example: I want to tell the user of my script that its logging in the Runescape character.
WriteLN('Your character is logging in');

Basic function, but very useful, moving on to number 5…

Changing the Game Tab

GameTab(game tab :integer);

This is another very simple function to use, all you have to do it is write in the number of the game tab you want to use. 1: fighting tab 2: skills tab 3: quest tab 4: invent tab 5: equip tab 6: prayer tab 7: mage tab 8: summoning tab 9: friends tab 10: ingore tab 11: clan chat tab 12: settings tab 13: music tab.

Example: I want to go onto the invent tab:

GameTab(4);

We're getting near the end, hope you aren't too bored…



Changing the Angle

SetAngle(highest :Boolean);

This is how to change the angle of your camera in RS, its very simple to use. You want to use this because it is basically a short cut to having to write out a whole function the presses the keys for certain ammounts of time. You either type
SetAngle(True);
For the highest.

Or
SetAngle(False);
For the lowest.

Now onto number 7, we’re getting there…


Changing the Compass

MakeCompass(direction: string);

This is a simple way to move the camera to the direction you want it to. You again must use apostrophes around it. You always use the first letter of the direction you want to go, e.g. north would be ‘N’. This is also great because it is once again a shortcut to writing the whole function again.

Example: I want to make the camera face west
MakeCompass('W');

Just one more now…


Commenting

//Commenting and
{different commenting}

Commenting is another word for putting information that won’t affect how the script will run. And you'll want to use this alot as without it you can't really tell the user how to use the scirpt and what it does so you will find it your best friend :).

There are 2 ways to comment in scar, the first is to use to forward slashes (//). This is good if you are commenting after a function in a script to tell someone what to do to it or what it does. But you can only have the information after the slashes and only on that line.
//Commenting is fun :)

The other way is to use 2 of the squiggly bracket things ({}). These are good for adding longer amounts of commenting. All you have to do it have the information between the 2 brackets.
{Type your
Information right in
Here}

The only time that this will affect the script is when you put .include at the front, as this will include and include (lol).


I hope that this tut has helped you on your way to greatness! And that it wasn’t too long…

King of the Nites

2008-03-28 21:18:11

This is a nice TUT it helped me with some stuff. It went over some of the more bassic functions but i liked it:D I don't think they should give you the TUT cup just because if they do you will probably end up not making anymore tutorials. And a lot of yours are good. Jk :p and GJ

Torrent of Flame

2008-03-29 06:01:17

This is the one you was spending all of that time working on? Hardly worth the cup mate :P

Naah. Its a nice tutorial. Im not bothering with the White text cause you ISpy it anyway, but yeah, good for the beginners.

Richard

2008-03-29 06:29:33

Yeah, like I said, I'm going to add to this when I get more, but this covers the basics commands, I'll add to it now probs.

Torrent of Flame

2008-03-29 06:31:49

Ima finish up my big assed tutorial soon.

Richard

2008-03-29 06:39:39

Cool, it better be good :p

I'm gonna add some functions to this now.

Torrent of Flame

2008-03-29 07:09:34

Finito :]

It looks pretty freaking sweet.

Richard

2008-03-29 07:10:28

Yeah, it does, look at my post :D

I'm just giving rep out quickly so I can rep you again lol

Torrent of Flame

2008-03-29 07:29:08

Thanks DR :]

I have 26 Rep now : D

Richard

2008-03-29 07:43:47

Np, rep is great fun :D

I have 38 hehe, I would have more but some noob reported my post for some stupid reason.

nielsie95

2008-03-29 08:18:41

I do hope you know that asking for rep is against the rules and that this
(*cough* tut writers cup please *cough*)


goes a bit too far? You already got a cup yesterday ;)

Torrent of Flame

2008-03-29 08:39:08

He wasnt asking for Rep 0_o

Richard

2008-03-29 08:48:27

From: nielsie95
I do hope you know that asking for rep is against the rules and that this

goes a bit too far? You already got a cup yesterday ;)


Is it? Sorry, I wont ask for it again.

And I'll delete out that line to make you happy :)


I was wondeirng, how many infractions is it before you get ban?


EDIT: Nielsie, there you go :p

Gu3st...

2008-03-29 09:44:50

Ahem.. there is 3 ways to comment in scar… //, { } and (* *)..

Richard

2008-03-29 10:04:45

I didn't actuallt know that lol.

Well you learn something new everyday

nielsie95

2008-03-29 11:38:09

From: Torrent of Flame
He wasnt asking for Rep 0_o

It was also to you ;)

From: Dude Richard

I was wondeirng, how many infractions is it before you get ban?


3 infractions for registered and juniors will result in a temporary ban.
6 infractions for any rank will result in a permanent ban.

Torrent of Flame

2008-03-29 12:09:28

0_o

Sorry then nielsie :]

Richard

2008-04-03 14:59:56

From: Torrent of Flame
0_o

Sorry then nielsie :]


Lol, you know half of these rules aren't in the official rules post.

Torrent of Flame

2008-04-03 15:37:16

*Sigh* Well!

Lol :P

red eyes 20

2008-05-12 01:10:16

program New;
{.include SRL/SRL.scar}
begin
mouse(25,10,0,0,true);
end.
end.

if i use the mouse procedure it moves VERY slowly, so how do i make the mouse move uber fast cause im making a non runescape script

NiCbaZ

2008-05-12 01:53:04

SetupSRL in after begin ;)

red eyes 20

2008-05-12 16:15:15

oooooh so i need to make it

{.include SRL/SRL.scar}
begin
SetupSrl;
mouse (10,15,0,0true)
end.

Naum

2008-05-13 12:44:52

Actually :

{.include SRL/SRL.scar}
begin
SetupSrl;
mouse (10,15,0,0,true)//Need a comma here ;)
end.

Hope I Helped :)

Richard

2008-05-13 14:23:26

From: red eyes 20
program New;
{.include SRL/SRL.scar}
begin
mouse(25,10,0,0,true);
end.
end.

if i use the mouse procedure it moves VERY slowly, so how do i make the mouse move uber fast cause im making a non runescape script


The reason it does that it because the default mouse speed is 1, which is very slow, SetupSRL makes it go to 15. But if you can't be bothered to put that, just do MouseSpeed := 12+random(6). That makes it between 12 and 18, less detecable ;).

TViYH

2008-05-13 15:06:22

put SetupSRL; right after begin

ShowerThoughts

2008-05-13 15:26:43

-.- okay Dude richard…. this is Basic SRL functions like 1 or 2 of all those are scar rest is SRL

mixster

2008-05-13 15:26:59

From: Dude Richard
just do MouseSpeed := 12+random(6). That makes it between 12 and 18, less detecable ;).

*cough*12 and 17 *cough* Random returns a random value between 0 and input number - 1 as it starts on 0 not 1 ;)

Richard

2008-05-14 13:10:02

From: mixster
*cough*12 and 17 *cough* Random returns a random value between 0 and input number - 1 as it starts on 0 not 1 ;)


Meh, I'm a noob :D

@Hermpie, that because SRL are much less detecable.

ShowerThoughts

2008-05-14 13:12:06

SO THIS IS AN SRL SHIT THINGY NOT AN SCAR!

oops caps were on :D

insanomano

2008-05-17 14:09:44

HAHA woot man I like the tut. extrememly basic(but hey im a basic scripter) but I was wondering how to make my screen move around and stuff. thx

eugenius1

2008-05-21 14:35:31

i read every bit of this guide and it has helped me understand alittle bit of whats going on.. i probably will start scripting but, it seems like alot of work for me to do……