How to create your first script
How to create your very first script by Bebemycat2
What is this going to cover?This tutorial will take you step by step through the process of learning how to create your very first script. I will explain every step to you and also throw in some useful scripting tips along the way.
Tutorial:
Ok to begin I will ask you to open up SCAR (
http://www.dylock.net/scar/). Now all you should see is this:
program New;
begin
end.
Well I want you to space all of those out a bit like this:
program New;
begin
end.
This will give us some space to code in. This is just the basic elements.
program New; This is your programs name, Change "New" to whatever name you want your program to be. Always add a semicolon ( ; ) after the name to tell the script that that is the end of your scripts name.
begin Tells the compiler that the script has just began, the coding of your script goes between "begin" and "end."
end. Tells the compiler that you have ended the script, Make sure to always put a full stop. If you are making a procedure/function then you end it with a semicolon ( ; ), that will be explained later in the tutorial.
Next thing we are going to do is this:
program script;
procedure;
begin
end.
You will notice that I have added something called a
Procedure. Well a "procedure" is basically this:
From: XxKanexX
Procedures are like sections of the
script that can be called upon for many different reasons.
This procedure is where we will create the "body" or the majority of our script, from there is can be called upon later in the
"main line" this I will explain more about later.
You also have to have a name for your procedure, so lets name it "Hello" and add a semi-colon after it so it looks like this:
program script;
procedure;
begin
end.
You name the procedure so that you can "call" upon it later in the script. You can name it anything but I am going to use "Hello" for this script.
Now what we are going to do now is add somthing called a
"const" or a constant. This means that this "setting" will stay the same throughout the entire script.
To make a const you simply need to do this with your script:
program script;
const
procedure hello;
begin
end.
Now we have to make something a const, so let make it this:
program script;
const
Message1='Hello world!';
procedure hello;
begin
end.
Now you will notice that I have "Message1=" this is because with SCAR you have to always tell it what the "Message1" equals, that’s the reason for the "=". Now for the ' ' marks. These are what SCAR uses to identify when a
String begins and when it ends. A string is a word / phrase. You will notice that it has a pinkish color to it, that is the "Syntax highlighting" that SCAR creates so that scripting can be much simpler.
Now that we have a "const" we need it to do something. You can find a basic list of procedures and functions in your SCAR folder called "procedureparams". It should look somthing like this:
procedure Writeln(s: string);export;
procedure Status(s: string);
function GetStatus: string;
function Readln(question: string): string;
function GetChatMsg: string;
function GetLastChatMsg: string;
……
……
and so on. Now scroll down the list until you come to a procedure called:
Writeln(s: string);
Now as I explained before a procedure is:
From: XxKanexX
Procedures are like sections of the
script that can be called upon for many different reasons.
And a string is: A string is a word / phrase.
This procedure:
procedure Writeln(s: string);
just means that the "S" is a string, so therefore that is where we would enter what we wanted to type.
So I want you to make your Script look like this now:
program script;
const
Message1='Hello world!';
procedure hello;
begin
Writeln();
End.
You will notice that I have "Writeln();" after the begin, that is because you have to begin the script before you can do anything. :)
Also "Writeln" is a typing "command", it tells SCAR to type the keys that you specify. The Text will show up in shomthing called the "Debug" box that is this area of SCAR:

