PDA

View Full Version : My first SRL Script need Pointers



Hey321
11-11-2006, 10:52 PM
As title says first SRL Script and i need some pointers . So if any1 as any then go ahead and post em :). Help me make this an ownage script. Yay i got it working. Guess what the problem was. It's kinda sad but i forgot to put Until(false) at the end of the script :P only reason it didnt work.




pprogram Hey321sNoobFighter;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/Fighting.scar}
{.include SRL/SRL/extended/xAntiRandoms.scar}

var
MColor1, MColor2, MColor3: Integer;

var
MonsterName: string;

var
MonstersFought: Integer;

Const
Tolerance=5;
fightmode=0;
NumLoops=5;
waittime=1000;
procedure Colours;
begin
MonsterName:='Cow';//name of monster to fight.
MColor1:=000000;//first colour on the monster.
MColor2:=000000;//second colour.
MColor3:=000000;//self explanotory.
end;

Procedure DeclarePlayers;
begin

HowManyPlayers:=4;
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;

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;
end;


procedure Login;
begin
if(not loggedin)then
loginplayer
end;

procedure NoBan;
begin
AntiBan;
BoredHuman;
RandomMovement;
FindMod;
RotateEvery(10);
FindNormalRandoms;
if (not (loggedin)) then;
begin
NextPlayer(true);
end;
end;

procedure Setup;
begin
SetupSRL;
SetUpDemon;
SetupSandWich;
declareplayers;
Login;
SetFightMode(FightMode);
end;


procedure ProgressReport;
begin
Writeln('[]---////////////////////\\\\\\\\\\\\\\\---[]');
Writeln(' Thanks for using Hey321s');
Writeln(' Auto-Fighter ');
Writeln(' Worked for:' +ScriptTime2(2));
Writeln(' Monsters Fought: '+IntToStr(MonstersFought)+'');
Writeln('[]---////////////////////\\\\\\\\\\\\\\\---[]');
end;

Procedure Fighting;
begin if not (InFight) then begin;
FindMonster(MColor1, MColor2, MColor3,tolerance, MonsterName);
KAttackMonster(MColor1,MColor2,MColor3,tolerance, MonsterName);
while InFight do
wait(waittime);
end;
end;


begin
Setup;
Colours;
repeat
NoBan;
Fighting;
NoBan;
ProgressReport;
if (MonstersFought=NumLoops) then
NextPlayer(true);
until(false)
end.

Boreas
11-11-2006, 11:15 PM
Check out some other scripts for the player switching ( WT-Fakawi).

Put your setup stuff in a separate procedure and have highest angle, compass north, set chat if needed.

Check out other scripts for random use also.

Umm never written a fighter before, someone who has can help you more.

Hey321
11-11-2006, 11:31 PM
No highest angle stuff is needed, gonna look for player switching now. Also what do you mean by "random use"?

Boreas
11-11-2006, 11:46 PM
I meant how to use antirandoms.

Hey321
11-11-2006, 11:58 PM
Ok, this is wierd. I've checked out a few different scripts that have multi-char support, yet i can't figure out how to use it. Do i just do this:



The stuff that lets you do that here.


Then in my main loop put:

If CowsKilled=NumLoops then
NextPlayer;


Did i do that right?

lardmaster
11-12-2006, 12:25 AM
ok, make a part called "playersetup"

for randoms, just do findnormalrandoms;
that will do all of the randoms that you have in your code.

copy the player setup from srl template (/includes/srl/scripts/SRLtemplate.scar)

add a failsafe to run away if your hp is below a %

also wait(waittime+random(1000));
and i believe it is SLEEP, not wait, but a better procedure is SLEEPANDMOVEMOUSE() it does the same thing as sleep.
jagex can detect when the waits are exact amounts to the millisecond, every time.

Boreas
11-12-2006, 12:35 AM
Yea pretty much. You need this in the beginning


Procedure DeclarePlayers;
begin

HowManyPlayers:=7;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

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



end;

You need the nick for randoms.

In main loop:

General Setup etc
Login the first time if neeeded
Repeat
Setup for individual player
walk to mining/fighting/etc place if needed
repeat
mine a rock/fight a monster/etc
until mined a load/inventory filled with monster drops
walk to bank and do banking stuff/drop load etc

if done enough loads then next player

until false

This format is just a general guide

Also make use of if not(loggedin)

tarajunky
11-12-2006, 12:37 AM
You also need to add a Nickname for each player if you want the SRL randoms to work for you.

A Nickname is 3-5 non-capitalized letters from your character name. It's better if they are not common. Like if your character name was 'Powerlvls', you would not want to use 'Powe' because it's capitalized, and you wouldn't want to use 'lvls' because people are always saying that. So, you could pick 'erlv' or 'werl'.

lardmaster
11-12-2006, 01:42 AM
wait, why not Powe? people rarely capitolize peoples names when they are talking, and randoms always do!

Hey321
11-12-2006, 10:32 AM
Because Powe is more likely to be used by a person than a random. Also did i set that up right? Like at the bottom


If (MonstersFought=NumLoops) Then
NextPlayer;


Would that do it?

lardmaster
11-12-2006, 07:00 PM
Powe? i never say

"hey, im PowerMining" lol

Hey321
11-12-2006, 07:04 PM
no someone else would say some like this "powerlvls mining lvl?" which would set off randoms as the P in power would be capitalized. I do it all the time to fuck up what macros i see.