PDA

View Full Version : Help with random events



ben123321
11-21-2006, 07:12 AM
the main reason why i downloaded SRL is so that i can solve the random events while autoing on RS. I have no clue what so ever on how to make a script that will solve random events while my character is autoing.

my question is, can anyone give me an easy tutorial that will explain how to solve a random event while autoing? if so it would give me alot of help. thanks : )

Pentti
11-21-2006, 12:29 PM
procedure Declareplayers;
begin
HowManyPlayers:=1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0;

Players[0].Name :='Abcdefgh' //PlayerName
Players[0].Pass :='password' //Password
Players[0].Nick :='cdefg' //Players nick name( a few letters from playername)
Players[0].Loc :='';
Players[0].Active:=True;
end;
This is procedure what you need to get antirandoms work.
This must put after "SetUpSRL;"
You can check SRL's anti random stuff from includes\SRL\SRL\core\AntiRandoms.

Here is example how to use SRL's anti random stuff.

procedure Declareplayers;
begin
HowManyPlayers:=1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0;

Players[0].Name :='Abcdefgh' //PlayerName
Players[0].Pass :='password' //Password
Players[0].Nick :='cdefg' //Players nick name( a few letters from playername)
Players[0].Loc :='';
Players[0].Active:=True;
end;

procedure Randoms;
begin
FindNormalRandoms; //Solves "normal" randoms
end;

begin
Setupsrl;
Declareplayers;
//Your stuff here
Randoms;
//something here
end.

Hope this helps. :)

Junior
11-21-2006, 04:55 PM
Pentti you forgot to add something.
You will need to put this right after declareplayers; procedure in your main loop.
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);

:D

Yakman
11-21-2006, 05:08 PM
FindNormalRandoms doesnt run from fights (otherwise autofighters would be running around stupidly)

in the "Randoms" procedure, add

if(FindFight)then
begin
RunAwayDirection('n');
wait(10000+random(5000));
RunBack;
end


RunAwayDirection runs away, you can replace 'n' with 'e' 's' or 'w', RunBack moves the opposite direction that RunAwayDirection did

Pentti
11-21-2006, 05:15 PM
Pentti you forgot to add something.
You will need to put this right after declareplayers; procedure in your main loop.
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);

:D

Oh, oops! :D Good you noticed that.

ben123321
11-22-2006, 11:50 AM
thanks for the help guys, this really helps me alot. : )

Pentti
11-22-2006, 12:09 PM
Well, thats good. If any problems comes, just tell us. :D