Now we will do this:
program script;
const
Message1='Hello world!';
procedure hello;
begin
Writeln(Message1);
End.
Now normally we would have to use the ' ' identifiers around "Message1" but in this case, since it is already in the "const" there is no need to and this will tell SCAR to type what you have filled out in the "const" "Message1".
Now we have to tell SCAR that we want to end the current procedure for this we will add "end;" like so:
program script;
const
Message1='Hello world!';
procedure hello;
begin
Writeln(Message1);
end;
end.
This is simply to tell SCAR to end the procedure, you will do the same with a function.
"End;" is different from "end." because "end." tells SCAR to end the whole script while "end;" tells it that you are done with a procedure/function.
Now we have to make SCAR actually type our "message" and use our procedure that we have just created. to do this we have to create the "main line" I mentioned before. This is done much like a procedure but has a few differences that I will explain.
So to start off your "main line" you will need to have a "begin" like so:
program script;
const
Message1='Hello world!';
procedure hello;
begin
Writeln(Message1);
end;
begin
end.
You will notice the begin is there, this is just telling SCAR this is where your main line shall begin. Simple, no? :)
So now we are going to make SCAR repeat something. The command to make SCAR repeat is
"repeat". This will go after the being in the "main line". So you should now have code that looks like this:
program script;
const
Message1='Hello world!';
procedure Hello;
begin
Writeln(Message1);
end;
begin
repeat
end.
This basically telling SCAR to begin the "main line" and repeat something. Now we have to tell it what it needs to repeat. For this we will take our procedures name (Hello) and add it under our repeat command. So it should look like this:
program script;
const
Message1='Hello world!';
procedure Hello;
begin
Writeln(Message1);
end;
begin
repeat
hello;
end.
This will tell SCAR to repeat our "Hello procedure". But we have to tell it how long it has to repeat it for, so we will need the command
"until". like so:
program script;
const
Message1='Hello world!';
procedure Hello;
begin
Writeln(Message1);
end;
begin
repeat
hello;
until(false)
end.
Now you will notice that I have "until(false)" when I only told you to add "until". Well until needs some sort of "time marker" to tell it when to repeat until, and "(false)" tells it to repeat forever, this will make it an infinite "loop". With "until(false)" this script will repeat our procedure "Hello" forever, never stopping until the user stop SCAR manually.
Now hit: "script" —–> "Compile" and you should get this message in the "debug" box that says "Successfully compiled" this means that you coded the script right. Now to test it.
With your "crosshair"(

) select your debug box and hit "run script". You will notice that it keeps typing it over and over really fast. So now we need to slow it down a bit. for this we will use a procedure called "wait". Wait tells the script to wait a designated amount of miliseconds before it's next action. To add wait what we do is this:
program script;
const
Message1='Hello world!';
procedure Hello;
begin
wait(1000)
Writeln(Message1);
end;
begin
repeat
hello;
until(false)
end.
You will notice the "1000)" this is the amount of milliseconds you want to wait, now if you paid attention in math(s) (Depending on if your American or not you call it math or maths) you will know that 1000 milliseconds is 1 second. So we are basically saying that when SCAR reads the "main line" and does our procedure "Hello" that it should wait 1 second before it repeats. Simple, no?
Now run it.
You will see that it types at a much more controlled rate now.
CONGRATULATIONS! You have just made your very first script!
The other method…..
Ok, so you know how I had:
program script;
const
Message1='Hello world!';
procedure Hello;
begin
wait(1000)
Writeln(Message1);
end;
begin
repeat
hello;
until(false)
end.
as our final code to creating a "Hello world"/First script, well I would like to show you another method to do this, that is just as effective.
We will take our above code and change it to this:
program script;
procedure Hello;
begin
wait(1000)
Writeln('Hello world!');
end;
begin
repeat
hello;
until(false)
end.
You will notice that I have removed the:
const
Message1='Hello world!';
and changed:
Writeln(Message1);
to
Writeln('Hello world!');
Now as I mentioned above, the apostrophes mark the begining and end of "
strings". But just to recap:
Now for the ' ' marks. These are what SCAR uses to identify when a String begins and when it ends. A string is a word / phrase. You will notice that it has a pinkish color to it, that is the "Syntax highlighting" that SCAR creates so that scripting can be much simpler.
So basicly we have removed our "
const" or constant and made "Writeln" directly type our message.
It is a simple chnage and makes no difference to the performance of the script, it truly depends on your style of scripting.
Design tips:When you want to leave notes to the user of your script like this:
program script;
const
Message1='Hello world!';
procedure Hello;
begin
wait(1000)
Writeln(Message1); // this says hello
end;
begin
repeat
hello;
until(false)
end.
Now you will notice that I used "//". This tells SCAR not to include what comes after the "//" in the script.
Now if you don't feel like using "//" every time you want to comment on something, then you can use " { " and " } ". examples of both.
with //:
program script;
const
Message1='Hello world!';
procedure Hello;
begin
wait(1000)
Writeln(Message1); // this says hello wolrd!
end;
begin
repeat
hello;
until(false)
end.
with { and }:
{
This a script in scar that will say
Hello world!
}
program script;
const
Message1='Hello world!';
procedure Hello;
begin
wait(1000)
Writeln(Message1); { this says hello}
end;
begin
repeat
hello;
until(false)
end.
You will notice that with { and } that you can do multiple lines where as with // you can not with out constantly typing "//" over and over.
The end.
weaselforce
2006-04-08 01:45:28
nice thorough tut, good job!
From: weaselforce
nice thorough tut, good job!
Thank you, glad somebody liked it :)
XxKanexX
2006-04-11 02:19:19
Kane quotes, yay :D
Excellent tutorial Megan! <3
I remember first post=p
2006-04-11 16:59:08
From: Bebemycat2
Thank you, glad somebody liked it :)
I still liked it even though I didn't need it :p
*Cough*
+rep *Cough*
<3 Gj
Thanks Kane and IRMFP, also Kane, it wouldn't be a true tutorial without a quote from you ;)
Thanks bebe, this is a good starter. I have just decided to start making scar scripts, so hopefully you'll notice some *free* scripts coming from me in the near future.
One problem I'm having with this is the waiting time. I did wait(1000) but it has no effect, and to double check I copied and pasted your code and it still isn't waiting. It's just outputting it lightning fast, no matter how long I put the wait for. But, I've got some reading to do :)
From: jme_009
Thanks bebe, this is a good starter. I have just decided to start making scar scripts, so hopefully you'll notice some *free* scripts coming from me in the near future.
One problem I'm having with this is the waiting time. I did wait(1000) but it has no effect, and to double check I copied and pasted your code and it still isn't waiting. It's just outputting it lightning fast, no matter how long I put the wait for. But, I've got some reading to do :)
Weird, I'll run my code and see if I did somthing wrong, but try adding a higher wait time.
Edit:Try this:
program script;
const
Message1='Hello world!';
procedure Hello;
begin
wait(1000)
writeln(Message1);
end;
begin
repeat
hello;
until(false)
end.
From: Bebemycat2
Weird, I'll run my code and see if I did somthing wrong, but try adding a higher wait time.
Edit:
Try this:
program script;
const
Message1='Hello world!';
procedure Hello;
begin
wait(1000)
writeln(Message1);
end;
begin
repeat
hello;
until(false)
end.
That version worked :)
Thanks again.
No problem at all :)
Edit: Updated tutorial :)
SubiN
2006-04-29 21:59:18
WoW thnx for tut man WITH this i made my first SCRIPT ever thnx .
// AUTO TALKER . \\
// ~~~~~SUB's Scripts~~~~~ \\
// ()|||Auto talker v 1.0|||() \\
//~~~~~~~~my first script ever ~~~~\\
program script;
{.include SRL\SRL.Scar}
const
Message1='hi i am subin'; //what you want to say !
procedure Hello;
begin
Wait(2000) // Plz set how long you want to wait b4 it repeat, Set in millisecond
Writeln(Message1);
end;
begin
repeat
hello;
until(false)
end.
I'm a girl :)
And your welcome, glad I can help you out :)
Ejjman
2006-04-30 11:35:31
If any new script makers come here, I suggest you use this. It works very great. This is what got me to making good scripts.
Avaphi
2006-05-07 01:57:58
Wow this really helped me alot, I am now eager to learn more. Thanks alot ! :D
torrent
2006-05-10 15:03:19
nice guide but i dont undertsand any of it.. it maybe my english or im just too stupid :\
From: torrent
nice guide but i dont undertsand any of it.. it maybe my english or im just too stupid :\
It is fairly simple to understand, try reading it over and exploring SCAR, if you still do not understand then private message me and I will try to personalize it more to you. :)
Also try to look at some simple scripts to see how they are setup. And look in the "help" section in Scar (Hit F1 in SCAR or hit "help"—> 'Help')
fibblefop
2006-05-12 16:48:45
Great, i'm gonna start scripting! Only one thing i'm finding hard to understand, and that's semi colons. Could you explain them in more detail? cause i don't know when to put them or not….
Basicly you put a semi colon on the end of ever line except Bolded words. :)
Example:
program Bebeclicker;
Const
X=0; {X coord}
Y=0; {Y coord}
Procedure ClickHuman(x, y : Integer; left : Boolean);
Begin
holdmouse(x, y, left);
wait(40 + random(50));
releasemouse(x, y, left);
End;
Function Dist(a1, b1, a2, b2 : Integer) : Integer;
Begin
Result := Trunc(Sqrt(Sqr(a1 - a2) + Sqr(b1 - b2)) + 0.999999);
End;
procedure MouseC(Mousex, Mousey, Click : Integer);
var
Movex, Movey, Ax, Ay, Bx, By, Cx, Cy,
T, tCubed, tSquared, Increase: extended;
Con1x, Con1y, Con2x, Con2y, MinWait, MaxWait, SControl,
EControl, Step, Tempx, Tempy, TempDistance: Integer;
begin
GetMousePos(Tempx, Tempy);
TempDistance:= Dist(Mousex, Mousey, Tempx, Tempy);
MinWait:= 2;
MaxWait:= 5;
SControl:= TempDistance div 6;
EControl:= TempDistance div 2;
Step:= 7;
If not(TempDistance = 0)Then
Increase:= (1 div TempDistance) * Step;
Con1x:= Tempx + Random(SControl * 2) - SControl;
Con1y:= Tempy + Random(SControl * 2) - SControl;
Con2x:= Mousex + Random(EControl * 2) - EControl;
Con2y:= Mousey + Random(EControl * 2) - EControl;
Cx:= 3 * (Con1x - Tempx);
Bx:= 3 * (Con2x - Con1x) - Cx;
Ax:= Mousex - Tempx - Cx - Bx;
Cy:= 3 * (Con1y - Tempy);
By:= 3 * (Con2y - Con1y) - Cy;
Ay:= Mousey - Tempy - Cy - By;
repeat
T:= T + Increase;
tSquared:= T * T;
tCubed:= tSquared * T;
Movex:= (Ax * tCubed) + (Bx * tSquared) + (Cx * t) + Tempx;
Movey:= (Ay * tCubed) + (By * tSquared) + (Cy * t) + Tempy;
MoveMouse(Round(Movex), Round(Movey));
Wait(Random(MaxWait - MinWait) + MinWait);
until(T >= 1)or
(Movex = Mousex)and(Movey = Mousey);
if (Movex <> Mousex) or (Movey <> Mousey) then
MoveMouseSmooth(Mousex, Mousey);
Wait(40 + Random(20));
Case click Of
1 : Clickhuman(Mousex, Mousey, true);
2 : Clickhuman(Mousex, Mousey, false);
End;
end;
Procedure Clicky;
begin
MouseC(X+random(40),Y+random(40),0);
wait(70+random(40));
MouseC(X,Y,1);
end;
begin
repeat
Clicky;
until(false)
end.
You will notice that I have a ";" on the end of everythingexcept things like "until(false)", "Begin"… etc.
Although you will notice that I have a semi-colon on the end of my "end" except the very last on, this is basicly telling SCAR that you are ending a procedure/function insteed of the whole script.
The only "end" that you will not have a semi-colon on or a period is when you are using an "else" statment like so:
procedure TerminateIfLost;
begin
if(LoggedIn)then
begin
if(not(FindMMColor(x,y,BBankColor)))then
begin
IAmLostCount:=IAmLostCount+1;
if(IAmLostCount>10)then
begin
WriteLn('Lost!!!');
TerminateScript;
end;
[B]end else[/B]
IAmLostCount:=0;
end;
end;
Thise will basicly tell the the script that if the conditions set my you/script maker are meet then the procedure/function will end, while if the conditions are not meet then it will do what the allternate conditions set by you/script maker are.
Another thing is that see where I have
Const
X=0; {X coord}
Y=0; {Y coord}
well the semi-colon on the end of those is to tell the script where to end the "const" or constants.
It is a simple idea really, practice with it and you will get the hand of it.
fibblefop
2006-05-13 02:21:58
ok thanks!
Thanks a ton! This will get me on my way to hopefully giving out a little to this community! :D
From: Usa
Thanks a ton! This will get me on my way to hopefully giving out a little to this community! :D
No problem, I find that the hardest part of learning a new language is learning the basics, cause once you understand those then you can learn everything else with simplicity.
Miitchyy
2006-05-29 08:09:15
very good tutorial :D
Thx, very useful tutorial. It refreshed my little SCAR-knowledge. :-)
goider
2006-05-30 17:38:27
From: db_cheater
Wow this really helped me alot, I am now eager to learn more. Thanks alot ! :D
WOW i actually get your guide, i have looked at maybe 20 other's and they had no help to me, i get it YAYAYAYAYAY thank you so much
Edit: AM i the only one who voted and gave this thread a 5/5 stars?
WhiteShadow
2006-05-30 19:01:45
Well this is a "make your very first script thread" ;)
Yea nice Bebe, many good comments from starters for you. :)
Updated a bit, added a few things. Have fun learning :)
thecoolbrian
2006-06-20 00:09:14
hay guys just so you know i,am starting to wright scrips in scar and going to sell them
i have made and auto typer thats types hello world 1000000 times over i will be selling it for 10 mil rs gp
lol
nice tut dude i loved it
wstephen4
2006-06-29 15:14:30
Nice begineer tutorial for me. It helped alot with the basics. Just one question, after this tutorial am I supposed to be able to code like:
From: Bebemycat2
program Bebeclicker;
Const
X=0; {X coord}
Y=0; {Y coord}
Procedure ClickHuman(x, y : Integer; left : Boolean);
Begin
holdmouse(x, y, left);
wait(40 + random(50));
releasemouse(x, y, left);
End;
Function Dist(a1, b1, a2, b2 : Integer) : Integer;
Begin
Result := Trunc(Sqrt(Sqr(a1 - a2) + Sqr(b1 - b2)) + 0.999999);
End;
procedure MouseC(Mousex, Mousey, Click : Integer);
var
Movex, Movey, Ax, Ay, Bx, By, Cx, Cy,
T, tCubed, tSquared, Increase: extended;
Con1x, Con1y, Con2x, Con2y, MinWait, MaxWait, SControl,
EControl, Step, Tempx, Tempy, TempDistance: Integer;
begin
GetMousePos(Tempx, Tempy);
TempDistance:= Dist(Mousex, Mousey, Tempx, Tempy);
MinWait:= 2;
MaxWait:= 5;
SControl:= TempDistance div 6;
EControl:= TempDistance div 2;
Step:= 7;
If not(TempDistance = 0)Then
Increase:= (1 div TempDistance) * Step;
Con1x:= Tempx + Random(SControl * 2) - SControl;
Con1y:= Tempy + Random(SControl * 2) - SControl;
Con2x:= Mousex + Random(EControl * 2) - EControl;
Con2y:= Mousey + Random(EControl * 2) - EControl;
Cx:= 3 * (Con1x - Tempx);
Bx:= 3 * (Con2x - Con1x) - Cx;
Ax:= Mousex - Tempx - Cx - Bx;
Cy:= 3 * (Con1y - Tempy);
By:= 3 * (Con2y - Con1y) - Cy;
Ay:= Mousey - Tempy - Cy - By;
repeat
T:= T + Increase;
tSquared:= T * T;
tCubed:= tSquared * T;
Movex:= (Ax * tCubed) + (Bx * tSquared) + (Cx * t) + Tempx;
Movey:= (Ay * tCubed) + (By * tSquared) + (Cy * t) + Tempy;
MoveMouse(Round(Movex), Round(Movey));
Wait(Random(MaxWait - MinWait) + MinWait);
until(T >= 1)or
(Movex = Mousex)and(Movey = Mousey);
if (Movex <> Mousex) or (Movey <> Mousey) then
MoveMouseSmooth(Mousex, Mousey);
Wait(40 + Random(20));
Case click Of
1 : Clickhuman(Mousex, Mousey, true);
2 : Clickhuman(Mousex, Mousey, false);
End;
end;
Procedure Clicky;
begin
MouseC(X+random(40),Y+random(40),0);
wait(70+random(40));
MouseC(X,Y,1);
end;
begin
repeat
Clicky;
until(false)
end.
:eek:
forumfan
2006-07-01 19:39:04
Thanks for making this tutorial. It really helped me understand how scripts and scripting work. I'm looking forward to the next one.
I have another tutorial almost finished, but I am busy lately and havn't been able to put the final touches on it.
Glad you learned something from it. :)
Derricks
2006-07-08 19:34:35
Thanks for posting this, its helped
in_jeopardy
2006-09-03 20:05:40
Thank you! I made my first working script :biggrin:
{
In_Jeopardy's Autospammer!!
}
program Autotalker;
const
Spam='lololol';
procedure Autospam;
begin
wait(5000)
Writeln(Spam);
end;
begin
repeat
Autospam;
until(false)
end.
T3h cheat3r
2006-09-13 18:17:13
this helps me alot :)
lizhang
2006-09-14 05:45:50
scar reminds me of delphi but with delphi there was an interface and vars, tho the rest look the same. can't wait till the tut continues. I wanna learn how to script for runescape.
From: lizhang
scar reminds me of delphi but with delphi there was an interface and vars, tho the rest look the same. can't wait till the tut continues. I wanna learn how to script for runescape.
SCAR was made in Delphi ;)
bagofelix
2006-09-20 11:40:15
w00t! I worked! Thanks :-D Makes me wanna try my hand at somethin' more complex =)
invisible
2006-09-25 23:12:49
try this: (my first script)
program script;
procedure Hello;
begin
wait(70)
writeln('H');
Wait (70)
Writeln('He')
wait(70)
writeln('Hel');
wait(70)
writeln('Hell');
wait(70)
writeln('Hello');
wait(70)
writeln('Hello ');
wait(70)
writeln('Hello w');
wait(70)
writeln('Hello wo');
wait(70)
writeln('Hello wor');
wait(70)
writeln('Hello worl');
wait(70)
writeln('Hello world');
wait(70)
writeln('Hello world!');
end;
begin
repeat
hello;
until(false)
end.
gangstaaa
2006-09-26 12:50:42
you are my hero!!! (A) :P
very helpful guide! :D
Shaun.
2006-10-01 19:45:44
Very nice i enjoyed working through this.
wstephen4, lol you'll have to learn more, but you'll get there.
Invisable, use standards.
program script;
procedure Hello;
begin
wait(70)
writeln('H');
Wait (70)
Writeln('He')
wait(70)
writeln('Hel');
wait(70)
writeln('Hell');
wait(70)
writeln('Hello');
wait(70)
writeln('Hello ');
wait(70)
writeln('Hello w');
wait(70)
writeln('Hello wo');
wait(70)
writeln('Hello wor');
wait(70)
writeln('Hello worl');
wait(70)
writeln('Hello world');
wait(70)
writeln('Hello world!');
end;
begin
repeat
hello;
until(false)
end.
Also you might wana try somthing like this:
program script;
procedure Hello;
begin
wait(70)
cleardebug;
writeln('H');
Wait (70)
cleardebug;
Writeln('He')
wait(70)
cleardebug;
writeln('Hel');
wait(70)
cleardebug;
writeln('Hell');
wait(70)
cleardebug;
writeln('Hello');
wait(70)
cleardebug;
writeln('Hello ');
wait(70)
cleardebug;
writeln('Hello w');
wait(70)
cleardebug;
writeln('Hello wo');
wait(70)
cleardebug;
writeln('Hello wor');
wait(70)
cleardebug;
writeln('Hello worl');
wait(70)
cleardebug;
writeln('Hello world');
wait(70)
cleardebug;
writeln('Hello world!');
end;
begin
repeat
hello;
until(false)
end.
hakmaster
2006-10-03 03:12:37
I've just read the first tut;
Thanks… At first I thought it was WriteIn not Writeln…had to spend about 5 minutes on
that one :O
I've seen plenty of hello world scripts, but none that was as explained as yours :) Thanks
for letting me make a script that I actually understand fully :D
XX Replay XX
2006-10-03 06:22:03
this is one of the best tuts ve seen kinda confusing but i got it to work im gonna try to figure out how to make like auto fighters and stuff now tho.. if i can so i can apply as a srl member when i have a few more posts
Rs Hacker
2006-10-03 06:53:38
sweet i got it to work thanks man im gonna start making some scripts..this is awesome :)
someone
2006-10-03 07:30:36
ahh! i just figured it out, (im such a n00b at this lol)
i had this:
program Hello;
const
Message1='Hello world!;
there was my mistake..
it was meant to be like this=
program Hello;
const
Message1='Hello world';
thanks guys, great tutorial!
someone
2006-10-03 07:37:17
this is an excellent beginners tutorial, im a complete n00b with no programming skillz what so ever and even i can understand it!
much appreciated!
PS really looking forward to the next tut guide bebe!! i am very keen to learn more
someone
2006-10-03 11:24:55
its no autoer, but its a start s'pose
program tryit;
const
Message1='motherloverr';
procedure tryit;
begin
wait(1500)
writeln(message1);
end;
begin
repeat
tryit;
until(true)
end.
da_professa
2006-10-12 18:42:07
Thx great tutorial.. I have one question.. with srl whts the difference.. I mean if i tell it to include srl does that mean I can use procedures or functions from the the file I uploaded. Also whats the difference between procedure and function… ANd wht tutorial would you recomend next for me…. And also :P If any1 here wants to help me out can they lemme noe and I pm them my email addresse, because I tried making scar scripts long time ago but no one really helped. It was on the forum rs-resources. I also tried making scripts for aryan, and when I finally got started, aryan was dead…
And 1 last thing My past scripting experience is scripting in the program Turing (for school) I think turing is like java though, but you think it 'll be any help?.. And where can i get list of commands for scar…
munkey
2006-10-14 03:53:17
hey this was good
mohua
2006-10-17 10:25:34
This tutorial makes everything seem so easy…
av4td182
2006-10-17 11:42:47
Thanks for the tut, solid start and nothin too difficult. I wanna hit up a harder tut now…
Larrylucky
2006-11-12 20:38:14
Thanks for this great tutorial! Now I can't feel like less of a common leech and try to start contributing!
pistolpete
2006-11-13 15:47:37
twas really good
poiuyt
2006-11-21 14:12:26
Thanks for the great tut, it seems like java only quite a lot simpler :)
I'll try to make some scripts… lol
Mod Mopar
2006-11-24 11:01:11
Thanks, i just made my first script! But i have a question; what do i need to add when i want to add more messages? Just copy the procedures, but add Message2, etc. ?
example:
Hello world!
Are you oke?
I am fine..
and repeat it
Mod Mopar
2006-11-24 11:11:43
I think i have it.
program script;
const
Message1='Hello People!';
Message2='How are you people?';
procedure hello;
begin
wait(1000)
Writeln(Message1);
end;
procedure okey;
begin
wait(1000)
Writeln(Message2);
end;
begin
repeat
hello;
okey;
until(false)
end.
But, when i try to name my script My first script, there comes this error:
Line 1: [Error] (1:12): Semicolon (';') expected in script
What am i doing wrong?
Mod Mopar
2006-11-24 16:08:55
Are you going to make also a TUT on the other things that are in scar? example the variables , etc.
I love the way how you make TUTs!
Mod Mopar
2006-11-24 16:41:15
When you are making an auto-talker for example, and you want to preset messages for people to fill in. You set 5 preset messages, but the one who uses it ony needs 3 of them. If he doesn't fill in any text at the 2 last one, does there happen soething then? Or is there a special code for thos?
From: Mod Mopar
Are you going to make also a TUT on the other things that are in scar? example the variables , etc.
I love the way how you make TUTs!
Thank you.
From: Mod Mopar
When you are making an auto-talker for example, and you want to preset messages for people to fill in. You set 5 preset messages, but the one who uses it ony needs 3 of them. If he doesn't fill in any text at the 2 last one, does there happen soething then? Or is there a special code for thos?
Not quite sure what you are saying….
I think you mean this:
If you have a script that has 5 preset constants (const) for a string. If the user of the script only need to fill in 3 of those constants, what do you do?
Well it's simple, say you have the code like this:
program New;
const
text1='';
text2='';
text3='';
text4='';
text5='';
procedure Talk;
begin
writeln(Text1);
writeln(Text2);
writeln(Text3);
writeln(Text4);
writeln(Text5);
end;
begin
Talk;
end.
Your want it so that if any of the constants are not filled in, then the script will not outpt the result.
This is done here:
program New;
const
text1='A';
text2='B';
text3='C';
text4='';
text5='';
procedure Talk;
begin
if(not(text1=''))then
writeln(Text1);
if(not(text2=''))then
writeln(Text2);
if(not(text3=''))then
writeln(Text3);
if(not(text4=''))then
writeln(Text4);
if(not(text5=''))then
writeln(Text5);
end;
begin
Talk;
end.
This is using the "if","not" and "then" statements. :)
Basically it is looking to see if the constants are empty and if they arn't it will disply then, otherwise it won't.
shadowblade
2006-11-24 23:40:05
well my auto talker talk in the scar window not in the rs window is it suppose to do that?
Mod Mopar
2006-11-25 07:38:04
From: Bebemycat2
Thank you.
Not quite sure what you are saying….
I think you mean this:
If you have a script that has 5 preset constants (const) for a string. If the user of the script only need to fill in 3 of those constants, what do you do?
Well it's simple, say you have the code like this:
program New;
const
text1='';
text2='';
text3='';
text4='';
text5='';
procedure Talk;
begin
writeln(Text1);
writeln(Text2);
writeln(Text3);
writeln(Text4);
writeln(Text5);
end;
begin
Talk;
end.
Your want it so that if any of the constants are not filled in, then the script will not outpt the result.
This is done here:
program New;
const
text1='A';
text2='B';
text3='C';
text4='';
text5='';
procedure Talk;
begin
if(not(text1=''))then
writeln(Text1);
if(not(text2=''))then
writeln(Text2);
if(not(text3=''))then
writeln(Text3);
if(not(text4=''))then
writeln(Text4);
if(not(text5=''))then
writeln(Text5);
end;
begin
Talk;
end.
This is using the "if","not" and "then" statements. :)
Basically it is looking to see if the constants are empty and if they arn't it will disply then, otherwise it won't.
Thank you so much! The way you know where i am talking about, and how you explain in a example-script .. I love it :D Planning to make a TUT for intermediate's ? :)
P.S. When i wanna add the " wait(500) " , will i add it like this? :
if(not(Automessage1=''))then
wait(500)
Writeln(AutoMessage1);
Mod Mopar
2006-11-25 07:48:20
It worked :p :D
My progress report :
Successfully compiled
1
2
3
4
5
6
Successfully executed
This is my script now:
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
//////// ////////
//////// AutoTalker By Mod Mopar ////////
//////// ////////
//////// Version 1.1 ////////
//////// ////////
//////// First Script Ever! ////////
//////// ////////
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
program Autotalker;
{.include SRL/SRL.Scar}
const
AutoMessage1='1'; // Typ here what your character needs to say \\
AutoMessage2='2'; // If you don't need the message, don't typ anything in it. \\
AutoMessage3='3';
AutoMessage4='4';
AutoMessage5='5';
AutoMessage6='6';
AutoMessage7='';
AutoMessage8='';
AutoMessage9='';
AutoMessage10='';
AutoMessage11='';
AutoMessage12='';
AutoMessage13='';
AutoMessage14='';
AutoMessage15='';
procedure AutoTalking;
begin
if(not(Automessage1=''))then
wait(500)
TypeSend(AutoMessage1);
if(not(Automessage2=''))then
wait(500)
TypeSend(AutoMessage2);
if(not(Automessage3=''))then
wait(500)
TypeSend(AutoMessage3);
if(not(Automessage4=''))then
wait(500)
TypeSend(AutoMessage4);
if(not(Automessage5=''))then
wait(500)
TypeSend(AutoMessage5);
if(not(Automessage6=''))then
wait(500)
TypeSend(AutoMessage6);
if(not(Automessage7=''))then
wait(500)
TypeSend(AutoMessage7);
if(not(Automessage8=''))then
wait(500)
TypeSend(AutoMessage8);
if(not(Automessage9=''))then
wait(500)
TypeSend(AutoMessage9);
if(not(Automessage10=''))then
wait(500)
TypeSend(AutoMessage10);
if(not(Automessage11=''))then
wait(500)
TypeSend(AutoMessage11);
if(not(Automessage12=''))then
wait(500)
TypeSend(AutoMessage12);
if(not(Automessage13=''))then
wait(500)
TypeSend(AutoMessage13);
if(not(Automessage14=''))then
wait(500)
TypeSend(AutoMessage14);
if(not(Automessage15=''))then
wait(500)
TypeSend(AutoMessage15);
end;
begin
ActivateClient;
repeat
AutoTalking;
until(true)
end.
:) arr0w told me about the ActivateClient thingie :p
JukuG
2006-11-25 14:18:22
Nice script, I just started SCAR today, seems pretty cool.
Mod Mopar
2006-11-25 14:46:18
I have just learned how to work with the F-Keys, and figured out how to make mistakes (manualy set)
but I am not going to post that script here, because its not finished, some things works, other don't.
twobac
2006-12-19 04:41:56
Hi, just wanted to say that the tut is very informative and it has helped me with understanding the concepts. with this new found knowledge, i feel more comfortable to being able to write my own scripts.
Thanks again
:D
P1nky
2006-12-21 20:24:40
quite confuzing? i dont understand i want to learn but really hard to understand if you will like to teach me please talk on msn
[email]d3st1ny_of_pur3s@hotmail.com[/email]
New Found Glory
2006-12-21 23:06:56
I like the guide. Showed me what I should expect. Looks simpler now.
i lyk cheez1
2006-12-24 19:15:57
Thanks for this tutorial.
It is really good
jp-skate122
2006-12-25 23:00:14
very complete script nice. :D
Shinyrange
2006-12-26 20:08:32
NICE TUT!!!!
wow can u do more? plz?
wayne1210
2006-12-26 23:56:21
wow, i understanded it!! (the first one that i was able to follow)
well, wish i could learn more though, could u make another script in this format but with more stuff?
I_Am_A_Chip
2006-12-30 01:25:16
Man thanks!
Even I understood it!
elvew
2007-01-01 01:34:19
omg thx so much ^^
xMichael
2007-01-01 21:11:04
Does this auto type for runescape? If so,can someone help me because mine don't type anything in the rs window.
No, this types in the debug screen on SCAR.
To type somthing in the RS window, I recommend typesend (SRL procedure)
Example:
program Typer;
{.include SRL/SRL.scar} //Loads SRL so SCAR can use it
const
Message1 = 'Hello'; // the message you want to type
WaitTime = 1000; //the time in milliseconds to wait before typing again
// 1000 = 1 second
procedure TypeTheWords;
begin
wait(WaitTime);
TypeSend(Message1);
end;
begin
SetupSRL;
repeat
TypeTheWords;
until(false)
end.
xMichael
2007-01-01 22:04:19
From: Bebemycat2
No, this types in the debug screen on SCAR.
To type somthing in the RS window, I recommend typesend (SRL procedure)
Example:
program Typer;
{.include SRL/SRL.scar} //Loads SRL so SCAR can use it
const
Message1 = 'Hello'; // the message you want to type
WaitTime = 1000; //the time in milliseconds to wait before typing again
// 1000 = 1 second
procedure TypeTheWords;
begin
wait(WaitTime);
TypeSend(Message1);
end;
begin
SetupSRL;
repeat
TypeTheWords;
until(false)
end.
Alright thanks +rep. That's what it was doing on mine wasn't sure if I did something wrong or not.
Samittaja
2007-01-03 20:08:06
Very nice tutorial for a starter like me, thank you.
[S]paz
2007-01-05 19:47:47
nice tut bebe got me into the scrippting thing.. i started yesturday adn u made things a lot clearer with the help of other tuts .. nice one!!!
Zodiac
2007-01-06 07:09:50
bebe thanx i made my first script coz of your help!!!!
/////////////////////////////////////////////////////////////
// _______ _______ ______ _________ _______ _______ //
// / ___ )( ___ )( __ \ \__ __/( ___ )( ____ \ //
// \/ ) || ( ) || ( \ ) ) ( | ( ) || ( \/ //
// / )| | | || | ) | | | | (___) || | //
// / / | | | || | | | | | | ___ || | //
// / / | | | || | ) | | | | ( ) || | //
// / (_/\| (___) || (__/ )___) (___| ) ( || (____/\ //
// (_______/(_______)(______/ \_______/|/ \|(_______/ //
//Scripts Presents Autotalker PRO //
////////////////////////////////////////////////////////////
Program AutotalkerPro;
const
message1=('Plz Type Your Message Here')
procedure YourMessage;
begin
Wait(1000)
writeln:('Your message here') //This says what you Write On Line16
END;
begin
repeat
Yourmessage;
until(faslse)
end.
bell1313
2007-01-08 14:58:10
Man this is wkd! Im really enjoying scripting because of this. Simple but cool! :D
bell1313
2007-01-08 15:39:50
my first autotyper, didnt take long, the tutorial rocks! Thankyou, i feel a sense of achivemnt lol!
////////////////////////////////////////////////////////
////// //////
////// //////
////// My first Autotyper //////
////// //////
////// //////
//////////////////////////////////////////////////////
program New;
const
w1='Hello world';
w2='Hello my freinds';
w3='Hello EVERYONE!!!';
w4='I wish I new how to put this on runescape aswell';
procedure Hello;
begin
wait(1500)
writeln(w1);
wait(1500)
writeln(w2);
wait(1500)
writeln(w3);
wait(1500)
writeln(w4);
end;
begin
repeat
hello;
until(false)
end.
How do i put this on Runescape?
.Storm
2007-01-09 14:02:47
Thanks! I can't wait to get started scripting for real.
bell1313
2007-01-10 15:08:32
I agree storm, u got MSN or something, so we can tell each other about new script ideas. I still havent made anymore progress since my first script. Would be good to have someone to tlk about it. :D
thanks man that helped me a lot
Rambozin
2007-01-14 06:27:32
Cool! I just made my first script! :D
But how can i make it talk in RuneScape? I have dragged the haircross over the RuneScape window, but it still types the message in SCAR..
bell1313
2007-01-14 08:01:52
From: Rambozin
Cool! I just made my first script! :D
But how can i make it talk in RuneScape? I have dragged the haircross over the RuneScape window, but it still types the message in SCAR..
to put it on runescape u need to put in activateclient
eg:
program Autotalker;
{.include SRL/SRL.scar}
const
w1='';//type what ever you want it to say between the ''!!
w2='';//Same here! If you dont want it to say anything, dont put anything!
w3='';//Same here!
w4='';//same here
procedure Autotlk;
begin
wait(1500+random(100))
TypeSend(w1);
wait(1500+random(100))
TypeSend(w2);
wait(1500+random(100))
TypeSend(w3);
wait(1500+random(100))
TypeSend(w4);
end;
begin
ActivateClient; // HERE!!!
repeat
autotlk;
until(false)//change to true if you want it to say only one time.
end.
R a N c H
2007-01-15 02:46:54
Thank you!, that was great, haha now i can do it without having to reread your tut. thanks again.
Xfade
2007-01-15 14:04:13
wow i maked my first littl script 2 ^^ :D great tut :)
pwnaz0r
2007-01-17 23:01:18
thnx this was the second guide i read, going to more advanced guides now =p
j-dude
2007-01-19 15:09:08
Wow this tut is awesome! I really wanted to make myself an autominer and this really helped my basic knowledge of using scar tyvm :P
ankit
2007-01-23 18:55:12
Thanks man It helped me but im the biggest noob ever im too lazy to read which is my fault so too bad for me lol.. =(
Mamby
2007-01-23 19:31:58
Excellent Tutorial! I'm not much of a SCAR coder but i do know a few things.
Instead of using:
{This script does blah blah blah}
program yourscript;
procedure type;
You can use (* and *) to comment out things.
(* This Scirpt does blah blah and blah *)
program yourscript;
procedure type;
:D
Fetheroth
2007-01-23 19:33:58
Hey thnx this tut. really helped me out im trying to make a yew cutter/banker and i need some help and how to put it on RS. So if u have a chance plz help
{
~~~~~~~Fetheroth~~~~~~~~~
~~~~~~~~~~~§§~~~~~~~~~~~~
~~~~~~~~~~~§§~~~~~~~~~~~~
~~~~~~~~Presents~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~
~ Fetheroths Edgeville Yew Cutter!
~ Edited by me, Fetheroth.
~ Credits to all the SRL team for the wonderful SRL include.
~ Setup line 44,45 and 50-95
Instructions:
Setup Account
Stand in Edgeville bank in the southmost booth
Watch it once to make sure that all is well
Enjoy!
Update Info:
Alpha: Just cut and bank
Beta: Added Login
V 1.0: Added Antirandoms, Antiban, and fixed bugs
V 1.1: Took away WelcomeScreen include
V 1.2: Added Progress Report, changed some procedures
V 1.3: Fixed Login bug
V 1.4: Added Multiple players
}
program _Fetheroths_Edgeville_Yew_Cutter;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\WoodCutting.scar}
{.include SRL\SRL\extended\xAntiBan.scar}
var
Trips:integer;
///////Set Wieldaxe! Don't Touch Version #//////
const //
WieldAxe = 2; //1 for wielding, 2 for no //
Tripstodo = 25; // # of trips for each player //
VersionNumber = ' 1.4'; //Don't Touch! //
/////////////////////////////
Procedure DeclarePlayers; //
begin //
HowManyPlayers :=6; // Set Number of Players here. //
NumberOfPlayers(HowManyPlayers); // Leave alone //
CurrentPlayer:=0; // The blue # of the player wanted //
//
Players[0].Name :=''; // Your RS Name //
Players[0].Pass :=''; // Your RS Password //
Players[0].Nick :=''; // The first 3 lowercase letters of your name //
// eg. If your name is Zezima, put in ezi. //
Players[0].Loc :='Loc1'; //Not needed //
Players[0].Skill:=''; //Not needed //
Players[0].Active:=True; //Leave at true //
//
Players[1].Name :=''; //
Players[1].Pass :=''; //
Players[1].Nick :=''; //
Players[1].Loc :='Loc1'; //
Players[1].Skill:=''; //
Players[1].Active:=True; //
//
Players[2].Name :=''; //
Players[2].Pass :=''; //
Players[2].Nick :=''; //
Players[2].Loc :='Loc1'; //
Players[2].Skill:=''; //
Players[2].Active:=True; //
//
Players[3].Name :=''; //
Players[3].Pass :=''; //
Players[3].Nick :=''; //
Players[3].Loc :='Loc1'; //
Players[3].Skill:=''; //
Players[3].Active:=True; //
//
Players[4].Name :=''; //
Players[4].Pass :=''; //
Players[4].Nick :=''; //
Players[4].Loc :='Loc1'; //
Players[4].Skill:=''; //
Players[4].Active:=True; //
//
Players[5].Name :=''; //
Players[5].Pass :=''; //
Players[5].Nick :=''; //
Players[5].Loc :='Loc1'; //
Players[5].Skill:=''; //
Players[5].Active:=True; //
//
//
//
writeln(inttostr(HowManyPlayers)+'1'); //
///////////////////////////////////////////////////////////////////////////
end;
function IsWelcomeScreen: Boolean;
begin
if(GetColor(271, 292) = 8356779)and
(GetColor(499, 292) = 8356779)and
(GetColor(271, 381) = 8356779)then
Result := True;
end;
procedure WelcomeScreen;
begin
if(not(IsWelcomeScreen))then Exit;
MouseBox(275, 296, 495, 377, 1);
end;
//———————————————–//
Procedure Setup;
begin
SetupSRL;
ActivateClient;
ChatsOff;
If (LoggedIn) then
begin
HighestAngle;
MakeCompass('n');
end;
If (not(LoggedIn)) then
LoginPlayer;
WelcomeScreen;
HighestAngle;
MakeCompass('n');
end;
//———————————————–//
Procedure ProgReport;
begin
ClearReport;
Writeln('===============================')
Writeln('= You Are Using =');
Writeln('= =');
Writeln('= The Fetheroth Edgeville =');
Writeln('= =');
Writeln('= YEW CUTTER! =');
Writeln('= =');
WriteLn('= Version ' + VersionNumber + ' =');
Writeln('= =');
Writeln('= ' + inttostr(Trips) + ' Trips done =');
Writeln('= =');
Writeln('= Happy Cutting =');
Writeln('===============================');
end;
//———————————————–//
Procedure WalktoTrees;
begin
If (FindSymbol(x,y, 'rare trees')) then
begin
SetRun(true)
Mouse(x,y,1,1,true)
wait(10000)
end
If (not(FindSymbol(x,y, 'rare trees')))then
begin
SetRun(true)
Mouse(747,280,1,1,true)
wait(5000)
If (FindSymbol(x,y, 'rare trees')) then
begin
Mouse(x,y,1,1,true)
wait(10000)
end
end
end;
//———————————————–//
Procedure ChoptheTrees;
begin
repeat
if (FindMSColor(x,y,3438704))or
(FindMSColor(x,y,3887184))or
(FindMSColor(x,y,1925200))then
MMouse(x,y,1,1)
If IsUpText('Chop') then
Mouse(x,y,1,1,true)
wait(5000+Random(5000)+Random(5000)+Random(5000))
until (invfull = true)
if (invfull = true) then
Trips := Trips + 1;
end;
//———————————————–//
Procedure WalktoBank;
begin
If (FindSymbol(x,y,'4047310'))then
begin
MMouse(x,y,1,1)
Mouse(x,y,1,1,true)
end
If (not(FindSymbol(x,y,'4047310')))then
begin
Mouse(789,173,1,1,true)
wait(10000);
If (FindSymbol(x,y,'4047310'))then
begin
MMouse(x,y,1,1)
Mouse(x,y,1,1,true)
end
end
end;
//———————————————–//
Procedure BanktheLogs;
begin
OpenBank;
If WieldAxe = 1 then
begin
DepositAll;
end
If WieldAxe = 2 then
begin
Deposit(2,27,2);
end
end;
//———————————————–//
Procedure AntiRandomsandAntiBan;
begin
SRLRandomsReport;
FindNormalRandoms;
FindAxeHeadColor;
AttachHead;
DontBanMe(2);
If (FindEnt (3438704)) then
begin
Logout;
Wait(30000)
LoginPlayer;
end
end;
//———————————————–//
begin
DeclarePlayers;
Setup;
repeat
repeat
ProgReport;
WalktoTrees;
ChoptheTrees;
WalktoBank;
BanktheLogs;
AntiRandomsandAntiBan;
until (trips = Tripstodo);
If (trips = Tripstodo) then
Logout;
Nextplayer(true);
until (false);
end.
ty and plz help.
Mamby
2007-01-23 19:38:05
Kind of looks like Skys Shadow yew cutter to me.
{
~~~~~~~~~~Skys~~~~~~~~~~
~~~~~~~~~~~§§~~~~~~~~~~~
~~~~~~~~~Shadow~~~~~~~~~
~~~~~~~~~~~§§~~~~~~~~~~~
~~~~~~~~Presents~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~
~ The Skys Shadow Edgeville Yew Cutter!
~ Made by me, Skys Shadow.
~ Credits to all the SRL team for the wonderful SRL include.
~ Setup line 44,45 and 50-95
Instructions:
Setup Account
Stand in Edgeville bank in the southmost booth
Watch it once to make sure that all is well
Enjoy!
Update Info:
Alpha: Just cut and bank
Beta: Added Login
V 1.0: Added Antirandoms, Antiban, and fixed bugs
V 1.1: Took away WelcomeScreen include
V 1.2: Added Progress Report, changed some procedures
V 1.3: Fixed Login bug
V 1.4: Added Multiple players
You have to have SCAR 2.03 downloaded and the latest SRL release. Besure to drag the crosshair onto your runescape client. :cool:
madmoon
2007-01-24 02:31:02
Thanks for the tutorial, I had experience with SCAR long ago, but all my experience has been lost, I'm going to be using this tutorial along with some readme's to learn SRL and Scar ;)
julle13
2007-01-24 08:26:58
@ Fetheroth: Lol why u copy other peoples scripts? U only get bad rep. Instead of that, try learn to script by yourself.
uber poonage
2007-02-05 21:26:52
Good job guys never scripted before and it helped alot!
pwnaz0r
2007-02-05 23:18:26
uber poonage = rl friend :p
jczar
2007-02-18 15:31:04
OMFG THANKS MAN I READ ALL THE POST HERE AND I MADE THIS TO PISS PEOPLE OFF!!
{This Is A Script Created To Piss People Off, Just Drag The Cross Hair
to any typeable place, like an IM i use it for msn.}
//Noni//
program Autotalker;
{.include SRL/SRL.scar}
const
w1='This Is My AutoTalker';//Put your Text Between ''
w2='Created In Scar';//same here
w3='To Piss You Off';//same here
w4='For My Enjoyment';//same here
//No need to touch below unless changing timer.
procedure Noni;
begin
wait(70)
TypeSend(w1);
wait(70)
TypeSend(w2);
wait(70)
TypeSend(w3);
wait(70)
TypeSend(w4);
end;
begin
ActivateClient;
repeat
Noni;
until(False)
end.
jczar
2007-02-18 21:53:10
Ok guys Heres My New Autotalker Use it if you want.
{This is an autotalker created for the sole purpose of spamming,
autotalking, and what ever else you want to autotype.
Please Drag The Crosshair on the Client, Runescape, Msn, Aim, Yim, Chat.}
program Autotalker;
{.include SRL/SRL.scar}
const
////////////////////////////////////////////////////////////////////
//This is where you put your text, You put it Inbetween the ' ' //
////////////////////////////////////////////////////////////////////
Text1='Text Here';//Put your Text Between ''
Text2='Text Here';//If you would like to add another line Text Between' '
Text3='Text Here';//Same As Number 2
Text4='Text Here';//Again Same As Number 2
/////////////////////////////////////////////////
//No need to touch below unless changing timer.//
//Or How Long You Want The Script To Run //
/////////////////////////////////////////////////
procedure AutoTalk;
begin
wait(1000)//Change Timer If You Like
TypeSend(Text1);
wait(1000)//Change Timer If You Like
TypeSend(Text2);
wait(1000)//Change Timer If You Like
TypeSend(Text3);
wait(1000)//Change Timer If You Like
TypeSend(Text4);
end;
begin
ActivateClient;
repeat
AutoTalk;
until(True)// True To Type Text's Once, False For Infinte Times.
end.
chuck chuckie
2007-02-18 23:20:06
yay im going to finally learn SCAR! after using it for the last year or so. (not sure if that long) but i think its time i learn, and maybe help contribute to a script of my own, coz leeching scripts does get a bit stupid, to the extent that i do it lol!!
Wonder if a nice ADMIN will let me be a member, even if i fail at learning SCAR! gee i hope so.! :eek: :redface:
Thanks so much for this,
Ive been really into Counter-Strike scripting but have recently got bored
of it due to a lack of challenges and things you can do.
Ive decided to learn SCAR scripting as it seems it is always becoming
more challenging and you guys are always finding new and better ways to do things :D
I cant wait until I can script properly.
dadadoo2
2007-02-20 07:36:22
Ty, Now maybe i can start making scripts, after just testing other's for them :)
eddie
2007-02-20 08:52:49
Nice work :) This will really help get some new scripters in
yuriy253
2007-02-20 16:24:00
one hand O.O
Great tut! keep up the good work :) i read it about 4 days ago, thats near when i started scripting and i forgot to say good job and thanks for making it :)
thanks, but it kept failing to compile why? i tried wait (2000) instead of (1000) and it failed to compile?!?!? but thanks you greatly for posting and trying to help
HarryJames
2007-02-25 17:59:59
thnx for the tut, it was great, i have added some rep :p
yeahright.
2007-02-28 13:50:14
this helped alot.
im not real sure about all the functions but i got down the basics. lol
i made an autotalker though.
thanks
omfgSCAR
2007-03-06 21:48:26
um… how does this help on making great scripts like a auto wcer
runer
2007-03-07 10:23:12
Thanks for this tutorial, its a good start to making my own scripts :)
tgeo888
2007-03-08 23:03:39
Thank you :D
ammo2006
2007-03-10 00:48:06
TY so so much, this helped me out alot, im trying to get into scripting and i had absoluly no isea about it untill i read your guide, and i loved it :) ty ty ty
cheater4ever
2007-03-13 23:52:22
I Like this tutorial, very indept.
cheater4ever
2007-03-14 00:02:31
:D I Like this tutorial, right to the point.
horton kid
2007-03-15 22:29:27
program HelloWorld!;
const
text1=('H');
text2=('He');
text3=('Hel');
text4=('Hell');
text5=('Hello');
text6=('Hello ');
text7=('Hello w');
text8=('Hello wo');
text9=('Hello wor');
text10=('Hello worl');
text11=('Hello world');
text12=('Hello world!');
procedure Talk;
begin
Wait (100)
cleardebug;
if(not(text1=''))then
writeln(Text1);
Wait (100)
if(not(text2=''))then
writeln(Text2);
Wait (100)
if(not(text3=''))then
writeln(Text3);
Wait (100)
if(not(text4=''))then
writeln(Text4);
Wait (100)
if(not(text5=''))then
writeln(Text5);
Wait (100)
if(not(text6=''))then
writeln(Text6);
Wait (100)
if(not(text7=''))then
writeln(Text7);
Wait (100)
if(not(text8=''))then
writeln(Text8);
Wait (100)
if(not(text9=''))then
writeln(Text9)
Wait (100)
if(not(text10=''))then
writeln(Text10);
Wait (100)
if(not(text11=''))then
writeln(Text11);
Wait (100)
if(not(text12=''))then
writeln(Text12);
Wait (100)
end;
begin
repeat
Talk;
until(false)
end.
Failed when compiling
Line 1: [Error] (1:19): Syntax error in script C:\Program Files\SCAR 2.03\Scripts\Hello World! Auto Talk.scar
Line 1: [Error] (1:19): Semicolon (';') expected in script C:\Program Files\SCAR 2.03\Scripts\Hello World! Auto Talk.scarany ideas on how to fix this problem?
program autotalk;
const
text1=('H');
text2=('He');
text3=('Hel');
text4=('Hell');
text5=('Hello');
text6=('Hello ');
text7=('Hello w');
text8=('Hello wo');
text9=('Hello wor');
text10=('Hello worl');
text11=('Hello world');
text12=('Hello world!');
procedure Talk;
begin
Wait (100)
cleardebug;
if(not(text1=''))then
writeln(Text1);
Wait (100)
if(not(text2=''))then
writeln(Text2);
Wait (100)
if(not(text3=''))then
writeln(Text3);
Wait (100)
if(not(text4=''))then
writeln(Text4);
Wait (100)
if(not(text5=''))then
writeln(Text5);
Wait (100)
if(not(text6=''))then
writeln(Text6);
Wait (100)
if(not(text7=''))then
writeln(Text7);
Wait (100)
if(not(text8=''))then
writeln(Text8);
Wait (100)
if(not(text9=''))then
writeln(Text9);
Wait (100)
if(not(text10=''))then
writeln(Text10);
Wait (100)
if(not(text11=''))then
writeln(Text11);
Wait (100)
if(not(text12=''))then
writeln(Text12);
Wait (100)
end;
begin
repeat
Talk;
until(false)
end.
H
He
Hel
Hell
Hello
Hello
Hello w
Hello wo
Hello wor
Hello worl
Hello world
Hello world!
Successfully executedthis works though, any idears on why?
lordsaturn
2007-03-28 21:16:51
Nice, sure it will help a lot of scripting noobs out =]
Boreas
2007-03-28 22:19:12
program NoSpacesOrSymbolsHere;
Nice I did my first script :spot: :sasmokin:
Ashur2Good
2007-03-31 03:21:06
very nice tut for beginners :D not that i needed it..:rolleyes:
Aidan
2007-04-01 11:47:19
Very good 1 problem :( it uses endless loops :P
From: Aidan
Very good 1 problem :( it uses endless loops :P
Lol, oh well. It is a basic example of how to treat a working script.
I'm not exactly following the SRL
golden rules here :P
jarlaxe
2007-04-11 21:16:10
Well done.
Thankyou for that script! It was very well written.
But i have one point to make. ( even though i am a noob at scripting ) Perhaps you should have said that Writeln has an l ans not an i…
Again well done!!!!
:D
MylesMadness
2007-04-16 16:41:31
This is probably the easiest tut to understand i have read so far.
tupos
2007-04-19 23:32:17
havnt tryed it out yet.. but from what i see it looks very helpful…
thx for posting this up.. im gona try it out soon!!:spot:
PacManFtw
2007-04-21 06:08:51
YOU ARE GOD lol
-PacMan-
SpAnKyX34
2007-04-21 17:41:57
Thank you i plan on soon trying to write my own scripts once i get my labtop back from the shop = /
welcome
2007-04-22 20:04:54
Sweet, gives me a good start, I like it.
crazypants
2007-04-28 18:33:17
Something that I can understand, thanks :)
Seife
2007-04-30 02:08:31
I know some C++ this seems like a very easy thing to learn
look its based on that type of language.
one thing i dont get is, is this script suppose to be saying this in game? after i compile it and run it it just loops my string in the SCAR display window at the bottom. not in my RS window
:edit: ok i got this to work but i have to be on my rs page and then press ctrl+alt+r to start and then it will type in the game window
nice :) hopefully i will become decent scripter and release some public stuff
legendml
2007-05-02 19:56:25
i feel like an noob. I did everything and it doesn't work. I even copied it straight out of the thread and it still doesn't work.:confused: :confused: :confused:
error:
Failed when compiling
Line 6: [Error] (6:1): Semicolon (';') expected in script
code:
program script;
const
Message1= 'Hello world!'
procedure Hello;
begin
wait(1000)
Writeln(Message1);
end;
begin
repeat
hello;
until(false)
End.
plz help.:(
You need a semi-colon after the constant is defined:
program SilkBuyer;
const
Message1= 'Hello world!'; <-- There
procedure Hello;
begin
wait(1000)
Writeln(Message1);
end;
begin
repeat
hello;
until(false)
end.
legendml
2007-05-02 20:08:20
my bad
wait…
why did it say line 6 if it meant line 4?
It looks like it was fine with there not being a semi-colon on the end of the constant until the identifier "procedure" was called.
Slonskiy
2007-05-08 13:39:02
Excellent tutorial! Thank you very much! :D
Here's the script I made… :)
{
Smiley
by Slonskiy
}
program smiley;
procedure smile;
begin
wait(1000)
cleardebug;
Writeln(' | | ')
Writeln(' | | ')
Writeln('\_____/')
Writeln('S')
wait(200)
cleardebug;
Writeln(' | | ')
Writeln(' | | ')
Writeln('\_____/')
Writeln('Sm')
wait(200)
cleardebug;
Writeln(' | | ')
Writeln(' | | ')
Writeln('\_____/')
Writeln('Smi')
wait(200)
cleardebug;
Writeln(' | | ')
Writeln(' | | ')
Writeln('\_____/')
Writeln('Smil')
wait(200)
cleardebug;
Writeln(' | | ')
Writeln(' | | ')
Writeln('\_____/')
Writeln('Smile')
wait(200)
cleardebug;
Writeln(' | | ')
Writeln(' | | ')
Writeln('\_____/')
Writeln('Smiley')
wait(200)
cleardebug;
Writeln(' | | ')
Writeln(' | | ')
Writeln('\_____/')
Writeln('Smiley f')
wait(200)
cleardebug;
Writeln(' | | ')
Writeln(' | | ')
Writeln('\_____/')
Writeln('Smiley fa')
wait(200)
cleardebug;
Writeln(' | | ')
Writeln(' | | ')
Writeln('\_____/')
Writeln('Smiley fac')
wait(200)
cleardebug;
Writeln(' | | ')
Writeln(' | | ')
Writeln('\_____/')
Writeln('Smiley face')
wait(200)
cleardebug;
Writeln(' | | ')
Writeln(' | | ')
Writeln('\_____/')
Writeln('Smiley face!')
wait(3000)
end;
begin
repeat
smile;
until(false)
end.
Maxine
2007-05-08 14:12:18
well detailed, OK tut! :D
ill give it 8/10 for ultimate basics
4tt4k 0f u
2007-05-10 11:29:49
ty helped much
pk ownage94
2007-05-19 05:18:04
Thanks alot dudette (girl dude)
Really helped me a lot, gunno read some more tuts now :)
ahadvakil
2007-05-23 04:37:40
I know this might, actually it will sound stupid but is Scar case sensitive? For example, for the procedure Writeln, does it make a difference if you write writeln?
The devil
2007-05-26 01:12:35
Thnx 4 dat I made my first script with it.
skibby
2007-05-26 08:51:28
very good….nice job
gerauchert
2007-06-03 22:24:59
thanks so much
im on my way to becoming a scripter….slowly but surely :spot:
tozzi
2007-06-04 15:39:25
RELI CONFUSON :S…. would u be able to make me a script :D… for
www.s-racerz.com… its a simple text based game ;)
BobboHobbo
2007-06-06 07:52:52
Nice long guide, explained alot. Easy to read 10/10
Great Tutorial, I just learned how to do this in c++ too lol
crossback7
2007-06-15 11:59:48
Thanks a good bit. I'm hoping to make a bit more complicated auto talker/merchanter using this as a base.
stay bombin
2007-06-15 20:19:20
lol every script i looked at looks all confusing but after this i got a grasp on it…a little bit. thank you this was my first script ever and i totally understood it :)
hihi12340
2007-06-16 14:57:45
i am new here and i saw scar and used it while ago and never knew about scripting.
i have looked at countless scripts and it is just not falling into place.
i know about bolean and integers and procedures after reading countless guides but scripting seems way to complicated
i have no earlier excperience in programming and i would like to learn.
Scuzzinator
2007-06-17 20:50:02
Hey thanks for this tutorial, really great for the start-off with scripting for me.
However, I am having trouble when I'm trying to type a string using "SendKeys()" when the string incorporates an apostrophe.
for example: (it's not finished, but I need help before I go on :) )
{A simple program that creats the
traditional "Hello World" script in
another tab.
Made by Scuzzinator}
program TutScriptMaker;
procedure ProgName;
begin
MoveMouseSmoothEx(218,67,20,40,45,20,20);
Wait(1000+random(1000));
ClickMouse(218,67,True);
Wait(1000+random(500));
MoveMouseSmoothEx(94,93,20,40,45,20,20);
Wait(1000+random(500));
ClickMouse(94,93,True);
Wait(1000+random(500));
MoveMouseSmoothEx(114,114,20,40,45,20,20);
HoldMouse(114,114,True);
Wait(1000+random(500));
MoveMouseSmoothEx(143,114,20,40,45,20,20);
Wait(1000+random(500));
ReleaseMouse(143,114,True);
Wait(1000+random(500));
SendKeys('HelloWorld;'+chr(13));
Wait(1000+random(1000));
end;
procedure Consts;
begin
SendKeys(chr(13));
SendKeys('c');
Wait(250+random(100));
SendKeys('o');
Wait(250+random(100));
SendKeys('n');
Wait(250+random(100));
SendKeys('s');
Wait(250+random(100));
SendKeys('t');
Wait(500+random(100));
SendKeys(chr(13)+'M');
Wait(100+random(100));
SendKeys('e');
Wait(100+random(100));
SendKeys('ss');
Wait(100+random(100));
SendKeys('a');
Wait(100+random(100));
SendKeys('ge');
Wait(100+random(100));
SendKeys('1=');
Wait(100+random(100));
SendKeys(''Hello world!'')
end;
procedure Proc;
begin
end;
procedure MainLine;
begin
end;
begin
ProgName;
Consts;
Proc;
MainLine;
end.
Line 55 is where i'm having the problem. I want SendKeys(''Hello world!'') to have " 'Hello world!' " as a string using the outer two apostrophes as the string indicators. However, what it does is it uses all apostrophes as string indicators and leaves "Hello world!" not as a string so I get the errors:
Failed when compiling
Line 56: [Error] (56:10): String error in script
Line 56: [Error] (56:10): Syntax error in script
Is there a way to make it so that i have " 'Hello world!' " as a string in this script?
Shablo5
2007-06-19 08:23:46
Very VERY nice tutorial (Y)
Jacob
2007-06-20 22:52:07
i am having trouble
this is my script
( i typed it )
program New;
const
Message1='Hello people';
procedure hello;
begin
wait(1000)
WriteIn(Message1);
end;
begin
repeat
hello;
until(false)
end.
here is my debug box
Line 8: [Error] (8:1): Unknown identifier 'WriteIn' in script
Failed when compiling
Line 8: [Error] (8:1): Unknown identifier 'WriteIn' in script
Color Picked: 16447734 at (174, 450)
Failed when compiling
Line 9: [Error] (9:1): Unknown identifier 'WriteIn' in script
what is wrong with the write in?
malotthouse
2007-06-22 11:44:36
Thanks SOOO much for the awesome tut… im just starting learning this coding and this helped me understand it alot… thanks!
malotthouse
2007-06-22 11:45:39
Its writeLn not writeIn… so it would look like writeln(message1)
hmm i have never seen an ice cream truck covered in human skulls …
but anyway great tut! :D
ghostboy
2007-06-27 22:46:10
WOW thnx for tut bro it easy to understand thnx alot!
Nose Smasher
2007-08-08 23:44:05
Great TUT, nice and simple… I'm new to scripting so it helped me alot, made a few auto talkers on my own, but it still helped me understand some more stuff…
Trying to make an auto smelter atm… :p
joeman032000
2007-08-08 23:54:13
this is a lot better are more to the point then other ones. I would learn scar more indepth but im too add to stick to it
P1nky
2007-08-09 00:39:46
yeah well that auto talker doesnt work
Line 7: [Error] (14456:1): Semicolon (';') expected in script
I beg to differ, post the code you are using…
dauzi
2007-08-09 02:11:58
i tried the first one and it said this
Line 10: [Error] (10:1): Unknown identifier 'WriteIn' in script
i tried it on scar divi 3.06 and scar 2.03
any clue?
Macrosoft
2007-08-10 17:07:34
Yes great tut
perfect for complete beginners, though i am not one
skilld u
2007-08-12 22:19:39
i never could understand any thing in scar but this tut really helped me. thanks :P
muratpower
2007-08-19 15:35:38
thx!
now i can make my first script :)
again , thx
faster789
2007-08-22 10:41:28
best tut ever!~ get ready every1 cus im gona start scripting!
From: dauzi
i tried the first one and it said this
i tried it on scar divi 3.06 and scar 2.03
any clue?
u put write "In" when it shud be "ln" change your I into a l
I B X R
2007-08-22 12:49:04
Very good guide. Check out my auto talker. I used it also =P:
program Ties1stAutoTalker;
const
Selling1='glow2:wave2:Selling Lobsters 245 Ea~Pk3d';
procedure AutoTalk1;
begin
Wait(3500+random(500))
Writeln(Selling1);
end;
begin
repeat
AutoTalk1;
until(false)
end.
Yea, I don't care if anyone steals it, but what do you think for a first script. Ithink you should also include the ClearDebug in your thread. It's really useful =P
Darth Nihilus
2007-08-23 21:09:31
Hey thanks. Great Tut. It helped me alot.
Craig-
2007-09-30 14:36:39
HeHe i made a auto talker too :),
Gr8 guide,
Craig-
~ If any1 has a tut on how to make simple programs eg power miner (mine then drop ore) pls pm me ! ~
batal
2007-10-01 11:57:56
What program do you actually need in order to create a script? right now im learning to program with visual basics in college. will that help me?
li_HAM1
2007-10-02 00:48:17
kwlies makes sense easy to folo (h)
ILikeCake
2007-10-02 01:20:44
Simple and easy to read
Thank you
popmun
2007-10-02 13:07:05
whoa thanks bebe it realy helped for me but iil need more guide's to learn fully of scripting but thnx for the begginners guide :D
popmun.;)
kasi reddy
2007-10-02 18:52:18
From: Bebe
How to create your very first script by Bebemycat2
What is this going to cover?
This tutorial will take you step by step through the process of learning how to create your very first script. I will explain every step to you and also throw in some useful scripting tips along the way.
Tutorial:
Ok to begin I will ask you to open up SCAR (http://www.dylock.net/scar/). Now all you should see is this:
program New;
begin
end.
Well I want you to space all of those out a bit like this:
program New;
begin
end.
This will give us some space to code in. This is just the basic elements. program New; This is your programs name, Change "New" to whatever name you want your program to be. Always add a semicolon ( ; ) after the name to tell the script that that is the end of your scripts name. begin Tells the compiler that the script has just began, the coding of your script goes between "begin" and "end." end. Tells the compiler that you have ended the script, Make sure to always put a full stop. If you are making a procedure/function then you end it with a semicolon ( ; ), that will be explained later in the tutorial.
Next thing we are going to do is this:
program script;
procedure;
begin
end.
You will notice that I have added something called a Procedure. Well a "procedure" is basically this:
This procedure is where we will create the "body" or the majority of our script, from there is can be called upon later in the "main line" this I will explain more about later.
You also have to have a name for your procedure, so lets name it "Hello" and add a semi-colon after it so it looks like this:
program script;
procedure;
begin
end.
You name the procedure so that you can "call" upon it later in the script. You can name it anything but I am going to use "Hello" for this script.
Now what we are going to do now is add somthing called a "const" or a constant. This means that this "setting" will stay the same throughout the entire script.
To make a const you simply need to do this with your script:
program script;
const
procedure hello;
begin
end.
Now we have to make something a const, so let make it this:
program script;
const
Message1='Hello world!';
procedure hello;
begin
end.
Now you will notice that I have "Message1=" this is because with SCAR you have to always tell it what the "Message1" equals, that’s the reason for the "=". Now for the ' ' marks. These are what SCAR uses to identify when a String begins and when it ends. A string is a word / phrase. You will notice that it has a pinkish color to it, that is the "Syntax highlighting" that SCAR creates so that scripting can be much simpler.
Now that we have a "const" we need it to do something. You can find a basic list of procedures and functions in your SCAR folder called "procedureparams". It should look somthing like this:
and so on. Now scroll down the list until you come to a procedure called:
Now as I explained before a procedure is:
And a string is: A string is a word / phrase.
This procedure:
procedure Writeln(s: string);
just means that the "S" is a string, so therefore that is where we would enter what we wanted to type.
So I want you to make your Script look like this now:
program script;
const
Message1='Hello world!';
procedure hello;
begin
Writeln();
End.
You will notice that I have "Writeln();" after the begin, that is because you have to begin the script before you can do anything. :)
Also "Writeln" is a typing "command", it tells SCAR to type the keys that you specify. The Text will show up in shomthing called the "Debug" box that is this area of SCAR:

