SRL Archive - Outdated / Broken

[SRL] Lesser Demon Mager


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.

phantombmx

2006-05-07 05:40:17

MMouse moves mouse, Mouse moves and clicks, CMouse clicks.. why make all your own procedures if srl has exactly what is needed? you can get rid of ClickHuman and the MMouse and just do Mouse(blah blah blah) instead… this needs to be highly re-vamped as far as procedures go.. otherwise, it looks OK.. but you still need to learn a lot about srl.. i recommend downloading the newest SRL and thoroughly (sp?) read every part a few times

ollie

2006-05-07 06:12:12

ok i guess, so you didnt like the stuff then :S

Pyro

2006-05-07 15:56:47

From: ollie
ok i guess, so you didnt like the stuff then :S


No what phantom means is theres alot of stuff in there that doesnt really need to be. For example all those findrandoms and be made into findnormalrandoms;
And alot of other stuff is already in srl like clickhuman etc so it is not needed.

The Prince of Randomness?

2006-05-07 16:12:14

Clickhuman is not in Srl?

-chaos-

2006-05-07 16:40:24

ill fix it up for you or atleast ill try :p

-chaos-

2006-05-07 16:45:16

Well heres my attempt to improvise your script if you find any errors im sorry

/////////////////////////
//// 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.

sorry for the mistakes if there are any :p

WT-Fakawi

2006-05-07 17:02:35

aha. A significant improvement. Good job -chaos-
Now you might want to go for level 2 of the data redunancy competition by adding:

{include SRL/SRL/Skill/Magic.scar}

and use

SetupAutoCast(AutoSpell:string; Style:String)

and use:

Cast(Spell: String; Monster: String; MonsterColor: Integer; Tolerance: Integer);

This has been in SRL for some time now,strange how nobody 'd ever noticed.

-chaos-

2006-05-07 17:28:56

oops sorry dont think i can change it anymore :p

ollie

2006-05-10 12:34:48

Heh Thanks Alot Chaos. No Wonder Your UBER SRL MEMBER SRL and im Noob :P ^^

torrent

2006-05-10 14:54:54

ima try this on my noob with minds.. :)

traitors

2006-06-16 03:41:02

kik ass sig torrent an so f***kn true.nice script ollie once u get srl down u will b a pwnage scripter :D