ollie
2006-05-07 05:34:37
if you have any problems let me know, thanks
/////////////////////////
//// By Ollie ////
//// Edited By Chaos \\\\
/////////////////////////
program LesserMager;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/Magic.scar}
const
User = 'x';
Pass = 'x';
FightMode = 2;
TopOfDoor = 2047323;
LesserColor = 529512;{Red color of lesser demon}
LesserText = 'Walk';{Text when mouse over lesser try first word}
QuestSymbol = 15963504;{Light-Blue quest start symbol color}
Spell = 'Wind Strike';
Skill='Magic';{Skill for lamp}
var sx,sy,Attack:integer;
Stop:boolean;
function FindTheObject(objtext:string; objcolor,tol:integer):boolean;
var ax,ay:integer;
xi,yi,TempHold2,i,TempHold:extended;
begin
if(FindColorTolerance(x,y,objcolor,1,1,514,336,tol))then
begin
ax:=257; ay:=168;
repeat
i:=i+1
yi:=0;
repeat
yi:=yi+1;
TempHold:=Trunc(i/2);
TempHold2:=i/2;
if(TempHold=TempHold2)then
begin
ay:=ay+10;
end else ay:=ay-10;
if(FindColorTolerance(x,y,objcolor,ax-5,ay-5,ax+5,ay+5,tol))then
begin
MMouse(x,y,1,1);
wait(450);
if(IsTextAt2(9,9,objtext,100))then
result:=true;
end;
until(yi=i)or(result=true)
xi:=0;
repeat
xi:=xi+1;
TempHold:=Trunc(i/2);
TempHold2:=i/2;
if(TempHold=TempHold2)then
begin
ax:=ax+10;
end else ax:=ax-10;
if(FindColorTolerance(x,y,objcolor,ax-5,ay-5,ax+5,ay+5,tol))then
begin
MMouse(x,y,1,1);
wait(450);
if(IsTextAt2(9,9,objtext,100))then
result:=true;
end;
until(xi=i)or(result=true)
until(ax>=336)or(result=true)
end;
end;
Procedure LogInIfneeded(User, Pass:String);
begin
if not (LoggedIn) then
Writeln('You Are Not Logged In Logging In Now');
LoginPlayer;
end;
function Fight:boolean;
begin
if(FindColorSpiral(x,y,65280,216,115,284,171))then
begin
Stop:=true;
Result:=true;
end;
end;
procedure SetPosition; forward;
procedure Run;
begin
if(FindTheObject('Open',TopOfDoor,0))then
MouseFlag(x,y,0,0);
wait(200);
if(FindColor(x,y,QuestSymbol,572,8,723,160))then
MouseFlag(x,y,1,1);
if(FindColorTolerance(x,y,4802896,572,8,723,160,35))then
MouseFlag(x+3,y+3,0,0);
wait(300);
SetPosition;
end;
procedure CheckRandoms;
begin
FindNormalRandoms;
FindLamp('Skill');
end;
procedure SetSpellCoords;
begin
Begin
GameTab(1);
Wait(100+Random(300));
MMouse(710, 411, 6, 6);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Repeat
Wait(300);
Until(Not(GetColor(636, 357) = 65535));
If(Spell = 'Wind Strike')Then
Begin
MMouse(585, 225, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Water Strike')Then
Begin
MMouse(622, 223, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Earth Strike')Then
Begin
MMouse(664, 223, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Fire Strike')Then
Begin
MMouse(704, 224, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Wind Wave')Then
Begin
MMouse(580, 348, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Water Wave')Then
Begin
MMouse(620, 348, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Earth Wave')Then
Begin
MMouse(662, 348, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Fire Wave')Then
Begin
MMouse(701, 348, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Wind Bolt')Then
Begin
MMouse(581, 265, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Water Bolt')Then
Begin
MMouse(621, 265, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Earth Bolt')Then
Begin
MMouse(662, 265, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Fire Bolt')Then
Begin
MMouse(701, 265, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Wind Blast')Then
Begin
MMouse(581, 307, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Water Blast')Then
Begin
MMouse(621, 307, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Earth Blast')Then
Begin
MMouse(662, 307, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse (X, Y, 0, 0, True);
Wait(200+Random(100));
End Else
If(Spell = 'Fire Blast')Then
Begin
MMouse(701, 307, 3, 3);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Wait(200+Random(100));
End;
Repeat
Wait(300);
Until(GetColor(636, 357) = 65535);
MMouse(581+Random(40), 430+Random(8), 4, 4);
GetMousePos(X, Y);
Wait(100+Random(100));
Mouse(X, Y, 0, 0, True);
Repeat
Wait(200);
Until(GetColor(609, 437) = 1777020);
End;
end;
procedure SetSpell;
begin
SetSpellCoords;
Mouse(558,186,5,5,true);
wait(500);
Mouse(719,428,5,5,true);
wait(1000);
Mouse(sx,sy,1,1,true);
wait(1000);
Mouse(597,435,10,10,true);
wait(500);
Mouse(650,187,5,5,true);
end;
Procedure FaceNorth;
begin
MakeCompass('N');
end;
function FindLesser:boolean;
begin
if(FindTheObject(LesserText,LesserColor,5))then
Result:=true;
end;
procedure SetPosition;
begin
if(FindLesser)then
MouseFlag(x,y-90,1,1);
end;
procedure MageLesser;
var AntiStuck:integer;
begin
AntiStuck:=0;
Stop:=false;
if(FindLesser)then
Mouse(x,y,1,1,false);
wait(400);
if(FindBitmap(Attack,x,y))then
begin
Mouse(x,y,1,1,true);
repeat
AntiStuck:=AntiStuck+1;
wait(50);
CheckRandoms;
until(not(FindColorSpiral(x,y,65280,144,216,370,327)))or(Stop=true)or(AntiStuck>799)
end;
end;
Procedure SetFighting;
Begin
GameTab(1);
SetFightMode(FightMode);
End;
procedure LoadBmps;
begin
Attack := BitmapFromString(12, 7,
'5D54475D54475D54475D54475D54475D54475D54475D54475D5447' +
'5D54475D54475D54475D5447FFFFFFFFFFFF5D54475D54475D5447' +
'5D5447FFFFFFFFFFFF5D54475D54475D54475D5447FFFFFFFFFFFF' +
'0000005D54475D54475D5447FFFFFFFFFFFF0000005D54475D5447' +
'5D5447FFFFFFFFFFFF0000005D54475D54475D5447FFFFFFFFFFFF' +
'0000005D54475D54475D5447FFFFFFFFFFFFFFFFFFFFFFFF5D5447' +
'5D5447FFFFFFFFFFFFFFFFFFFFFFFF5D54475D5447FFFFFFFFFFFF' +
'0000000000000000005D5447FFFFFFFFFFFF000000000000000000' +
'5D5447FFFFFFFFFFFF0000005D54475D54475D5447FFFFFFFFFFFF' +
'0000005D54475D5447');
end;
begin
SetupSRL;
LoadBmps;
LoginIfNeeded(User,Pass);
DisguiseScar('iTunes');
SetSpell;
SetPosition;
repeat
CheckRandoms;
SetChat('Off', 1);
SetChat('Friends', 2);
SetChat('On', 3);
MageLesser;;
RandomChatEvery(3+random(15));
LeaveScreenEvery(1+random(13));
until(false)
end.