Now we will do this:
program script;
const
Message1='Hello world!';
procedure hello;
begin
Writeln(Message1);
End.
Now normally we would have to use the ' ' identifiers around "Message1" but in this case, since it is already in the "const" there is no need to and this will tell SCAR to type what you have filled out in the "const" "Message1".
Now we have to tell SCAR that we want to end the current procedure for this we will add "end;" like so:
program script;
const
Message1='Hello world!';
procedure hello;
begin
Writeln(Message1);
end;
end.
This is simply to tell SCAR to end the procedure, you will do the same with a function.
"End;" is different from "end." because "end." tells SCAR to end the whole script while "end;" tells it that you are done with a procedure/function.
Now we have to make SCAR actually type our "message" and use our procedure that we have just created. to do this we have to create the "main line" I mentioned before. This is done much like a procedure but has a few differences that I will explain.
So to start off your "main line" you will need to have a "begin" like so:
program script;
const
Message1='Hello world!';
procedure hello;
begin
Writeln(Message1);
end;
begin
end.
You will notice the begin is there, this is just telling SCAR this is where your main line shall begin. Simple, no? :)
So now we are going to make SCAR repeat something. The command to make SCAR repeat is "repeat". This will go after the being in the "main line". So you should now have code that looks like this:
program script;
const
Message1='Hello world!';
procedure Hello;
begin
Writeln(Message1);
end;
begin
repeat
end.
This basically telling SCAR to begin the "main line" and repeat something. Now we have to tell it what it needs to repeat. For this we will take our procedures name (Hello) and add it under our repeat command. So it should look like this:
program script;
const
Message1='Hello world!';
procedure Hello;
begin
Writeln(Message1);
end;
begin
repeat
hello;
end.
This will tell SCAR to repeat our "Hello procedure". But we have to tell it how long it has to repeat it for, so we will need the command "until". like so:
program script;
const
Message1='Hello world!';
procedure Hello;
begin
Writeln(Message1);
end;
begin
repeat
hello;
until(false)
end.
Now you will notice that I have "until(false)" when I only told you to add "until". Well until needs some sort of "time marker" to tell it when to repeat until, and "(false)" tells it to repeat forever, this will make it an infinite "loop". With "until(false)" this script will repeat our procedure "Hello" forever, never stopping until the user stop SCAR manually.
Now hit: "script" —–> "Compile" and you should get this message in the "debug" box that says "Successfully compiled" this means that you coded the script right. Now to test it.
With your "crosshair"(
) select your debug box and hit "run script". You will notice that it keeps typing it over and over really fast. So now we need to slow it down a bit. for this we will use a procedure called "wait". Wait tells the script to wait a designated amount of miliseconds before it's next action. To add wait what we do is this:
program script;
const
Message1='Hello world!';
procedure Hello;
begin
wait(1000)
Writeln(Message1);
end;
begin
repeat
hello;
until(false)
end.
You will notice the "1000)" this is the amount of milliseconds you want to wait, now if you paid attention in math(s) (Depending on if your American or not you call it math or maths) you will know that 1000 milliseconds is 1 second. So we are basically saying that when SCAR reads the "main line" and does our procedure "Hello" that it should wait 1 second before it repeats. Simple, no?
Now run it.
You will see that it types at a much more controlled rate now.
CONGRATULATIONS! You have just made your very first script!
The other method…..
Ok, so you know how I had:
program script;
const
Message1='Hello world!';
procedure Hello;
begin
wait(1000)
Writeln(Message1);
end;
begin
repeat
hello;
until(false)
end.
as our final code to creating a "Hello world"/First script, well I would like to show you another method to do this, that is just as effective.
We will take our above code and change it to this:
program script;
procedure Hello;
begin
wait(1000)
Writeln('Hello world!');
end;
begin
repeat
hello;
until(false)
end.
You will notice that I have removed the:
const
Message1='Hello world!';
and changed:
Writeln(Message1);
to
Writeln('Hello world!');
Now as I mentioned above, the apostrophes mark the begining and end of "strings". But just to recap:
So basicly we have removed our "const" or constant and made "Writeln" directly type our message.
It is a simple changes and makes no difference to the performance of the script, it truly depends on your style of scripting.
:f: :f: :f: :f: :f:
kasi reddy
2007-10-02 18:55:30
i need help i cant download any other SCARs so i downloaded scar divi 3.12
but i cant find any scripts 4 scar divi 3.12 so i dicided to write 1 i need some help on writing a rune ess miner & banker script any tips and can u help???:bart: :bart: :redface: :redface: :(h): :)
mortenlt
2007-10-14 18:41:40
Hey, I just wanted to say that the tut is very informative and it has helped me with understanding the concepts. With this new found knowledge, i feel more ready to being able to write my own scripts :P
slackjaw7
2007-10-15 09:53:55
This worked great. Now i know a very little about scripting. however, every visit to SRL gets me closer and closer to my own script. Thanks Bebe for the awesome tut. Now on to the next lesson. BTW, I was a little confused on the Writln, I kept putting an i in there and it gave an error.
Slackjaw
kioti123
2007-10-23 14:42:21
Woo-hoo, I think this TuT will lead me to my first script =P
Thanks!
sinocopa 1
2007-11-26 19:25:27
SWEET ty vm! :D :D :D :D
dr.quantumphysics
2007-11-29 20:15:42
Now that we have a "const" we need it to do something. You can find a basic list of procedures and functions in your SCAR folder called "procedureparams". It should look somthing like this:
i cant find that folder
xinez
2007-11-30 02:35:54
nice guide!!! this will help a lot of people out
supershort3
2007-12-04 06:06:04
nice
RsWasteHack
2007-12-09 10:41:14
Helped absolutely loads, Thanks!
westkevin12
2007-12-12 22:35:51
wow this is great thank you do you know any1 who can teach me scripting further i want to make an autobot for runescape and you taught me how to talk now i just gotta learn how to walk ;…lol
westkevin12
2007-12-12 22:37:57
wow this is great thank you do you know any1 who can teach me scripting further i want to make an autobot for runescape and you taught me how to talk now i just gotta learn how to walk ;…lol also to contact me email me at [email]westkevin12@hotmail.com[/email];
11sbasti
2008-01-15 20:27:33
:eek: omg Bebe thank you so much when i first started SCAR (about 2 mins ago) i didnt know ANYTHING you helped me out a lot and i can create a monologue XD well i hope that you make more tutorials…or lessons which will aid me and many others in creating more advanced scripts :)
_________________________
procedure thx;
begin
wait(1000)
Writeln('thank you so much');
wait(1000)
Writeln('you are the best');
end;
begin
repeat
thx;
until(false)
end.
_________________________
hehe -11sbasti- :D
Th3Nightmare
2008-03-30 15:29:40
Very good Tutorial. I think I've seen one similar to this, but this one is better described. :)
Hypnose
2008-03-30 16:53:19
Nice tut I never scripted of my life this will be my first ever script :)
Hypnose
2008-03-30 18:12:51
I gave it a try and it says WriteIn thing is not correct.
program script;
const
Message1='Hypnose first script';
procedure hello;
begin
wait(1000)
WriteIn(Message1);
end;
begin
repeat
hello;
until(false)
end.
ShowerThoughts
2008-03-30 18:18:16
From: Hypnose
I gave it a try and it says WriteIn thing is not correct.
program script;
const
Message1='Hypnose first script';
procedure hello;
begin
wait(1000)
WriteIn(Message1);
end;
begin
repeat
hello;
until(false)
end.
You Have
WriteIn
must be
WriteLn
You Have a I you need a L from LiNe
abizon
2008-03-31 04:22:29
thank you its very helpful
killerxc123
2008-04-05 19:36:51
Nice!
EdsuBR
2008-05-31 14:55:30
Nice tutorial, i hope i don't forget what i learned here! :P
review89
2008-06-04 00:04:04
very nice guide, i will try but i am not good on this things lol tyvm for the guide that is why i am learning :D
insertnamehere
2008-06-27 15:09:30
this helped me out a lot, thanks
Lycan Fenrir
2008-06-30 11:45:48
Brilliant tutorial. Ill try make a few basic scripts with this.
livewrong811
2008-08-03 09:18:37
Another super tutorial by Bebe! I understand a lot more now…
Pyjama_Llama
2008-08-19 19:54:28
i followed this script and it was very helpful thank you for it.
and also you explained every step was explained very well
himpula
2008-11-16 07:50:07
yay! i made my first working script! thanks!:D
RuneItBack2Front
2008-11-24 14:51:56
Hey, thanks a lot. This is my first working Scar script that I wrote … well I didn't actually write it now did I … typed it in myself anyway … Thanks
Demon_STH
2009-02-02 18:04:47
thank you for a good tut =)