SRL Archive - Outdated / Broken

[BETA] SRL Mager


ollie

2006-06-18 14:05:21

i havent tested it, i wrote this on my laptop while watching the football.

its probably totally wrong, but it should work.

{=========================================================================]
[ SRL Magic Castser. ]
[ ]
[ NAME : SRL Magic Castser. ]
[ WRITER : Ollie ]
[ CATEGORY : Magic ]
[ DESCRIPTION : Casts a Magic Spell On a Monsters ]
[ AUTOCOLOR : No ]
[ ]
[ ]
[=========================================================================]

[=========================================================================]
[ Instructions. ]
[=========================================================================]
[ 1. USE Runescape with Low Detail. ]
[ 2. Set your Screen to 32 bit TRUE color. ]
[ 3. Set Playernames and Passwords in DeclarePlayers. ]
[ 4. SET HOWMANYPLAYERS inside DeclarePlayers ]
[ 5. Start script! ]
[=========================================================================}

program SRLMagicCaster;

{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Magic.scar}
var
StopIt,AB,ABCase1,ABCase2,DoSomeThingWeird, killz : Integer;


//******************** Set These Constants if Needed *******************//

const StartPlayer = 0; // Determines who will play first
Const Kills = 666; // Number of Kills before switching Player.

//**********************RuneScape Constants*******************************//

const Color1 = 0; //monster colour
const Color2 = 0; //monster colour
const Color3 = 0; //monster colour
const TheMonsterName = 'Man'; // whats the monster name ??
const eating = false; //do you want to eat
const foodcolor = 0; //the food color
const eathp = 30; //the eat hp
const foodlogout = true; //shall we logout if hp goes below eathp?
const IsSpellatTop = True; // set to true if the spell your casting is at the top of the page.
const SpellToCast = 'wind strike'; //or you can use SpellToCast = '1';
const Style = '1'; // fighting style 1 & 2 are The Same, 3 gets Defence EXP Too.
const BenM = true; // use benlands great mouse function
const Mspeed = 22; // what speed do you want to use for the mouse??

{Set's up the spell you want to autocast, wielding a staff is
required. AutoSpell = '1' or 'Wind Strike', '2' or 'Water Strike',
'3'or 'Earth Strike', '4' or 'Fire Strike'.
Style = '1' for Accurate, '2' for Agressive, '3' for Defensive.}

//************************************************************************//
const VersionNumber = '0.1 - BETA'; // Version of the Script.
//************************************************************************//

Procedure DeclarePlayers;
begin
HowManyPlayers :=1; // Set Number of Players here.
NumberOfPlayers(HowManyPlayers); // Sets the Players Array Length;
CurrentPlayer:=StartPlayer; // CurrentPlayer = Array Index
// UnComment Out how many players you want
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Loc :='';
Players[0].Skill:='';
Players[0].Active:=True;

{ Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Loc :='Loc1';
Players[1].Skill:='';
Players[1].Active:=True; }

{ Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Loc :='Loc1';
Players[2].Skill:='';
Players[2].Active:=True; }

{ Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Loc :='Loc1';
Players[3].Skill:='';
Players[3].Active:=True; }

{ Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Loc :='Loc1';
Players[4].Skill:='';
Players[4].Active:=True; }

{ Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Loc :='Loc1';
Players[5].Skill:='';
Players[5].Active:=True; }

writeln(inttostr(HowManyPlayers)+' Players');

end;

//************************************************************************//

procedure FindRandoms;
begin
FindNormalRandoms;
if Findname Then FindTalk;
end;

{*****************************************************************************
function InFight: Boolean;
By: XxKanexX
Description: Returns as True if in fight.
*****************************************************************************}
function InFight: Boolean;
begin
if(FindColorToleranceDOB(x, y, 65280, 255, 236, 141, 259, 151, 5))or //North
(FindColorToleranceDOB(x, y, 65280, 255, 223, 140, 256, 150, 5))or //South
(FindColorToleranceDOB(x, y, 65280, 255, 247, 136, 282, 147, 5))or //East
(FindColorToleranceDOB(x, y, 65280, 255, 237, 150, 273, 163, 5))then //West
result:= true;
end;

{*****************************************************************************
procedure OutFight;
By: XxKanexX
Description: If in Fight waits until out of a fight.
*****************************************************************************}
procedure OutFight;
var
i: integer;
begin
Flag;
for i:= 1 to 5 do
begin
if(InFight)then
begin
//writeln('Fighting..');
repeat
wait(50);
until(not(InFight));
//writeln('Out Of Fight');
exit;
end else
wait(300);
end;
end;

{*****************************************************************************
function KAttackMonster(Color1, Color2, Color3, Tolerance: Integer; MonsterName: String): Boolean;
By: XxKanexX
Description: If monster is found based of it's given colors, name and tolerance level,
will result true then click the monster and wait until out of the fight.
*****************************************************************************}

