SRL Archive - First Scripts

Another Alcher


putonajonny

2011-11-09 17:20:02

This is another alcher, please help me as this is my first script and it doesn't work very well, I would love it if you could help:

version 1.0

program SimpleAlch;
{.include srl/srl.scar}
{$DEFINE SMART}
{$i SRL/SRL.scar}

var xval, yval, xinval, yinval: integer;

const
Message1='Lets Cast';
Message2='Casted...';

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :=''; // Copy and paste to add more players
Players[0].Pass :='';
Players[0].Nick :=''; //Used for random events
Players[0].Active:=True;
end;

procedure Cast;
begin
while GetCurrentTab = tab_Inv do
begin
Gametab(tab_Magic);
Wait(100+ Random(100));
end;

while GetCurrentTab = tab_Magic do
begin
Wait(200 + Random(50));
xval := Random(10)+687; //Can somebody tell me how to get these values as at the moment I just guess.
yval := Random(10)+341;
Mouse(xval, yval, 1, 1, True);

xinval := Random(20)+569;
yinval := Random(20)+219;
Mouse(xinval, yinval, 1, 1, True);

end;


FindNormalRandoms
wait(1000)
// Writeln(Message2);
end;


begin
Writeln(Message1);
Smart_Server := 28; //Set to world you'd like to use
Smart_Members := False; //Can be set t true
Smart_Signed := True;
Smart_SuperDetail := False;

SetUpSRL;
ActivateClient;
LoginPlayer;
Writeln(Message1);
Cast;

end.

YoHoJo

2011-11-09 17:21:52

HOLY COCKBALLS!
I think you left your username and password in the script, pelase be more careful next time!
Lucky I saw it first and edited it out!

Kyle Undefined

2011-11-09 18:29:11

Take a look over this, if you have any question let me know.



program SimpleAlch;
(*{.include srl/srl.scar} Delete this, it's not needed*)
{$DEFINE SMART}
{$i SRL/SRL.scar}

var
xval, yval, xinval, yinval: integer;
// These are how your stardards are suppose to be, no worries, you'll get
// better with time :)

const
Message1='Lets Cast';
Message2='Casted...';
// Again, use TAB for indents

procedure DeclarePlayers; // I really don't care about capital bold words, but some people will complain
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :=''; // Copy and paste to add more players
Players[0].Pass :='';
Players[0].Nick :=''; //Used for random events
Players[0].Active:=True;
end;

procedure Cast;
begin
while GetCurrentTab = tab_Inv do
begin
Gametab(tab_Magic);
Wait(250 + Random(100));
// Also, space these mathmatics out, like so
end;

while GetCurrentTab = tab_Magic do
begin
Wait(200 + Random(50));
//xval := Random(10) + 687; Don't need this

// To find the coords of the spell, make sure RS is selected as the client
// Then click on the color picker (The blue eye dropper)
// Click on the spell, it will pull up a popup box with your x,y coords

//yval := Random(10) + 341; Don't need this either

Mouse(xval, yval, 3, 3, True); // Where is this clicking?
// Use a higher random, like 3

//xinval := Random(20) + 569; Get rid of these
//yinval := Random(20) + 219;

Mouse(xinval, yinval, 3, 3, True); // Where is this clicking?

end;


FindNormalRandoms();
wait(RandomRange(750, 1250));
// Writeln(Message2);
end;


begin
Writeln(Message1);
Smart_Server := 28; //Set to world you'd like to use
Smart_Members := False; //Can be set t true
Smart_Signed := True;
Smart_SuperDetail := False;

SetUpSRL;
ActivateClient;
LoginPlayer;
Writeln(Message1);
Cast;

end.

Tickyy

2011-11-09 18:31:50

A very good start for a first script… Here's some feedback.

First of all, You Included SRL twice:

{.include srl/srl.scar}
{$DEFINE SMART}
{$i SRL/SRL.scar}

This Should work:

{$DEFINE SMART}
{$i SRL/SRL.scar}

…

  Players[0].Nick :='';  //Used for random events 

This isn't used for randoms anymore.

also, i see you still have problems with Random Function, and don't really know how to place the waits correctly, For example:

procedure Cast;
begin
while GetCurrentTab = tab_Inv do
begin
Gametab(tab_Magic);
Wait(100+ Random(100));
end;

Let's take this out:

Wait(100+ Random(100));

This, waits 100 ms, and an extra random number from 0 to 99, so 0 might not be the right think that you're looking for, what i'd recommend sometimes, is RandomRange function. For example:

Wait(RandomRange(120, 200));

in this case, it does a Random wait with a range of 120 and 200, so it waits somewhere randomly between 120 and 200, or here's another example.

Wait(100+ RandomRange(20, 100));


This is the same, just in an other way.

lets move further…

This:
procedure Cast;
begin
while GetCurrentTab = tab_Inv do
begin
Gametab(tab_Magic);
Wait(100+ Random(100));
end;

while GetCurrentTab = tab_Magic do
begin
Wait(200 + Random(50));
xval := Random(10)+687; //Can somebody tell me how to get these values as at the moment I just guess.
yval := Random(10)+341;
Mouse(xval, yval, 1, 1, True);

xinval := Random(20)+569;
yinval := Random(20)+219;
Mouse(xinval, yinval, 1, 1, True);

end;

"Can somebody tell me how to get these values as at the moment I just guess."

I didn't really understand the question, so sorry, if you expected someone to answer that.

This:
    xval := Random(10)+687; 
yval := Random(10)+341;
Mouse(xval, yval, 1, 1, True);

this part is completely unnecessary.

Mouse(687, 341, 10, 10, True);

what it does is just the same thing, it clicks on the coords 687 and 341 plus a random of 10 in each coordinate.

That's it.

And if you have a problem, then please show it, give more information, so we can understand what you're trying to say/do.

Versus The World

2011-11-10 00:57:59

To me it looks the same as this: http://villavu.com/forum/showthread.php?t=64231

Just without the paint/antiban and a couple things reworded, but i guess thats expected from new scripters and something so basic.