0wn 4 skill
2008-08-14 15:06:40
Ever wanted to make a easy and nearly flawless walker? Well, this is where you will find out how.
I have written this guide assuming that you have a basic knowledge of Scar, Srl and Reflection. I have made it fairly noob friendly.
What your going to need:
- Srl Rev#20
- Reflection Rev#72
- Summilions PathMaker - which can be found > here <
Firstly you are going to need to include reflection into your script. You do this by writing below the program name. If you have made scripts previously using the include SRL then you will be very familiar with this process.
Once you have done that it should look like this:
Program SimpleReflectionWalkerEx; // The Name of your program
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
// The above shows how i included reflection
Begin// This is your Mainloop
SetupSRL;// This Sets up the SRL include in your script.
end.And without the notes it looks like this:
program SimpleReflectionWalkerEx;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
Begin
SetupSRL;
end.Okay, now that you have included it you can start using all those juicy procedures and functions that have been made by the creators of Reflection.
Now then, for reflection to work you need to use a procedure to open S.M.A.R.T . Reflection works by finding variables within smart and using them to do things.
Now to open smart you need to use a procedure which looks like this:
Procedure SetupSmart;
Begin
SmartSetup('world84', True, True, False);//Change the number in 'world84'
Wait(1000); //to whichever world you want.
SetTargetDC(SmartGetDC);
end;So now your script should look something like this:
program SimpleReflectionWalkerEx;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
Procedure SetupSmart;
Begin
SmartSetup('world167', True, True, False);
Wait(1000);
SetTargetDC(SmartGetDC);
end;
Begin
SetupSRL;
SetupSmart; // Calls the SetupSmart procedure.
end.Remember, if you want to call a procedure in the main loop you cant call it after the mainloop. The mainloop always stays at the end.
Next you will want to declare your player.
The easiest way to do this is by adding this. (Just copy and paste)
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :=''; //Your Username
Players[0].Pass :=''; // Your password
Players[0].Nick :=''; //3-4 letters of your username.
Players[0].Active:=True;
end;So now your script is starting to get bigger! It doesnt get much harder than this.
program SimpleReflectionWalkerEx;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
Procedure SetupSmart;
Begin
SmartSetup('world167', True, True, False);
Wait(1000);
SetTargetDC(SmartGetDC);
end;
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
Begin
SetupSRL;
SetupSmart;
DeclarePlayers;//Calls the DeclarePlayers procedure
LoginPlayer;// This will log your player in.
end.Now, open up your PathMaker - Reflection tool. (Link at top) Then make a Path, if you get any orange paths, it wont work. You should end up with something like this:
function LoadPath: TPointArray;
begin
SetLength(Result, 12);
Result[0] := Point(3213, 3428);
Result[1] := Point(3200, 3428);
Result[2] := Point(3189, 3429);
Result[3] := Point(3175, 3427);
Result[4] := Point(3164, 3422);
Result[5] := Point(3153, 3416);
Result[6] := Point(3139, 3416);
Result[7] := Point(3126, 3414);
Result[8] := Point(3116, 3419);
Result[9] := Point(3105, 3420);
Result[10] := Point(3090, 3420);
Result[11] := Point(3082, 3422);
end; Mine walks from Varrock centre to Barbarian Village.
Just copy this into your script. As long as its above the mainloop it will be fine. You are almost finished your simple walker.
So now your script will look like this:
program SimpleReflectionWalkerEx;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
Procedure SetupSmart;
Begin
SmartSetup('world167', True, True, False);
Wait(1000);
SetTargetDC(SmartGetDC);
end;
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
function LoadPath: TPointArray;
begin
SetLength(Result, 12);
Result[0] := Point(3213, 3428);
Result[1] := Point(3200, 3428);
Result[2] := Point(3189, 3429);
Result[3] := Point(3175, 3427);
Result[4] := Point(3164, 3422);
Result[5] := Point(3153, 3416);
Result[6] := Point(3139, 3416);
Result[7] := Point(3126, 3414);
Result[8] := Point(3116, 3419);
Result[9] := Point(3105, 3420);
Result[10] := Point(3090, 3420);
Result[11] := Point(3082, 3422);
end;
Begin
SetupSRL;
SetupSmart;
DeclarePlayers;//Calls the DeclarePlayers procedure
LoginPlayer;// This will log your player in.
end.Now, this is complicated bit (Due to Update of Rev and deletion of WalkPath)
Procedure WalkThePath;
Var
I: Integer;
Path: TPointArray;
Begin
Path := LoadPath;
for i := 0 to High(Path) do
Begin
WalkToTile(Path[i], 3, 0);
end;
Wait(500+Random(300));
end;This walks the path in the array which you made in LoadPath procedure.
Path:= LoadPath;Declares LoadPath as a TPointArray. for i := 0 to High(Path) do
Begin
WalkToTile(Path[i], 3, 0);
end;
Wait(500+Random(300));Repeats until all the arrays are used.
Now your script should be complete and look something like this:
program SimpleReflectionWalkerEx;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}
Procedure SetupSmart;
Begin
SmartSetup('world167', True, True, False);
Wait(1000);
SetTargetDC(SmartGetDC);
end;
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
function LoadPath: TPointArray;
begin
SetLength(Result, 12);
Result[0] := Point(3213, 3428);
Result[1] := Point(3200, 3428);
Result[2] := Point(3189, 3429);
Result[3] := Point(3175, 3427);
Result[4] := Point(3164, 3422);
Result[5] := Point(3153, 3416);
Result[6] := Point(3139, 3416);
Result[7] := Point(3126, 3414);
Result[8] := Point(3116, 3419);
Result[9] := Point(3105, 3420);
Result[10] := Point(3090, 3420);
Result[11] := Point(3082, 3422);
end;
Procedure WalkThePath;
Var
I: Integer;
Path: TPointArray;
Begin
Path := LoadPath;
for i := 0 to High(Path) do
Begin
WalkToTile(Path[i], 3, 0);
end;
Wait(500+Random(300));
end;
Begin
SetupSRL;
SetupSmart;
DeclarePlayers;//Calls the DeclarePlayers procedure
LoginPlayer;// This will log your player in.
WalkThePath;
Logout; //This will log your player out!
end.The End.
Any questions? Add me on msn [email]Bonf@live.co.uk[/email]
Enjoy!! :D