SRL Archive - First Scripts

MageLesser


Zeakone

2007-11-04 08:09:51

Hi guys!

Im glad to post my first script (h)

Its a automager for the lesser up in the Wizard Tower next to draynor.

When u want to start, u need to autocast the spell u wanna use and stay before the lesser.

I probably works with a d hally or rune hally too.

Im working on it, and updates will come soon.

program MageLesser;
{.include SRL\SRL.scar}


var
x, y: Integer;

// Setup
const
LesserColor1 = 1847158 ; // Lesser Colors
LesserColor2 = 4154;

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

Players[0].Name := '***'; //username
Players[0].Pass := '***'; //password
Players[0].Nick := 'Feel'; //3-4 letters from your username
Players[0].Active := True;
end;

procedure setup;
begin
wait(300+random(500))
makecompass('n');
wait(400+random(330))
setrun(true);
wait(400)
gametab(4);
wait(500+random(300))
gametab(4)
wait(400+random(400))
writeln('Setup successfully')
wait(4000+random(2000))
cleardebug;
wait(2000)
end;

procedure attackLesser;
begin
if findcolortolerance(x, y, LesserColor1, 0, 0, 700, 500, 5) or
findcolortolerance(x, y, LesserColor2, 0, 0, 700, 500, 5) then
begin
Mouse(x ,y, 0, 0, false)
ChooseOption('ttack')
wait(3000+random(3000))
end;
end;

procedure saitime;
begin
wait(400)
writeln(TimeRunning)
wait(330)
end;

procedure login;
begin
if (not(loggedin)) then loginplayer;
wait(200);
highestangle;
makecompass('n');
begin
setBar('brightness',4);
players[currentplayer].booleans[1]:=true;
end;
end;

begin
SetUpSRL;
declarePlayers;
login;
activateclient;
setup;
repeat
saitime;
wait(2000+random(1000))
attackLesser;
until(false)
end.

Help is always welcome. Im a real scar noob :rolleyes:

Bye!

Shuttleu

2007-11-04 08:22:41

woot first post
any way will test and it looks good although you could put some anti-randoms in ,lets hope it works:)
as it is i never understood the FindColorTolerance functionanyway

Zeakone

2007-11-04 08:24:52

I would love it u wanna test :)

ShowerThoughts

2007-11-04 08:27:50

its not that fantastic but good for a first script

Shuttleu

2007-11-04 08:32:47

just a quick question
why do you need to enter the username when the script doesnt even use it?

Zeakone

2007-11-04 08:33:08

From: hermpie
its not that fantastic but good for a first script


Thanks :)

Zeakone

2007-11-04 08:44:12

I updated, its loggin in now.

Zeakone

2007-11-04 10:04:09

Is there someone who wanna help me with Antirandoms?

Shuttleu

2007-11-04 10:13:47

add this to script

Function FindFastRandoms: Boolean;// credits to Wt-Fakawi
var
i: Integer;
begin
for i:=0 to 9 do
begin
case I of
0: If FindTalk then
begin
FindNormalRandoms;
end;
1: If FindDead then
Result := True;
2: If FindMod then
Result := True;
3: If FindMime then
Result := True;
4: If FindMaze then
Result := True;
5: If FindQuiz then
Result := True;
6: If FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;

Logout;
Exit;
end;
end;
8: begin
if InBlack then
begin
Result := True;
Logout;
Exit;
end;
end;
9: RC;
end;
FindFight;
FindFightEx;
end;
end;

Procedure NoRandoms;
begin
FindTalk;
FindNormalRandoms;
FindFastRandoms;
SolvePinball;
if (FindFight = true) then
begin
RunAwayDirection('n');
wait(10000+Random(5000));
RunBack;
end;
end;

begin
SetupSRL;
NoRandoms;
end.
it one of my own and it works quite well
well acctually the findfastrandoms was from Wt-Fakawi as you might of been able to tell