PDA

View Full Version : Ultimate Noob Tut



insanomano
05-19-2008, 07:32 PM
Welcome to Insanomanos
tutorial for beginners. I am going to attempt to teach you guys all the
things I had problems with that I found most tutorials just dont
explain. HOW ARE WE NOOBS SUPPOSED TO KNOW ANYTHING !!! :D
including things like
*Procedures
*DeclarePlayers
*How to Open/Withdraw/Deposit/ and close banks
*How to make your screen different angles
*Easy way to insert S.M.A.R.T into any script

Plz enjoy and post any positive or negative comments !! :)

------------------------------Procedures------------------------------


*Procedures help keep scripts neater and are far better to use
then nothing.
A procedure is almost a small script that you place in your large
script. they do not do anything until you
write out there name into your
MainLoop which will be on the bottom of your script.

Lets get started.
program New;
begin
end.

Now change the program name to whatever you want, but you
cannot have spaces.(this is why we capitalize the
first letter of every word).
program MyFirstProcedure;
{.include SRL/SRL.scar} //you always need to include this because we
are using SRL functions.
begin
end.

The only way your gonna learn is by doing this with
me so startup SCAR and follow along. Now we are going to
make our first procedure that moves our mouse around the screen
and writes what it is doing.

We are going to use the Wait,MMouse,Mouse, and WriteLn functions.
program MyFirstProcedure;
{.include SRL/SRL.scar}

Procedure MovingWritingAndWaiting;
begin
wait(1000); //This is a wait time.
WriteLn('Now left clicking mouse'); //This gets written in the DebugBox.
Mouse(432, 348,1,1,false); //I put in random coords on my screen and false makes it right click.
wait(500);
WriteLn('Now Moving Mouse');
MMouse(563, 207,1,1);
wait(500);
WriteLn('Now right clicking mouse');
Mouse(374, 306,1,1,true);
wait(1000);
WriteLn('Mouse succesfully moved and clicked around the screen');
end;

begin
SetupSRL; // Always have this.
MovingWritingAndWaiting; //See this is where we can just put in the procedure name instead of writing out that code everytime we want to make the mouse do that.
end.

Looping our main procedure
begin
SetupSRL;
repeat // we put this in so that it will repeat whatever procedure we put under it.
MovingWritingAndWaiting;
WriteLn('Repeating the whole procedure.....')
until(false) // We put this here so that it will know when to stop and end the script,Many other things can be used instead of (false).
end.




Thats pretty much all there is to Procedures.



------------------------------Declare Players-------------------------


*Declare Players is an SRL Procedure that is used for making a script

multiplayer, You will find that most scripts include this procedure.
I am going to teach you how to include it in a script.

Open SCAR and this is what it will look like
program New;
begin
end.
program MyFirstMultiPlayerScript;
begin
end.

All this section will go over is how to make the DeclarePlayers

procedure.
Now copy this out into your SCAR window, exactly as I have done, do not

be confused I will explain it all to you.
program MyFirstMultiPlayerScript;
{.include SRL/SRL.scar}

procedure DeclarePlayers; //This is the procedure everbody uses to make a multiplayer script.
begin

HowManyPlayers:= 5; // How many players are you using
CurrentPlayer:= 0; // Don't touch this but this is the

player number that the script will start on.
NumberOfPlayers(HowManyPlayers); // Don't touch this.


Players[0].Name := ''; // Username.
Players[0].Pass := ''; // Password.
Players[0].Nick := ''; // 2-4 letters of Username (that are not capital letters or numbers).
Players[0].Active := True;


Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;


Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := True;


Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Active := true;


Players[4].Name := '';
Players[4].Pass := '';
Players[4].Nick := '';
Players[4].Active := true;
end;


begin
end.

Now I am going to break the player setup down.

This is the name of the first player you will be using.
Players[0].Name := '';
This is the password of the first player you will be using.
Players[0].Pass := '';
Here you put 3-4 letters of your username excluding the first letter,
without spaces or capitals
Players[0].Nick := '';
And this shows if your player is active or not
Players[0].Active := True;
but no matter how many players are active or inactive this line
HowManyPlayers:= 5; always has to amount to the players
you have, YES even inactive ONES!!!

Now your probably wondering.. hmmmmmm.... how am I gonna
use this in my main loop so that my players will login and keep going.

Im going to show you. We will use our procedure from the section
before this and combine the DeclarePlayers with it then we will
make it log the Starting player in, move the mouse around the runescape
screen then switch to the next player and repeat.
program MyFirstProcedure;
{.include SRL/SRL.scar}

procedure DeclarePlayers; //This is the procedure everbody uses to make

a multiplayer script.
begin

HowManyPlayers:= 5; // How many players are you using
CurrentPlayer:= 0; // Don't touch this but this is the player number that the script will start on.
NumberOfPlayers(HowManyPlayers); // Don't touch this.


