Awkwardsaw
07-05-2009, 04:17 AM
this is my second tut, and this time i will be teaching you how to set up the base of the script :D. lets get goin!
Set up SRL
the first thing you need to do is set up srl. i saved this as my defualt script for scar:
program New;
{.include SRL/SRL.scar}
begin
setupsrl;
end.
how you save it as default is go to file > save as default, and that will load every time you open a new tab or open scar.
doing this saves a lot of time, and very usefull if you cant remember what to type in to include srl: {.include SRL/SRL.scar} (like me :p)
Coming up with the plan
for this i will use a lumby flax spinner as an example. what you do is you make a few little comment brackets so you can write down what you want to do with the script.
{ bank
go to room
go to bank
spin
progress report
}
program LumbyFlaxer;
{.include SRL/SRL.scar}
begin
setupsrl;
end.
this is a reminder of every thing that i want my script to do, which is bank, get to the flax room, spin, get to bank, and bank again. along with the basics of anti ban, anti random, and a progress report.
next, we will go even more precise, coming up with ways to do what you want to do, like so:
{ bank
-need to bank
-find bank
-find banker
go to room
-go to stairs
-go to second floor
-check door
go to bank
- get to stairs
- get to top floor
spin
- find wheel
- check flax
- check bow strings
- wait while spinning
progress report
- time running
- bow strings strung
- flax to go
- exp gained
- money gained
- crafting lvl
- exp to go till next lvl
}
program LumbyFlaxer;
{.include SRL/SRL.scar}
begin
setupsrl;
end.
now that we know exactly what we want, lets get to the procedures
Making the base procedures
before we get to the meat of the procedures, lets get the base ones down first. what i mean is: declare players, set up smart, set up player, next player, and and the anti ban/ randoms.
{ bank
-need to bank
-find bank
-find banker
go to room
-go to stairs
-go to second floor
-check door
go to bank
- get to stairs
- get to top floor
spin
- find wheel
- check flax
- check bow strings
- wait while spinning
anti ban
anti random
progress report
- time running
- bow strings strung
- flax to go
- exp gained
- money gained
- crafting lvl
- exp to go till next lvl
}
program LumbyFlaxer;
{.include SRL/SRL.scar}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
{Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;}
end;
procedure AntiRandom;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
end;
Procedure AkwardAntiBan;
begin
if not LoggedIn then Loginplayer;
case Random(11) of
0: HoverSkill('Random', false);
1: begin
HoverSkill('Woodcutting',false);
wait(2500+Random(500));
GameTab(4);
end;
2: PickUpMouse;
3: begin
MakeCompass('E');
wait(10+random(5));
MakeCompass('N');
end;
4: begin
setangle(false);
wait(10+random(10));
setangle(true);
end;
5: SleepAndMoveMouse(600000+random(400000));
6: RandomRClick;
7: RandomMovement;
end;
end;
procedure SetUpPlayer;
begin
if not loggedin then loginplayer;
SetAutoingDefaults;
setangle(true);
setrun(true);
end;
procedure NextPlayerP;
begin
Players[CurrentPlayer].Active := False;
LogOut;
NextPlayer(Players[CurrentPlayer].Active);
setupplayer;
end;
procedure MySmartSetup;
begin
writeln('setting up smart');
SMARTSetupEx(100, True, True, False);
SetTargetDC(SMARTGetDC);
end;
begin
setupsrl; //
declareplayers; // this is the script set up
mysmartsetup; //
setupplayer; //
begin //
// this is the part where the script does its thing
end; //
end.
note: antiban and randoms are just an example, ;)
so far, i have SMART load up, log in the player and set him up. lets get teh banking!
Procedures
now, i wont make the actual procedures, since its only an example. they will only be getting the general point across
function needtobank: boolean;
begin
if invfull then result:= true;
end;
function findbank: boolean;
begin
if findsymbol(x, y, 'bank') then result:= true;
end;
function findbanker: boolean;
begin
end;
procedure bank;
begin
end;
keep doing this for the rest of the script, and then get to making the procedures work
theres nothing more to say about this subject, so i'll end the tut here ;)
i wish you good luck with script making, and go ahead and ask questions in this thread, pm me, or contact me on msn: akwardsaw@hotmail.com
also, ideas for the tut would be awesome
~ akwardsaw
Set up SRL
the first thing you need to do is set up srl. i saved this as my defualt script for scar:
program New;
{.include SRL/SRL.scar}
begin
setupsrl;
end.
how you save it as default is go to file > save as default, and that will load every time you open a new tab or open scar.
doing this saves a lot of time, and very usefull if you cant remember what to type in to include srl: {.include SRL/SRL.scar} (like me :p)
Coming up with the plan
for this i will use a lumby flax spinner as an example. what you do is you make a few little comment brackets so you can write down what you want to do with the script.
{ bank
go to room
go to bank
spin
progress report
}
program LumbyFlaxer;
{.include SRL/SRL.scar}
begin
setupsrl;
end.
this is a reminder of every thing that i want my script to do, which is bank, get to the flax room, spin, get to bank, and bank again. along with the basics of anti ban, anti random, and a progress report.
next, we will go even more precise, coming up with ways to do what you want to do, like so:
{ bank
-need to bank
-find bank
-find banker
go to room
-go to stairs
-go to second floor
-check door
go to bank
- get to stairs
- get to top floor
spin
- find wheel
- check flax
- check bow strings
- wait while spinning
progress report
- time running
- bow strings strung
- flax to go
- exp gained
- money gained
- crafting lvl
- exp to go till next lvl
}
program LumbyFlaxer;
{.include SRL/SRL.scar}
begin
setupsrl;
end.
now that we know exactly what we want, lets get to the procedures
Making the base procedures
before we get to the meat of the procedures, lets get the base ones down first. what i mean is: declare players, set up smart, set up player, next player, and and the anti ban/ randoms.
{ bank
-need to bank
-find bank
-find banker
go to room
-go to stairs
-go to second floor
-check door
go to bank
- get to stairs
- get to top floor
spin
- find wheel
- check flax
- check bow strings
- wait while spinning
anti ban
anti random
progress report
- time running
- bow strings strung
- flax to go
- exp gained
- money gained
- crafting lvl
- exp to go till next lvl
}
program LumbyFlaxer;
{.include SRL/SRL.scar}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
{Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;}
end;
procedure AntiRandom;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
end;
Procedure AkwardAntiBan;
begin
if not LoggedIn then Loginplayer;
case Random(11) of
0: HoverSkill('Random', false);
1: begin
HoverSkill('Woodcutting',false);
wait(2500+Random(500));
GameTab(4);
end;
2: PickUpMouse;
3: begin
MakeCompass('E');
wait(10+random(5));
MakeCompass('N');
end;
4: begin
setangle(false);
wait(10+random(10));
setangle(true);
end;
5: SleepAndMoveMouse(600000+random(400000));
6: RandomRClick;
7: RandomMovement;
end;
end;
procedure SetUpPlayer;
begin
if not loggedin then loginplayer;
SetAutoingDefaults;
setangle(true);
setrun(true);
end;
procedure NextPlayerP;
begin
Players[CurrentPlayer].Active := False;
LogOut;
NextPlayer(Players[CurrentPlayer].Active);
setupplayer;
end;
procedure MySmartSetup;
begin
writeln('setting up smart');
SMARTSetupEx(100, True, True, False);
SetTargetDC(SMARTGetDC);
end;
begin
setupsrl; //
declareplayers; // this is the script set up
mysmartsetup; //
setupplayer; //
begin //
// this is the part where the script does its thing
end; //
end.
note: antiban and randoms are just an example, ;)
so far, i have SMART load up, log in the player and set him up. lets get teh banking!
Procedures
now, i wont make the actual procedures, since its only an example. they will only be getting the general point across
function needtobank: boolean;
begin
if invfull then result:= true;
end;
function findbank: boolean;
begin
if findsymbol(x, y, 'bank') then result:= true;
end;
function findbanker: boolean;
begin
end;
procedure bank;
begin
end;
keep doing this for the rest of the script, and then get to making the procedures work
theres nothing more to say about this subject, so i'll end the tut here ;)
i wish you good luck with script making, and go ahead and ask questions in this thread, pm me, or contact me on msn: akwardsaw@hotmail.com
also, ideas for the tut would be awesome
~ akwardsaw