PDA

View Full Version : The Beginners HandBook



Waddo
07-11-2008, 10:34 AM
How To
Start Scripting
By Waddo


[B]
In this Section you are going to learn how to script

Remember These tips.

Search is you friend.
Spammers dont get as much help.
People will help if you ask.
Reading scripts is a great way to learn.
Join the SRL IRC (http://www.hy71194.mgatesphoto.com/srlchat/) but don't rely on others try it yourself think about it hard and then ask, sometimes leaving your computer and going outside for 5 minutes can often help you.



1. Read through this tut and complete the exercises at the end.Scar Basics. (http://www.villavu.com/forum/showthread.php?t=32254?t=34963)

2. Using a for loop and a case statement create a script that will writeln the sentences hello1 hello2 hello3 hello4 hello5 in order using 2 variabes.
Answer below.



[B]
In this Section you are going to learn more

1. I suggest reading through some other peoples scripts and trying to figure out how they work

2. Tutorials
Yes more, by the end of this you should know RadialWalk and DTM's.

2a. Dtm's Read this giude then make and post a dtm for a ruby diamond sapphire or emerald and post it, Dont foget to free your Dtm. TUT (http://www.villavu.com/forum/showthread.php?t=32573?p=429958#post429958)
Answer below.

2b. RadialWalk learn this this is very useful for walking around. TUT (http://www.villavu.com/forum/showthread.php?t=11584)

3. Now open SCAR and click Tools-->Explore Files-->Includes-->SRL-->SRL-->Core

now open a few of them and look through them and read tutorials about them (search is you friend)

also look though the skills folder

you don't need to memorise all this as remember you can always reopen them if you forget.

[BREAK=Your ready]
Now that you have learnt all this you can go and make you own script
after you have made one come back and learn how to add multi player.
Have fun.

Multiplayer tut here.TUT (http://www.villavu.com/forum/showthread.php?t=31324)

[BREAK=Answers]

Exercise 1
Program new;
Var
I:integer;
Word:string;
Begin
For i:=0 to 5 do
begin
case i of
0:Word:=hello1;
1:Word:=hello2;
2:Word:=hello3;
3:Word:=hello4;
4:Word:=hello5;
end;
Writeln(word);
end;
end.


Exercise 2

There is no real answer for this as everyones DTM will be different.

Just make the DTM the same way but set the PARENT point to around 20.

But it should look something like this.

program New;
Var
GemDTM,x,y : Integer;
Begin
GemDTM :=DTMFromString('78DA63BCC8C0C0B08A91011934097331F C07D' +
'220D1FF40C0781EC85888AA06220B2381F47520B188809A7B 4062' +
'2501355780C416026A0E0389D5F8D500005F980E93');
If FindDTM(GemDTM ,x,y,MIX1,MIY1,MIX2,MIY2) then
Mouse(x,y,0,0,True);
FreeDTM(GemDTM);
end.

Rubix
07-11-2008, 04:35 PM
had a little trouble with the first excersise, maybe make it a little more clear, that every case needs a end

Waddo
07-11-2008, 04:42 PM
yep i will add that to my beginners tut ad make it more clear.

Waddo
06-11-2009, 08:03 AM
A nessecary bump

Home
06-11-2009, 09:26 PM
You forgot FreeYourDTM:



program New;
Var
GemDTM,x,y : Integer;
Begin
GemDTM :=DTMFromString('78DA63BCC8C0C0B08A91011934097331F C07D' +
'220D1FF40C0781EC85888AA06220B2381F47520B188809A7B 4062' +
'2501355780C416026A0E0389D5F8D500005F980E93');
If FindDTM(GemDTM ,x,y,MIX1,MIY1,MIX2,MIY2) then
Mouse(x,y,0,0,True);
FreeDTM(GemDTM);
end.


~Home :)