Players[0].Name := ''; // Username.
Players[0].Pass := ''; // Password.
Players[0].Nick := ''; // 2-4 letters of Username (that are not capital letters or numbers).
Players[0].Active := True; // Active?? True=Yes, False=No


Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;


Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := True;


Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Active := True;


Players[4].Name := '';
Players[4].Pass := '';
Players[4].Nick := '';
Players[4].Active := True;
end;


Procedure MovingWritingAndWaiting;
begin
wait(1000); //This is a wait time.
WriteLn('Now left clicking mouse'); //This gets written in the DebugBox.
Mouse(432, 348,1,1,false); //I put in random coords on my screen and false makes it right click.
wait(500);
WriteLn('Now Moving Mouse');
MMouse(563, 207,1,1);
wait(500);
WriteLn('Now right clicking mouse');
Mouse(374, 306,1,1,true);
wait(1000);
WriteLn('Mouse succesfully moved and clicked around the screen Now We

will Log the next player in.');
NextPlayer(True); //Here we show that when this procedure is completed it will move on to the next player
end;

begin
SetupSRL; //Now we always need to put this here.
DeclarePlayers; //This tells SCAR we are using this procedure
LoginPlayer; //This Logs the starting player in
repeat // we put this in so that it will repeat whatever procedure we

put under it.
MovingWritingAndWaiting;
WriteLn('Repeating the whole procedure with a new player......')
until(false) // We put this here so that it will know when to stop and end the script,Many other things can be used instead of (false).
end.

I hope you understand that because im moving on......

------------------------------Banking Procedures----------------------



Now this took me forever to figure out. HOW AM I SUPPOSED TO
MAKE A SCRIPT THAT CAN OPEN A BANK, WITHDRAW
OR DEPOSIT STUFF THEN CLOSE IT !?!?!?!?

Then answer is very simple once you learn the proper functions.
These functions are.

//Open your bank.
OpenBankQuiet('veb'); // veb,vwb,fwb,feb(initials for main banks,Varrock east,Varrock west .ETC.
//Close your bank.
CloseBank;
//Deposit items from your inventory.
if(FindColorTolerance(x,y,YourColor, 557, 207,741, 464,15))
then
Mouse(x,y,1,1, False);
wait(500+random(200));
ChooseOption('Store All');
//withdraw items from your bank.
Withdraw(1,1,27); //Withdraw(Column,Rown,Amount)


Now those are very basic SRL functions for banking.

------------------------------Screen Functions------------------------


Here are the basic functions to turn your screeen and set the angle of

it.


// Rotates your screen to direction u want
MakeCompass('N') ;//North,South,East,West
//Makes your screen angle high or low.
SetAngle(true);//True for highest.
SetAngle(false);//False for lowest.


Moving on...

---------------------------------S.M.A.R.T----------------------------

SMART is way easier to setup then you would think!!!! here it is:


program RunSmart;
{.include SRL/SRL/Misc/Smart.scar}
{.include SRL/SRL.scar}

const
SmartWorld= 72; //set this to world you wanna log in on.

// And before SetupSRL and your repeat loop just put this
begin
SmartSetUpEx(SmartWorld,False, True);
While Not (SmartReady) Do
Wait(100);
SetTargetDC(SmartGetDC);
If Not (LoggedIn) Then
Wait(100);
SetupSRL;
end.

And just make sure you have your includes properly done!
program ProgramName;
{.include SRL/SRL/Misc/Smart.scar}
{.include SRL/SRL.scar}

YES!! ITS THAT EASY!



I hope my tutorial is very beneficial to you now go have fun SCRIPTING!!!!!!!

kor
05-19-2008, 07:35 PM
why is everything so...tiny?

sirlaughsalot
05-19-2008, 07:51 PM
I was wondering the same thing, i glanced at it and it looked pretty complete, basic, didn't actually read it, as i know all of this stuff it wouldnt do any good...

EvilChicken!
05-19-2008, 08:35 PM
Nice tutorial.
Rep+ for you!

You might want to make the font a small bit bigger?
As for now people, just hold in CTRL and scroll your mouse wheel upwards. That'll make the font bigger.

insanomano
05-20-2008, 02:05 AM
Ok im just posting this down here because people already left comments about the size. it is now Edited and larger have fun with my tut guys and if you rlly like it I wouldn't mind Rep+ :D but I just hope it helps

Hatched.Egg
05-23-2008, 09:45 AM
Thanks, This helped me with my first script which I will give you credits to when I release.

iky789
05-23-2008, 10:09 AM
nice help me and proberly others

NY Nick
05-24-2008, 02:28 AM
Very nice, it helped A TON. <3

evert230
05-25-2008, 12:25 PM
Thanks for writing this man, this will definatley help me on my way :D

angel77gal
05-30-2008, 03:41 AM
Thanks, helped a ton
:)

homeslice930
06-03-2008, 02:55 AM
thanks for all the information... really helping me put together all of my junk scripts

alias66
02-01-2009, 02:19 PM
Nice guide :) found it very helpful as i only just started scripting myself.

Thx