function KAttackMonster(Color1, Color2, Color3, Tolerance: Integer; MonsterName: String): Boolean;
var
i, x, y: Integer;
begin
Flag;
for i:= 1 to 5 do
begin
if(FindColorTolerance(x, y, Color1, MSX1, MSY1, MSX2, MSY2, Tolerance + i))and
(FindColorTolerance(x, y, Color2, MSX1, MSY1, MSX2, MSY2, Tolerance + i))and
(FindColorTolerance(x, y, Color3, MSX1, MSY1, MSX2, MSY2, Tolerance + i))then
begin
MMouse(x, y, 3, 3);
wait(80 + random(60));
if(IsUpText('Attack '+MonsterName))then
begin
result:= true;
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
wait(40 + random(20));
Flag;
OutFight; //Waits Until Out Of Fight..
exit;
end;
end;
end;
end;

{*****************************************************************************
function FindMonster(Color1, Color2, Color3, Tolerance: Integer; MonsterName: String): Boolean;
By: XxKanexX
Description: Rotates compass in all 4 directions and searches for monster. If monster
is found will Attack the monster using "KAttackMonster" function.
*****************************************************************************}

function FindMonster(Color1, Color2, Color3, Tolerance: Integer; MonsterName: String): Boolean;
var
i: integer;
dir: string;
begin
case random(4)+1 of
1: dir:= 'nswe';
2: dir:= 'wens';
3: dir:= 'sewn';
4: dir:= 'ewns';
end;
for i:= 1 to 4 do
if(not(KAttackMonster(Color1, Color2, Color3, Tolerance + i, monsterName)))then
MakeCompass(strget(dir, i))
else
begin
result:= true;
exit;
end;
end;

{*****************************************************************************
procedure RealEatIfNeeded(foodcolor, eathp : Integer; foodlogout : Boolean);
By: realrune
Description: - foodcolor is color of food to eat.
- it will only eat if hp is lower then eathp.
- foodlogout, if this is true script will disable char's without food.
*****************************************************************************}
procedure RealEatIfNeeded(foodcolor, eathp : Integer; foodlogout : Boolean);
begin
if(GetHp<= EatHp)and(FoodColor>= 0)then
begin
GameTab(4);
wait(10 + random(20));
if(FindColorSpiraltolerance(x, y, foodcolor, 560, 210, 730, 460, 2))then
begin
MMouse(x + 2, y - 2, 6, 5)
if(IsUpText('Eat'))then
begin
GetMousePos(x, y);
mouse(x, y, 3, 2, true);
end;
end
Else
begin
if(FoodLogout)then
begin
logout;
Players[CurrentPlayer].Active:= false;
end;
end;
end;
end;

//*************************************************************************//

Procedure AntiBan1;
Begin
Status('AntiBan Activated!')
Writeln('')
Writeln('')
Writeln('')
Writeln('Anti-Ban = True')
Writeln('')
ABCase1:=Random(5)
ABCase1:=Random(5)
Case ABCase1 Of
1:
Begin
MMouse(586,310,21,21)
Wait(100+Random(100))
MMouse(246,98,40,40)
Wait(100+Random(100))
GameTab(0+random(12));
FindRandoms;
End;
2:
Begin
Writeln('')
Writeln('')
Writeln('')
Writeln('Checking Stats')
Writeln('')
Status('Checking Stats!')
Mouse(586,184,7,7,true)
Wait(20+Random(20))
GetMousePos(x,y)
MMouse(x,y,2,2)
Wait(125+Random(125))
GetMousePos(x,y)
MMouse(x,y,2,4)
Wait(1000+Random(1000))
FindRandoms;
End;
3:
Begin
MMouse(600,276,20,12)
Wait(45+Random(25))
MMouse(616,283,12,17)
Wait(45+Random(25))
MMouse(614,423,12,17)
Wait(190+Random(225))
Mouse(559,186,7,7,True)
Wait(500+Random(500))
GetMousePos(X,Y)
Wait(20+Random(5))
MMouse(x,y,2,6)
Mouse(584,187,2,2,true)
Wait(1000+random(200))
FindRandoms;
End;
4:
Begin
CMMouse(585,187,5,5)
Wait(1+random(20))
GetMousePos(x,y)
Mouse(x,y,0,0,true)
Wait(120+random(120))
CMMouse(588,265,20,20)
Wait(2000+random(1000))
GameTab(0+random(12));
End;
End;
End;

//*************************************************************************//

