SRL Archive - First Scripts

My Very First Script


RaiNKhan

2008-11-11 00:07:00

Hi this is my very first script what it does is logs you in teleports you to lumby and then logs out can some1 plz try to tell me if i did good on my very first script? Thank you.

Here is the script All you need to edit is line 12 and 14 for your password.
Please Reply And Rate for first script

benjaa

2008-11-11 01:02:02

2 useful built in functions are;

LoginPlayer;
Logout;

also blind coordinate clicking is not really acceptable
try searching "DTM tutorial" in search engine

also, failsafes

try this;

program LoginScript;
{.include SRL/SRL.scar}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;//Change this accordinly
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'benjaa'; //Character Name
Players[0].Pass := '*******'; //Character Pass
Players[0].Nick := 'enja'; //Nickname 3 - 4 Letter's of char name
Players[0].Active := True; //Use player in script?
end;

begin
SetupSrl;
ClearDebug;
ActivateClient;
DeclarePlayers;
LoginPlayer;
Wait(3000);
Logout;
end.

Aser

2008-11-16 21:57:23

A little constructive criticism… skip if you don't care

you have the user input the user and pass into the TypeSend();

This is ok for a short script like this but if your scrip gets long it is hard to find…

So if you do this


const //add this to the top right under the program name and includes
Username = 'username'
Password = 'password'


Procedure TypeInUserandPass;
Begin
TypeSend(username); // username here! --> This takes the constant above
wait(1000+Random(200)); // and puts it into the TypeSend so you edit
TypeSend(password); // the username and pass above
end;




Also to cast the spell you can use…


CastSpell(1);

This goes to the spell menu and picks the spell by number
in this cas it is 1 so it is the first spell
note: This needs the magic include –> {.include srl/srl/skill/magic.scar}

end of constructive criticism

I like it and am glad that you are learning to scrip. I wish you well in your quest and hope you become great.

P.M. me if you need any help with anything…

ranger4lifeq

2008-11-18 12:56:13

lol
what does this script acctualy do?

benjaa

2008-12-07 17:52:29

lol
what does this script acctualy do?


Hmm

Hi this is my very first script what it does is logs you in teleports you to lumby and then logs out

monkeykg

2008-12-13 01:34:36

From what ive read in some of the tut's on the forums you should use DTM cause its easier more effient, better, etc

Nice first script. Simple but not to simple, i can tell you its more advanced than my first script which just logs you in says hi then logs out