Procedure AntiBan2;
Begin
Status('AntiBan2 Activated!')
Writeln('')
Writeln('')
Writeln('')
Writeln('Anti-Ban2 = True')
Writeln('')
ABCase2:=Random(9)
ABCase2:=Random(9)
Case ABCase2 Of
1:
Begin
MMouse(266,175,250,160)
Wait(300+Random(50))
MMouse(266,175,250,160)
Wait(300+Random(50))
AntiBan1;
MMouse(266,175,250,160)
Wait(300+Random(50))
FindRandoms;
End;
2:
Begin
MMouse(266,175,250,160)
Wait(800+Random(50))
MMouse(266,175,250,160)
Wait(50+Random(50))
GameTab(0+random(12));
FindRandoms;
End;
3:
Begin
Wait(2000+Random(1200))
GameTab(0+random(12));
FindRandoms;
End;
4:
Begin
MMouse(327,199,300,180)
Wait(400+Random(400))
MMouse(327,199,300,180)
Wait(75+Random(400))
GameTab(0+random(12));
FindRandoms;
End;
5:
Begin
MMouse(327,199,300,180)
Wait(400+Random(400))
MMouse(327,199,300,180)
Wait(400+Random(400))
MMouse(327,199,300,180)
Wait(400+Random(400))
MMouse(327,199,300,180)
MMouse(327,199,300,180)
Wait(400+Random(400))
DoSomeThingWeird:=Random(4)
Case DoSomeThingWeird Of
1:
Begin
AntiBan1;
GameTab(0+random(12));
End;
2:
begin
GameTab(0+random(12));
end
3:
begin
AntiBan1;
GameTab(0+random(12));
end
4:
begin
GameTab(0+random(12));
end;
End;
FindRandoms;
End;
6:
Begin
GetMousePos(X,Y)
MMouse(x,y,2,2)
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(25+Random(20))
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(25+Random(20))
FindRandoms;
End;
7:
Begin
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(105+Random(20))
GetMousePos(X,Y)
AntiBan1;
MMouse(x,y,2,2)
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(200+Random(22))
GetMousePos(X,Y)
MMouse(x,y,2,2)
Wait(200+Random(22))
FindRandoms;
End;
End;
End;

//*************************************************************************//

procedure ChooseAntiBan;
begin
AB:=Random(3)
Case AB of
1: AntiBan1;
2: AntiBan2;
3: BoredHuman;
end;
end;

//************************************************************************//

procedure PlayerStats;

var Active: string;
var i: Integer;
begin
writeln('**********************************************');
writeln('Name : '+ Players[CurrentPlayer].Name);
writeln('Number : '+ inttostr(CurrentPlayer));
writeln('Worked for : '+ inttostr(Players[CurrentPlayer].Worked)+' minutes.');
if Players[CurrentPlayer].Active=True then Active:='True' else Active:='False';
writeln('Active : '+ Active);
writeln('Location : '+ Players[CurrentPlayer].loc);
writeln('**********************************************');

for i := 0 to HowManyPlayers-1 do
begin
if Players[i].Active=True then Active:='True' else Active:='False';
writeln( (inttostr(i))+' : '+Players[i].name+ ' = '+Active+'. - Lvl : '+inttostr(Players[i].Level[15])+
'. - B :'+inttostr(Players[i].Banked)+' Times.'+
' - : '+IntToStr(Players[i].Worked)+' mins.'+' - Loc: '+Players[i].loc);
end
writeln('**********************************************');
end;

//************************************************************************//

procedure ProgressReport;
begin
begin
WriteLn(' ');
WriteLn('<============== - SRL Magic Caster v.'+VersionNumber+'- Progress Report ===============>');
SRLRandomsReport;
Writeln(' ');
end;
PlayerStats;
end;

//*************************************************************************//

procedure SetupMage;
begin
SetUpAutoCast(SpellToCast, Style);
PerfectNorth;
end;

//*************************************************************************//

procedure CastIt;
begin
OutFight;
ChooseAntiBan;
repeat
ChooseAntiBan;
FindMonster(Color1, Color2, Color3, 15, TheMonsterName);
Wait(1000+random(1000));
KAttackMonster(Color1, Color2, Color3, 15, TheMonsterName);
killz:=killz+1
if(eating)then
RealEatIfNeeded(foodcolor, eathp, foodlogout);
until(InFight);
if(weareDead)then StopIt:=1;
end;

//*************************************************************************//

procedure fixthingsup;
begin
FixChat;
end;

//*************************************************************************//

procedure Loop;
begin
SetupSRL;
DeclarePlayers;
BenMouse:= BenM;
MouseSpeed:= Mspeed;
FixMage(True);
repeat
LoginPlayer;
fixthingsup;
repeat
CastIt;
FindRandoms;
DontBanMe(10+random(3));
ProgressReport;
Until(StopIt=1);
if(not(LoggedIn))then NextPlayer(False);
Until(StopIt=2);
end;


//*************************************************************************//
//
// Main EventLoop
//
//*************************************************************************//
begin
repeat
Loop;
until(killz=kills);
end.