SRL Archive - OSR Script Requests

Revive MAGE ARENA script


Fade03

2013-03-27 06:55:03

HI,

Is there any chance that someone could revive the mage arena enchanter script? I remember i used it in 2007 and got my mage up to 85 just through couple of nights.

The code is by Sp0rk-eh:
{.Script Info:
# ScriptName = Mage Arena Enchanter
# Author = Sp0rk-eh
# Description = Enchants in the mage training arena (near the dueling arena)
# Version = 0.2
# Date = 31 October 2007
# Comments = N/A
/Script Info}


{Make sure your minimap is as perfect north as possible!}
{!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
{|}{|}
{|}{O.Start the Arena mode in the center of the Enchant Arena}{|}
{|}{O.Have cosmics in the first inventory slot, and no other items}{|}
{|}{O.Start the Buy mode next to the Rewards Guardian}{|}
{|}{|}
{!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
//Please post progress reports. They make me happy.

{Credits:
Pwnaz0r - providing some functions + chatter on msn
Dave - testing
Hy71194 - antiban
King Of Knives - inspiration of mm walls/procedure}

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

const
//You may edit this
Mode = 'Arena'; //Arena or Buy

var
Cube, Cylinder, Ico, Pentamid, ShapeColor, TripsDone, iX, iY, x, y: Integer;
CurrentBonusShape, PlayerLocation, Chat, Namez, Spell, Experience, ExperienceThisTrip: string;
SrlStatsID, SrlStatsPassword, WhichSpellToCast: string;
DragonStones: Boolean;
ShapesEnchanted, TimesLogged, MageLevel, NumberOfCosmics, CosmicsToBuy, CosmicsBought: Integer;
RelativeEnchantAmount: Extended;
S2X1, S2X2, S2Y1, S2Y2, Nine, Number1, Number2, Number3, Number4, Number5, Zero, One, Two, Three, Four, Five, Six, Seven, Eight: Integer;
S1X1, S1X2, S1Y1, S1Y2, FixedTimes: Integer;
S3X1, S3X2, S3Y1, S3Y2: Integer;
S4X1, S4X2, S4Y1, S4Y2: Integer;
S5X1, S5X2, S5Y1, S5Y2: Integer;
PizPointString: string;
PizPoints, ShapesEnchanted2, WorldsHopped: Integer;


//And edit this

procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;

Players[0].Name := ''; // RS UserName
Players[0].Pass := ''; // RS Password
Players[0].Nick := '';

NumberOfCosmics := 10000; //Number of cosmics you have in your inventory
CosmicsToBuy := 10000; //Number of cosmics to buy (5 enchant points per cosmic)
WhichSpellToCast := 'Auto' //Accepted = Auto, Lvl1, Lvl2, Lvl3, Lvl4, Lvl5, Lvl6

Players[0].Active := True; // Don't change

SrlStatsID := ''; //If you dont have these, just leave them blank.
SrlStatsPassword := ''; //If you dont have these, just leave them blank.

end;

//-------Do not edit beyond this point unless you know what you're doing!-------------
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------

procedure LoadBitmaps;
begin
Cube := BitmapFromString2(False, 'aA598978DA7DD04B0EC330080' +
'4D02B61FE5E5227B9FF910A4DD4A6A2EAE6098D18191900203C01' +
'590945A4AA5AC12B11AF199D3FC951896295D828B525957845FAA' +
'8796C5B692CC03448778931BBCEBA103C0CBF1561FDD3523D72B3' +
'79B66CC83ED6DDEB95E60C3B502438DEADA9F4CB09664877AF96E' +
'8C89DA66FC648DD7EDB7561FB81D3C84BD19EF4D');
Cylinder := BitmapFromString2(False, 'a690AD78DAC5913B0EC42' +
'00C44AF34FC0C9410C2FD8FB41E570959A495526CF3341AFC2C4B' +
'00C03C14E845115A534A3D95E964933AB32032676B8AB009B47CB' +
'13E31A769BDE7B29883B2A02AB3E7AB4CCBD1B6355AD2139B4AC1' +
'8DC16D72606471C028DE0514C918DA78365B9E0BEF966CF8C2B2D' +
'BBE5DB8B12EF377EB87DBAEAEF4D7565BF9B8ED7FD6637EFDA30F' +
'DAB');
Ico := BitmapFromString2(False, 'a6BB6D78DA9DD2498E03210C05' +
'D02B19F067581A07EE7FA4368322A24ABA53BD792A996F0B28888' +
'84A30886184DE4C4431A3F3A6CF3C2AD0618FA3EE67FC51C6F7EC' +
'4DE8239946C68B40A08A17154DE5D4918BE58DA8B69AB60555C3D' +
'25643B9213244DD7254B2FE4F306295253B0EB9CF7AB92B3C420D' +
'4B8E9C8A6C2BAB303D2CE3BF911B48743B7BB9C34BBB6A7B46CDD' +
'64549AEEEDEE94A9EBEB90720579D7BC09CE0979C381775CD45B4' +
'99ECBF8B8852B79FCE7877CE731AA576FAC70BB9BED2E5FC47E75' +
'DCD97199F7E3B27802BCE73FD0092C');
Pentamid := BitmapFromString2(False, 'aD40BE78DA6D8E4112C42' +
'00804BF0428A0C710E3FF9FB40E6EED7AC8A5996A0121229AF702' +
'455BA886A80DC5A8820AAFF50127BC46668797861ED5FBF76A921' +
'B14B440F19CF5C86DCEC86520CF0E5EF034400E7161A3E1F6671F' +
'424C5F7FF0EA52B8BCF87501177B9037B779F1357DD282CB3284B' +
'F4E6EBF6F38F90141C');
Status('Loaded Bitmaps');
end;

function FindFastRandoms: Boolean; // By WT-Fakawi.

var
i: Integer;

begin
for I := 1 to 10 do
begin
case I of
1: if FindDead then
Result := True;

2: if FindMod then
begin
Result := True;
Writeln('Mod Found');
end;
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;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;

8: if RC then
Result := True;

9: if FindFight then
begin
Result := True;
Mouse(625 + random(10), 35 + random(10), 1, 1, True);
Flag;
end;

10: if FindTalk then
Result := True;

end;
Wait(1);
end;
end;


function FindUnSolvableRandom: boolean;
var
c: integer;
begin
if not LoggedIn then exit;
for c := 0 to 6 do
begin
case c of
0: if FindDead then
begin
result := true;
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Loc := 'Dead';
Writeln(Players[CurrentPlayer].Rand);
LogOut;
end;
1: if FindMime then
begin
result := true;
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Rand := 'Mime';
Writeln(Players[CurrentPlayer].Rand);
LogOut;
end;
2: if FindMaze then
begin
result := true;
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Rand := 'Maze';
Writeln(Players[CurrentPlayer].Rand);
LogOut;
end;
3: FindTalk; //if FindScapeRune then <-----
//begin <-----
// result:= true; <----- No ScapeRune Finding?
// Players[CurrentPlayer].Rand:= 'ScapeRune';<-----
//end; <-----
4: //if InBlack then
begin
{result:= true;
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Loc:= 'InBlack';
Writeln(Players[CurrentPlayer].loc);
LogOut;}//Upstairs is detected as inblack.
end;
5: if NoGametab then
begin
result := true;
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Loc := 'No Gametab';
Writeln(Players[CurrentPlayer].loc);
LogOut;
end;
6: FindTalk; //Optional. Some Talking are unsolvable.
end;
if result then exit;
end;
end;

procedure Randoms;
begin
FindUnSolvableRandom;
FindNormalRandoms;
end;


procedure LoadUp;
begin
S1X1 := 464;
S1Y1 := 38;
S1X2 := 470;
S1Y2 := 52;

S2X1 := 467;
S2Y1 := 38;
S2X2 := 476;
S2Y2 := 52;

S3X1 := 470;
S3Y1 := 38;
S3X2 := 482;
S3Y2 := 52;

S4X1 := 480;
S4Y1 := 38;
S4X2 := 490;
S4Y2 := 52;

S5X1 := 487;
S5Y1 := 38;
S5X2 := 496;
S5Y2 := 52;
end;

function InEnchantArena: Boolean;
begin
if (SimilarColors(GetColor(462, 253), 26265, 4)) and
(SimilarColors(GetColor(487, 257), 26265, 4)) then
Result := True
else
begin
Writeln('Not in the enchant arena. Go place yourself there.');
Logout;
TerminateScript;
end;
end;

procedure GetPizPoints;
begin
Zero := BitmapFromString(6, 9, 'beNrLzcnOzTmTxgBBQDaECyQZGBCCQ' +
'BII4CohUhASLkskiWw4splwcYgbGGAgGwDk5i0l');
One := BitmapFromString(5, 10, 'beNpjYMjNz8VEZ9IYkNlABATIIlTh' +
'QkxGtosBAgAPNTO1');
Two := BitmapFromString(6, 10, 'beNpjYMjNz8VEZ9IYIAjOBZIMYAAX' +
'BLLhsnA2smIyuMhWIzuAARkAAEZqOw8=');
Three := BitmapFromString(5, 9, 'beNrLz83Nzz2TxgBEQAaEDSQZG' +
'BAiQDZEHM6Aq4ErgCuGG4IsiF8viA0AW3or0Q==');
Four := BitmapFromString(5, 10, 'beNrLz83NR0Fn0hjQuECAnwvXA' +
'udC1AAZcARRAJeFG4JmIERNLgDnQjI+');
Five := BitmapFromString(6, 10, 'beNrLz83NR0dn0hjgCC6CDOAiW' +
'HUhC0LUowkia0ezAtkoiHY0o0BsAAYFPFg=');
Six := BitmapFromString(7, 10, 'beNrLz80ryMNEufm5EHQmjQGIgA' +
'y4IITLwAAVRxaBcCEMoCBEDVwZsmlo2iEAzkZmYLKRDYGbzAADuQC' +
'+rEZz');
Seven := BitmapFromString(5, 10, 'beNrLz80ryENGZ9IY4AjIzc3P' +
'ZQADIBcIgFwgArIh4nAuhVIQhOACAEPjMn4=');
Eight := BitmapFromString(6, 9, 'beNrLz83Nzz2TxgBBQDaECyQZw' +
'ADCBpJAAJeFsJF1wVXi10WMORBZBhjIBQCeEjBr');
Nine := BitmapFromString(8, 10, 'beNrLz83Nx4fOpDFAEJogkGQAA2Qp' +
'IBsIMNlwLZjiyFagiUOswCqO1Rz84hDTcgEdRldV');
LoadUp;
if FindBitmapToleranceIn(Zero, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 0;
if FindBitmapToleranceIn(One, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 1;
if FindBitmapToleranceIn(Two, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 2;
if FindBitmapToleranceIn(Three, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 3;
if FindBitmapToleranceIn(Four, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 4;
if FindBitmapToleranceIn(Five, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 5;
if FindBitmapToleranceIn(Six, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 6;
if FindBitmapToleranceIn(Seven, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 7;
if FindBitmapToleranceIn(Eight, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 8;
if FindBitmapToleranceIn(Nine, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 9;


if FindBitmapToleranceIn(Zero, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 0;
if FindBitmapToleranceIn(One, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 1;
if FindBitmapToleranceIn(Two, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 2;
if FindBitmapToleranceIn(Three, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 3;
if FindBitmapToleranceIn(Four, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 4;
if FindBitmapToleranceIn(Five, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 5;
if FindBitmapToleranceIn(Six, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 6;
if FindBitmapToleranceIn(Seven, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 7;
if FindBitmapToleranceIn(Eight, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 8;
if FindBitmapToleranceIn(Nine, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 9;

if FindBitmapToleranceIn(Zero, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 0;
if FindBitmapToleranceIn(One, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 1;
if FindBitmapToleranceIn(Two, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 2;
if FindBitmapToleranceIn(Three, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 3;
if FindBitmapToleranceIn(Four, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 4;
if FindBitmapToleranceIn(Five, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 5;
if FindBitmapToleranceIn(Six, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 6;
if FindBitmapToleranceIn(Seven, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 7;
if FindBitmapToleranceIn(Eight, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 8;
if FindBitmapToleranceIn(Nine, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 9;

if FindBitmapToleranceIn(Zero, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 0;
if FindBitmapToleranceIn(One, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 1;
if FindBitmapToleranceIn(Two, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 2;
if FindBitmapToleranceIn(Three, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 3;
if FindBitmapToleranceIn(Four, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 4;
if FindBitmapToleranceIn(Five, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 5;
if FindBitmapToleranceIn(Six, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 6;
if FindBitmapToleranceIn(Seven, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 7;
if FindBitmapToleranceIn(Eight, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 8;
if FindBitmapToleranceIn(Nine, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 9;

if FindBitmapToleranceIn(Zero, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 0;
if FindBitmapToleranceIn(One, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 1;
if FindBitmapToleranceIn(Two, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 2;
if FindBitmapToleranceIn(Three, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 3;
if FindBitmapToleranceIn(Four, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 4;
if FindBitmapToleranceIn(Five, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 5;
if FindBitmapToleranceIn(Six, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 6;
if FindBitmapToleranceIn(Seven, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 7;
if FindBitmapToleranceIn(Eight, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 8;
if FindBitmapToleranceIn(Nine, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 9;
PizPointString := (IntToStr(Number1) + IntToStr(Number2) + IntToStr(Number3) + IntToStr(Number4) + IntToStr(Number5));
PizPoints := StrToInt(PizPointString);
FreeBitmap(Zero);
FreeBitmap(One);
FreeBitmap(Two);
FreeBitmap(Three);
FreeBitmap(Four);
FreeBitmap(Five);
FreeBitmap(Six);
FreeBitmap(Seven);
FreeBitmap(Eight);
FreeBitmap(Nine);
end;

procedure FreeBitmaps;
begin
FreeBitmap(Cube);
FreeBitmap(Cylinder);
FreeBitmap(Ico);
FreeBitmap(Pentamid);
Status('Bitmaps Free');
end;

function BonusShape: string;
var
ix, iy, ShapeColor: Integer;
begin
LoadBitmaps;
if FindBitmapToleranceIn(Cube, ix, iy, 450, 250, 510, 320, 10) then
Result := 'Cube';
if FindBitmapToleranceIn(Cylinder, ix, iy, 450, 250, 510, 320, 10) then
Result := 'Cylinder';
if FindBitmapToleranceIn(Ico, ix, iy, 450, 250, 510, 320, 10) then
Result := 'Ico';
if FindBitmapToleranceIn(Pentamid, ix, iy, 450, 250, 510, 320, 10) then
Result := 'Pentamid';
FreeBitmaps;
if Result = '' then
begin
Writeln('Gone to backup shape finding');
ShapeColor := GetColor(491, 291);
if SimilarColors(ShapeColor, 1056410, 10) then
Result := 'Pentamid';
if SimilarColors(ShapeColor, 1461854, 10) then
Result := 'Cube';
if SimilarColors(ShapeColor, 13984609, 10) then
Result := 'Ico';
if SimilarColors(ShapeColor, 1279245, 10) then
Result := 'Cylinder';
end;
Status('Bonus Shape was: ' + Result + ' when last at center');
CurrentBonusShape := Result;
end;

procedure GetExp;
begin
if Spell = 'Lvl1' then
RelativeEnchantAmount := 13.125;
if Spell = 'Lvl2' then
RelativeEnchantAmount := 27.75;
if Spell = 'Lvl3' then
RelativeEnchantAmount := 44.25;
if Spell = 'Lvl4' then
RelativeEnchantAmount := 50.25;
if Spell = 'Lvl5' then
RelativeEnchantAmount := 58.5;
if Spell = 'Lvl6' then
RelativeEnchantAmount := 72.75;
end;


procedure GetMageLevelAndSetSpell;
begin
MageLevel := GetSkillLevel('Magic');
Writeln('Your magic level is ' + IntToStr(MageLevel));
if MageLevel <= 6 then
begin
Writeln('Go train mage, nub. You cant even enchant!');
Logout;
TerminateScript;
end;
if (MageLevel <= 26) and (MageLevel > 5) then
begin
Writeln('Using Level 1 Enchant');
Spell := 'Lvl1';
RelativeEnchantAmount := 13.125;
end;
if (MageLevel <= 48) and (MageLevel > 26) then
begin
Writeln('Using Level 2 Enchant');
Spell := 'Lvl2';
RelativeEnchantAmount := 27.75;
end;
if (MageLevel <= 56) and (MageLevel > 48) then
begin
Writeln('Using Level 3 Enchant');
Spell := 'Lvl3';
RelativeEnchantAmount := 44.25;
end;
if (MageLevel <= 67) and (MageLevel > 56) then
begin
Writeln('Using Level 4 Enchant');
Spell := 'Lvl4';
RelativeEnchantAmount := 50.25;
end;
if (MageLevel <= 86) and (MageLevel > 67) then
begin
Writeln('Using Level 5 Enchant');
Spell := 'Lvl5';
RelativeEnchantAmount := 58.5;
end;
if (MageLevel > 86) then
begin
Writeln('Using Level 6 Enchant');
Spell := 'Lvl6';
RelativeEnchantAmount := 72.75;
end;
end;

procedure StraightWallsPlease;
var
PerfectWall,PerfectWall2, x, y, I: Integer;
begin
PerfectWall := BitmapFromString(17, 5, 'beNrLzmagCyjKziYVvX' +
'jznVREsi0Ag+ZbDA==');
PerfectWall2 := BitmapFromString2(False, 'a5765A78DAB58ECB11C' +
'02008445BE2AF1E23D1FE4B4A96831DC86161DEB00B44C44E7F31' +
'DBAF1698BDA38526E66187783CE0DEB19902620BBAFA519970492' +
'F9757C2AE34A9E4BA1513AD0DA0C838248682CFF26603690C2279' +
'541D2EE589A08D8B972ACC5FCF1BBA72D9A61B7AEFE70F27D');
MakeCompass('E');
Wait(500 + random(500));
SendArrowWait(1, 620 + random(80))
repeat
SendArrowWait(1, 10 + random(10))
Wait(200 + random(200))
I := I + 1;
until FindBitmapToleranceIn(PerfectWall, x, y, MMX1, MMY1, MMX2, MMY2, 100) or (I = 40) or FindBitmapToleranceIn(PerfectWall2, x, y, MMX1, MMY1, MMX2, MMY2, 100)
if FindBitmapToleranceIn(PerfectWall, x, y, MMX1, MMY1, MMX2, MMY2, 100) or FindBitmapToleranceIn(PerfectWall2, x, y, MMX1, MMY1, MMX2, MMY2, 100) then
begin
ReportVars[5] := ReportVars[5] + 1;
Writeln('Fixed MM Walls');
exit;
end;
if I = 40 then
begin
Writeln('Not fixed...Trying again');
end;
MakeCompass('E');
Wait(500 + random(500));
SendArrowWait(1, 620 + random(80))
I := 0;
repeat
SendArrowWait(1, 10 + random(10))
Wait(200 + random(200))
I := I + 1;
until FindBitmapToleranceIn(PerfectWall, x, y, MMX1, MMY1, MMX2, MMY2, 150) or (I = 40)
if FindBitmapToleranceIn(PerfectWall, x, y, MMX1, MMY1, MMX2, MMY2, 150) then
Writeln('Fixed MM Walls');
if I = 40 then
begin
Writeln('Not fixed...Using Make Compass');
MakeCompass('N');
end;
FreeBitmap(PerfectWall)
FreeBitmap(PerfectWall2);
end;

procedure GoToPentamids;
begin
Writeln('Walking to Pentamids');
Status('Walking to Pentamids');
x := 604 + random(2);
y := 125 + random(2);
Mouse(x, y, 1, 1, True);
flag;
GetPizPoints;
x := 614 + random(2);
y := 103 + random(2);
Mouse(x, y, 1, 1, True);
flag;
Status('At Pentamids');
PlayerLocation := 'Pentamids';
end;

procedure GoToCubes;
begin
Writeln('Walking to Cubes');
Status('Walking to Cubes');
x := 599 + random(3);
y := 36 + random(3);
Mouse(x, y, 1, 1, True);
flag;
GetPizPoints;
x := 628 + random(3);
y := 67 + random(3);
Mouse(x, y, 1, 1, True);
flag;
Status('At Cubes');
PlayerLocation := 'Cubes';
end;

procedure GoToIcos;
begin
Writeln('Walking to Icos');
Status('Walking to Icos');
x := 684 + random(2);
y := 123 + random(2);
Mouse(x, y, 1, 1, True);
flag;
GetPizPoints;
x := 659 + random(2);
y := 116 + random(2);
Mouse(x, y, 1, 1, True);
flag;
Status('At Icos');
PlayerLocation := 'Icos';
end;

procedure AntiBan; //Hy71194's because im laze-E
var
a, b: Integer;
begin
if (not LoggedIn) then exit;
b := Random(100);
case b of
0: MMouse(random(MSX2), random(MSY2), 0, 0);
1: MouseSpeed := 9 + Random(3);
2: HoverSkill('random', false);
5: PickupMouse;
6: MouseSpeed := 9 + Random(3);
7: MouseSpeed := 9 + Random(3);
8: MMouse(random(MSX2), random(MSY2), 0, 0);
9: Wait(1 + Random(100));
10: begin
GameTab(1 + random(12));
for a := 0 to 6 do
begin
Wait(300 + Random(200));
end;
GameTab(4);
end;
end;
end;


procedure GoToCylinders;
begin
Writeln('Walking to Cylinders');
Status('Walking to Cylinders');
x := 690 + random(3);
y := 35 + random(3);
Mouse(x, y, 1, 1, True);
flag;
GetPizPoints;
x := 655 + random(3);
y := 71 + random(3);
Mouse(x, y, 1, 1, True);
flag;
Status('At Cylinders');
PlayerLocation := 'Cylinders';
end;

procedure GoToRandom;
begin
case random(4) of
0:
begin
GoToCubes;
CurrentBonusShape := 'Cube';
end;
1:
begin
GoToIcos;
CurrentBonusShape := 'Ico';
end;
2:
begin
GoToPentamids;
CurrentBonusShape := 'Pentamid';
end;
3:
begin
GoToCylinders;
CurrentBonusShape := 'Cylinder';
end;
end;
Status('Bonus Shape: ' + CurrentBonusShape);
end;

function ShopOutOfStock: Boolean;
begin
if (SimilarColors(GetColor(282, 193), 65535, 2)) and
(SimilarColors(GetColor(286, 194), 65535, 2)) and
(SimilarColors(GetColor(285, 198), 65535, 2)) and
(SimilarColors(GetColor(284, 191), 65535, 2)) then
begin
Status('Detected the stock of cosmics at 0');
Result := True
Writeln('The Shop is outa stock fool');
end
else
Result := False;
end;

function NotEnoughEnchantPoints: Boolean;
begin
end;

procedure Endme;
begin
Writeln(' All finished =P ');
Writeln(' Thanks for using Sp0rk-ehs ');
Writeln(' Mage Arena Enchanter ');
wait(2000);
Writeln('Please post progress reports!');
Writeln('http://www.srl-forums.com/forum/sp0rkys-mage-arena-t20212.html');
end;


procedure WalkToShapeFromCenter;
begin
Status('Walking To Shape');
if BonusShape = 'Cube' then
begin
GoToCubes;
Exit;
end;
if BonusShape = 'Cylinder' then
begin
GoToCylinders;
Exit;
end;
if BonusShape = 'Ico' then
begin
GoToIcos;
Exit;
end;
if BonusShape = 'Pentamid' then
begin
GoToPentamids;
Exit;
end;
if BonusShape = '' then
begin
Writeln('Fuckit, cant find a shape. Going random');
GoToRandom;
end;
end;

procedure TakeShapesBac;
var
ShapeText: string;
CouldntFindColor, TimesClickedShape: Integer;
begin
Status('Taking Shapes from the Pile');
TimesClickedShape := 0;
if (not (LoggedIn)) then exit;
if CurrentBonusShape = 'Cylinder' then
begin
ShapeText := 'linder';
ShapeColor := 1144589;
end;
if CurrentBonusShape = 'Cube' then
begin
ShapeText := 'ube';
ShapeColor := 1550786;
end;
if CurrentBonusShape = 'Ico' then
begin
ShapeText := 'cosa';
ShapeColor := 11752531;
end;
if CurrentBonusShape = 'Pentamid' then
begin
ShapeText := 'tami';
ShapeColor := 1716197;
end;
repeat
begin
if (not (LoggedIn)) then exit;
wait(100 + random(50));
if FindColorSpiralTolerance(x, y, ShapeColor, 5, 70, 515, 249, 4)
then
begin
MMouse(x, y, 1, 1);
wait(50 + random(25));
if IsUpText(ShapeText) then
Mouse(x, y, 1, 1, True)
TimesClickedShape := TimesClickedShape + 1;
Status('Clicked Shape Pile: ' + IntToStr(TimesClickedShape) + ' times');
flag;
wait(50 + random(50));
end
else
begin
CouldntFindColor := CouldntFindColor + 1;
Writeln('Cant Find Color');
if CouldntFindColor > 2 then
begin
Writeln('Really cant find color! It must not be in the middle of the screen')
Writeln('Tried to fix too many times, Giving up');
Logout;
TerminateScript;
Exit;
end;
end;
end;
until InvFull;
end;



{*******************************************************************************
function FindMMColorTol(var x, y: Integer; color, tol: Integer): Boolean;
By: Stupid3ooo
Description: Finds color on Minimap with tolerance
*******************************************************************************}

function FindMMColorTol(var x, y: Integer; color, tol: Integer): Boolean;
begin
Result := FindColorTolerance(x, y, color, MMX1, MMY1, MMX2, MMY2, tol);
end;


function FindCenter: Boolean;
begin
if (not (LoggedIn)) then exit;
if FindMMColorTol(x, y, 9011075, 7) then
begin
Status('Center Found... Walking Back')
Result := True;
Mouse(x + random(2), y + random(10), 1, 1, True);
Flag;
PlayerLocation := 'At Center';
end
else
begin
Result := False;
Writeln('Center Not Found... Logging')
Logout;
Status('Center Not Found... Logged Character Out')
end;
end;

procedure WalkBackToCenter;
begin
if PlayerLocation = 'Cylinders' then
begin
Status('Walking from Cylinders to center')
Mouse(615 + random(2), 113 + random(2), 1, 1, True);
flag;
GetPizPoints;
if (not (FindCenter)) then
begin
Status('Didnt find center. Walking then trying again')
Mouse(601 + random(2), 118 + random(2), 1, 1, True);
flag;
FindCenter
end;
end;
if PlayerLocation = 'Cubes' then
begin
Status('Walking from Cubes to center')
Mouse(678 + random(2), 110 + random(2), 1, 1, True);
flag;
GetPizPoints;
if (not (FindCenter)) then
begin
Status('Didnt find center. Walking then trying again')
Mouse(671 + random(2), 125 + random(2), 1, 1, True);
flag;
FindCenter;
end;
end;
if PlayerLocation = 'Pentamids' then
begin
Status('Walking from Pentamids to center')
Mouse(669 + random(2), 49 + random(2), 1, 1, True);
flag;
GetPizPoints;
if (not (FindCenter)) then
begin
Status('Didnt find center. Walking then trying again')
Mouse(690 + random(2), 38 + random(2), 1, 1, True);
flag;
FindCenter;
end;
end;
if PlayerLocation = 'Icos' then
begin
Status('Walking from Icos to center');
Mouse(607 + random(2), 55 + random(2), 1, 1, True);
flag;
GetPizPoints;
if (not (FindCenter)) then
begin
Status('Didnt find center. Walking then trying again')
Mouse(611 + random(2), 50 + random(2), 1, 1, True);
flag;
FindCenter;
end;
end;
end;

procedure BuyProg;
begin
ClearDebug;
Writeln('------------------------------------------');
Writeln('- Sp0rk-ehs Mage Arena Enchanter -');
Writeln('- Buy Mode -');
Writeln('- Worlds Hopped : ' + IntToStr(WorldsHopped));
Writeln('- Cosmics Bought: ' + IntToStr(CosmicsBought));
Writeln('------------------------------------------');
end;

function CheckPoints: Boolean;
begin
if FindBlackChatMessage('cannot afford that ite') then
begin

LogOut;
BuyProg;
Writeln('All out of points - Bought max amount');
TerminateScript;
end;
end;

function MageTrainingArenaShopScreen: Boolean;
var
ArenaShop,iix,iiy : Integer;
begin
ArenaShop := BitmapFromString2(False, 'a730CD78DAED985DAE83' +
'201085B70422033EA2A9FB5FD26530B9B1B1D883E05FA50F27649' +
'CA2CE5798438510524AE13FC3E845D997575283576D89C7A2E571' +
'CBF1D63A1EF79C4EB26165118D0D393A7C6BA4FF78AB7966D385C' +
'C5EF338CC434686F9158F5F96E39AEF6E8C172906CE6C3BD7374E' +
'13EDA8DA1932B751E33AB285E72C5549E914695CDDE824A9492BE' +
'583F454D6F8FC3EB5517DA5BCD4A932735DCFDC9BEC0785F9BEBD' +
'45A53CA7B61A8FD23F92F5A6B59CC0FA617C6357A3F997DFB121D' +
'68FA49C9CBFF7BAAE94CFA27CA41FCBF65D31FA506F82DDCB3207' +
'713BA9EE28DF77A53EFF362FB48C7FC8CF765FC8D32678CE03E36' +
'529E7F7657C8744584F4C7328A75EC557598EABC1D9955ACB65DF' +
'EB2DBE89723413A68C74DE5294B7552FF5B77169CAAB67EA28E54' +
'5173E813290839FCBF00A24EC72D7A4BC7068D05A4EA49C5A79A8' +
'9E897D3FFF5EB13973286F7383882BFBE218F1BA659CA47E566FF' +
'B1FF8971554293F81F29C75A5FCDB94AB56CA95FB4D2843DDB932' +
'BD2D655CFF00A09');

if SimilarColors(GetColor(483, 35), 39423, 15) or FindBitmapToleranceIn(ArenaShop,iix,iiy,MSX1,MSY1,MSX2,MSY2,30) then
begin
Result := True;
end
else
begin
Writeln('Mage Training Arena Shop Window Not Found.');
Status('Mage Training Arena Shop Window Not Found.');
Result := False
end;
FreeBitmap(ArenaShop);
end;

procedure AntiBan2; //Hy71194's because im laze-E
var
a, b: Integer;
begin
if (not LoggedIn) then exit;
b := Random(100);
case b of
0: MMouse(random(MSX2), random(MSY2), 0, 0);
1:
begin
HoverSkill('magic', false);
GameTab(4);
end;
2:
begin
HoverSkill('random', false);
GameTab(4);
end;
5: PickupMouse;
6: MouseSpeed := 20 + Random(3);
7: MouseSpeed := 22 + Random(3);
8: MMouse(random(MSX2), random(MSY2), 0, 0);
9: Wait(1 + Random(100));
10: begin
GameTab(1 + random(12));
begin
Wait(300 + Random(200));
end;
GameTab(4);
end;
end;
end;

procedure BuyCosmics;
var
Bought, CosmicRune, ix, iy: Integer;
begin
if (not (LoggedIn)) then exit;
wait(2000 + random(1000));
if MageTrainingArenaShopScreen then
begin
CosmicRune := BitmapFromString(12, 9, 'beNptzmsKgzAQBOBzeMk' +
'qIhobX/HRNFUrpSi9nPQqDowsgRbmxzL7keweLMOAfPfgfbfI+nDb' +
'NCKf54yScU0tM/DLWoRY+luhZR6NmbuOL1Oy76+5GDJf+qvfgFH+3' +
'dqqxJEIHmSj49gH+BoXglGyzKNIQJ2mrVJglNJn4UXmMknIKM/+AP' +
'QJtrA=');
if FindBitmapToleranceIn(CosmicRune, x, y, MSX1, MSY1, MSX2, MSY2, 100) then
begin
MMouse(x, y, 1, 1);
Writeln('Found Cosmic Bitmap');
end;
FreeBitmap(CosmicRune);
wait(250 + random(50));
if IsUpText('osmic') then
repeat
begin
if (not (LoggedIn)) then exit;
if random(4) > 2 then
begin
AntiBan2;
end;
ix := x;
iy := y;
ix := ix + random(15);
iy := iy + random(15);
Mouse(ix, iy, 1, 1, False);
wait(40 + random(20));
ChooseOption('uy');
wait(30 + random(20));
Bought := Bought + 1;
CosmicsBought := CosmicsBought + 1;
Status('Bought: ' + IntToStr(Bought) + ' cosmics');
CheckPoints;
ReportVars[3] := Bought;
end
until (bought = 105) or ShopOutOfStock or (not (MageTrainingArenaShopScreen)) or FindBlackChatMessage('stock');
mousespeed := 10;
end
else
begin
Writeln('Mage screen or guardian fuckup.');
Logout;
end;
end;

procedure TakeShapes;
var
ShapeText: string;
CouldntFindColor, TimesClickedShape: Integer;
begin
Status('Taking Shapes from the Pile');
TimesClickedShape := 0;
if (not (LoggedIn)) then exit;
if CurrentBonusShape = 'Cylinder' then
begin
ShapeText := 'linder';
ShapeColor := 1144589;
end;
if CurrentBonusShape = 'Cube' then
begin
ShapeText := 'ube';
ShapeColor := 1550786;
end;
if CurrentBonusShape = 'Ico' then
begin
ShapeText := 'cosa';
ShapeColor := 11752531;
end;
if CurrentBonusShape = 'Pentamid' then
begin
ShapeText := 'tami';
ShapeColor := 1716197;
end;
repeat
begin
if (not (LoggedIn)) then exit;
wait(100 + random(50));
if FindColorSpiralTolerance(x, y, ShapeColor, 5, 70, 515, 249, 4)
then
begin
MMouse(x, y, 1, 1);
wait(50 + random(25));
if IsUpText(ShapeText) then
Mouse(x, y, 1, 1, True)
TimesClickedShape := TimesClickedShape + 1;
Status('Clicked Shape Pile: ' + IntToStr(TimesClickedShape) + ' times');
flag;
wait(50 + random(50));
end
else
begin
CouldntFindColor := CouldntFindColor + 1;
Writeln('Cant Find Color');
if CouldntFindColor > 2 then
begin
Writeln('Really cant find color! It must not be in the middle of the screen')
Writeln('Walking back and re-calibrating Minimap Walls');
InEnchantArena;
WalkBackToCenter;
InEnchantArena;
StraightWallsPlease;
InEnchantArena;
WalkToShapeFromCenter;
InEnchantArena;
TakeShapesBac;
FixedTimes := FixedTimes + 1;
if FixedTimes > 4 then
begin
Writeln('Tried to fix too many times, Giving up');
Logout;
TerminateScript;
Exit;
end;
end;
end;
end;
until InvFull;
end;

procedure AssignXandY;
begin
if Spell = 'Lvl1' then
begin
x := 685 + random(8);
y := 234 + random(8);
end;
if Spell = 'Lvl2' then
begin
x := 613 + random(8);
y := 281 + random(8);
end;
if Spell = 'Lvl3' then
begin
x := 566 + random(8);
y := 329 + random(8);
end;
if Spell = 'Lvl4' then
begin
x := 589 + random(8);
y := 353 + random(8);
end;
if Spell = 'Lvl5' then
begin
x := 612 + random(8);
y := 400 + random(8);
end;

if Spell = 'Lvl6' then
begin
x := 685 + random(8);
y := 425 + random(8);
end;
end;

procedure CheckCosmics;
begin
if Spell = 'Lvl1' then
begin
if SimilarColors(GetColor(691, 235), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl2' then
begin
if SimilarColors(GetColor(619, 282), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl3' then
begin
if SimilarColors(GetColor(570, 330), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl4' then
begin
if SimilarColors(GetColor(594, 354), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl5' then
begin
if SimilarColors(GetColor(618, 400), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl6' then
begin
if SimilarColors(GetColor(690, 426), 71961, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
end;

procedure EnchantInventory;
var
ShapeColorInInvent: Integer;
begin
if (not (LoggedIn)) then exit;
if CurrentBonusShape = 'Cube' then
ShapeColorInInvent := 2921394;
if CurrentBonusShape = 'Pentamid' then
ShapeColorInInvent := 1319850;
if CurrentBonusShape = 'Ico' then
ShapeColorInInvent := 9848132;
if CurrentBonusShape = 'Cylinder' then
ShapeColorInInvent := 1344269;
GameTab(7);
repeat
if (not (LoggedIn)) then exit;
AssignXandY;
wait(900 + random(100));
if (not GameTab(7)) then
begin
GameTab(7);
end;
CheckCosmics;
MMouse(x, y, 0, 0);
if IsUpText('ant') then
begin
Mouse(x, y, 1, 1, True);
wait(100 + random(50))
if FindColorSpiralTolerance(x, y, ShapeColorInInvent, 694, 434, 717, 454, 4) then
begin
x := 693 + random(20)
y := 435 + random(20)
Mouse(x, y, 1, 1, True);
ShapesEnchanted := ShapesEnchanted + 1;
ShapesEnchanted2 := ShapesEnchanted2 + 1;
ReportVars[1] := ShapesEnchanted2;
Status('Shapes enchanted this trip:' + IntToStr(ShapesEnchanted2));
end
end
until FindColorSpiralTolerance(x, y, 16316664, 694, 434, 717, 454, 4)
GameTab(4);
Status('All shapes in inventory enchanted!');
end;

procedure DepositOrbs;
var
Found: Boolean;
begin
if (not (LoggedIn)) then exit;
repeat
if (not (LoggedIn)) then exit;
wait(100 + random(100));
GetPizPoints;
if FindColorSpiralTolerance(x, y, 8685966, 5, 6, 511, 332, 4) then
MMouse(x, y, 1, 1);
if IsUpText('ole') then
begin
Found := True;
Status('Found orb deposit hole');
Mouse(x, y, 1, 1, True);
flag;
wait(500 + random(100));
Status('Orbs deposited');
ClickToContinue;
wait(400 + random(100));
ClickToContinue;
end;
until Found;
TripsDone := TripsDone + 1;
ReportVars[0] := ReportVars[0] + 1;
end;

procedure CloseCosmicWindow;
begin
if (not (LoggedIn)) then exit;
Status('Closing mage arena buy screen');
x := 475 + random(9);
y := 30 + random(9);
MMouse(x, y, 1, 1)
wait(500 + random(200));
if IsUpText('lose') then
begin
Mouse(x, y, 1, 1, True);
Status('Mage Arena buy screen closed.');
wait(500 + random(200));
end;
end;

procedure FindPortal;
var
Tries: Integer;
Clicked: Boolean;
begin
Status('Trying to find enchant arena portal. Tried: ' + IntToStr(Tries) + ' times');
repeat
if (not (LoggedIn)) then exit;
if FindColorSpiralTolerance(x, y, 1842975, 20, 20, 338, 333, 3) then
begin
wait(250 + random(100))
MMouse(x, y, 1, 1)
Tries := Tries + 1;
Status('Trying to find enchant arena portal. Tried: ' + IntToStr(Tries) + ' times');
if IsUpText('chant') then
begin
Mouse(x, y, 1, 1, True)
Flag;
wait(1000 + random(1000));
Clicked := True;
Status('Enchant Arena Re-Entered');
end;
end;
until (Clicked) or (Tries > 20);
end;

procedure WalkToEnchantChamber;
begin
if (not (LoggedIn)) then exit;
SetRun(True);
if FindSymbol(x, y, 'minigame') then
begin
Status('Found minigame symbol');
Mouse(x - 40, y, 1, 1, True)
Flag;
end
else
begin
Writeln('Didnt find minigame symbol. Co-ords.');
Status('Using co-ords to walk to portal');
Mouse(620 + random(1), 15 + random(1), 1, 1, True)
wait(2000 + random(100));
flag;
end;
FindPortal;
end;

{*******************************************************************************
procedure OrderBy(Which, UpDown: string);
By: WT-Fakawi
Description: Orders Display.
*******************************************************************************}

procedure OrderBy(Which, UpDown: string);
var
Origin, OBx, OBy: Integer;
begin
case Which of
'world':
begin
case UpDown of
'up': Origin := 284;
'down': Origin := 297;
end
end;
'players':
begin
case UpDown of
'up': Origin := 393;
'down': Origin := 409;
end
end;
'location':
begin
case UpDown of
'up': Origin := 503;
'down': Origin := 519;
end
end;
'type':
begin
case UpDown of
'up': Origin := 613;
'down': Origin := 629;
end
end;
end;

MMouse(Origin, 7, 7, 7)
GetMousePos(OBx, OBy);
repeat
Mouse(OBx, OBy, 0, 0, True);
Wait(500);
until FindColorSpiralTolerance(OBx, OBy, 2851375, Origin, 7, Origin + 7, 7 + 7, 50);
end;

procedure TradeWithRewardsGuardian;
var
tries: Integer;
begin
if (not (LoggedIn)) then exit;
repeat
if (not (LoggedIn)) then exit;
wait(100 + random(100));
if FindColorSpiralTolerance(x, y, 5479603, 5, 6, 511, 332, 4) then
begin
Status('Moving mouse to rewards guardian');
MMouse(x, y, 1, 1);
tries := tries + 1;
if IsUpText('ewa') then
begin
Status('Rewards guardian found');
Mouse(x, y, 1, 1, False);
ChooseOption('rade')
flag;
Status('Chose to trade with guardian');
wait(1000 + random(500));
Exit;
end;
end;
until tries > 10;
Writeln('Couldnt find guardian');
Logout;
end;

procedure ChooseRandomWorld;
begin
Status('Choosing a random world');
case random(28) of
0: Mouse(388, 343, 2, 2, True)
1: Mouse(388, 366, 2, 2, True)
2: Mouse(388, 390, 2, 2, True)
3: Mouse(393, 411, 2, 2, True)
4: Mouse(393, 436, 2, 2, True)
5: Mouse(395, 459, 2, 2, True)
6: Mouse(394, 481, 2, 2, True)
7: Mouse(484, 44, 2, 2, True)
8: Mouse(489, 68, 2, 2, True)
9: Mouse(484, 90, 2, 2, True)
10: Mouse(493, 115, 2, 2, True)
11: Mouse(488, 135, 2, 2, True)
12: Mouse(493, 159, 2, 2, True)
13: Mouse(488, 181, 2, 2, True)
14: Mouse(489, 204, 2, 2, True)
15: Mouse(487, 227, 2, 2, True)
16: Mouse(494, 250, 2, 2, True)
17: Mouse(488, 272, 2, 2, True)
18: Mouse(490, 293, 2, 2, True)
19: Mouse(501, 324, 2, 2, True)
20: Mouse(486, 345, 2, 2, True)
21: Mouse(487, 367, 2, 2, True)
22: Mouse(486, 391, 2, 2, True)
23: Mouse(489, 386, 2, 2, True)
24: Mouse(481, 412, 2, 2, True)
25: Mouse(478, 438, 2, 2, True)
26: Mouse(486, 456, 2, 2, True)
27: Mouse(478, 481, 2, 2, True)
end;
end;

procedure ClickWorldSwitchButton;
begin
MMouse(8, 466, 90, 25);
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
repeat
Wait(10);
until (GetColor(17, 477) = 0);
end;

//Ty pwnaz0r

function ExToStr(i: integer; e: extended): string;
begin
result := FloatToStr(i * e);
end;
//Ty pwnaz0r

function NumToStr(i: integer; e: extended): string;
begin
result := IntToStr(Ceil(i * e));
end;

procedure Report;
begin
ClearReport;
AddToReport('/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\');
AddToReport('| Visit srl-forums.com |');
AddToReport('| for script updates |');
AddToReport('| ~Sp0rky~ |');
if (SrlStatsID = '') or (SrlStatsPassword = '') then
begin
AddToReport('|Please register for srl stats!|');
end;
AddToReport('| Thank you for using: |');
AddToReport('| M.A.E. v0.2 |');
AddToReport('\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/');
end;





procedure ProgressReport;
begin
ClearDebug;
Writeln('------------------------------------------');
Writeln('-Sp0rk-ehs Mage Arena Enchanter-');
Writeln('-Trips Done : ' + IntToStr(TripsDone));
WriteLn('-TimeRunning : ' + TimeRunning);
Writeln('-Enchanted : ' + IntToStr(ShapesEnchanted) + ' Shapes.');
Experience := NumToStr(ShapesEnchanted, RelativeEnchantAmount);
ExperienceThisTrip := NumToStr(ShapesEnchanted2, RelativeEnchantAmount);
Writeln('-Gained approx. : ' + Experience + ' Magic Exp.');
Writeln('-Pizzaz points : ' + IntToStr(PizPoints));
ReportVars[2] := StrToInt(ExperienceThisTrip);
Writeln('-Logged back in : ' + IntToStr(TimesLogged) + ' times.');
Writeln('------------------------------------------');
ShapesEnchanted2 := 0;
end;

begin
ClearDebug;
SetupSRL;
ActivateClient;
mousespeed := 10;
wait(1000);
DeclarePlayers;
if (SrlStatsID = '') or (SrlStatsPassword = '') then
begin
Writeln('Reverting to default Srl Stats Id + Password');
SrlStatsID := '2733';
SrlStatsPassword := '1337';
end;
ScriptID := '437';
SRLID := SrlStatsID;
SRLPassword := SrlStatsPassword;
wait(5000);
if Mode = 'Arena' then
begin
LoginPlayer;
Writeln('Arena Mode Initiated...');
if InEnchantArena then
begin
if (WhichSpellToCast = ('Auto')) or (WhichSpellToCast = ('auto')) then
begin
GetMageLevelAndSetSpell;
end
else
begin
Spell := WhichSpellToCast;
Writeln('Casting ' + Spell + ' Spell.');
GetExp;
end;
repeat
LoginPlayer;
WalkToShapeFromCenter;
InEnchantArena;
TakeShapes;
AntiBan;
InEnchantArena;
EnchantInventory;
AntiBan;
WalkBackToCenter;
InEnchantArena;
DepositOrbs;
AntiBan;
ProgressReport;
SrlRandomsReport;
Report;
if (not (LoggedIn)) then
begin
if TimesLogged > 2 then
begin
Writeln('Logged in too many times. Terminating for the safety of the user');
Players[CurrentPlayer].Active := False;
break;
end;
Writeln('Logging Player Back In');
Players[CurrentPlayer].Active := True;
wait(15000 + random(5000));
LoginPlayer;
Randoms;
TimesLogged := TimesLogged + 1;
WalkToEnchantChamber;
Randoms;
FindCenter;
end;
until (false) or (ShapesEnchanted >= NumberOfCosmics);
end;
end;

if Mode = 'Buy' then
begin
Writeln('Buy Mode Initiated...');
repeat
if (not (LoggedIn)) then
begin
Status('Clicking the worldswitch button');
ClickWorldSwitchButton;
Status('Ordering by players and type');
OrderBy('players', 'down');
OrderBy('type', 'down');
ChooseRandomWorld;
wait(2000);
Status('Logging player');
LoginPlayer;
WorldsHopped := WorldsHopped + 1;
ReportVars[4] := ReportVars[4] + 1;
end;
HighestAngle;
Randoms;
if (not (InBlack)) then
begin
Writeln('Go put yourself next to the rewards guardian');
TerminateScript;
end;
TradeWithRewardsGuardian;
Wait(2000+random(500));
BuyCosmics;
CloseCosmicWindow;
Randoms;
Logout;
BuyProg;
SrlRandomsReport;
Report;
until (CosmicsToBuy <= CosmicsBought);
end;
Endme;
end.

xtrapsp

2013-03-27 07:11:07

This is a good base to make a script. Why don't you read some tutorials and write it yourself :)

samerdl

2013-03-27 07:58:36

Wow nice script! really hope some pro makes use of it

From: xtrapsp
This is a good base to make a script. Why don't you read some tutorials and write it yourself :)


The tutorials are vague ;) its best to learn C then Pascal then use it on simba

xtrapsp

2013-03-27 07:59:14

From: samerdl

The tutorials are vague ;)


The tutorials really aren't vague. You just aren't reading them properly

Fade03

2013-03-27 08:01:37

Don't argue, help me find a guy who could fix this one. Its an amazing script, ran flawless for me though nights back in the day. I dont know anything about programming.

Turpinator

2013-03-27 08:06:29

Looks like release/update date was oct 31, 07… So this should work right away with no problems… provided the functions still exist.

Soo looking it over… Scar. A few updates to the bitmap functions… and… it should work?

restyler

2013-03-27 10:47:33

Im not a scripter so dont blame me if this is all shit but I found these aswell :

https://github.com/GitBraK/SRL-Forms/blob/68bf0c8f83e9f366e7af621de98f7e78d45e5d0a/Awkwardsaw%20MTA/MTA%20Uncomplete.simba
https://github.com/Awkwardsaw/Awkwardsaw/blob/19a9a5e92a44629a4c1bacae4bb1045d15264458/SRL_Scripts/MTA%20Enchanter.simba

Fade03

2013-03-27 10:51:33

Have you tried the second one?

restyler

2013-03-27 10:54:11

Didnt do anything with them, just searched them so maybe someone whose more experienced with this can make it work ;p

Anatomical

2013-03-27 13:42:11

So did that second one i found work?

This seems like a good idea.

Fade03

2013-03-28 07:29:06

The second script you posted is the same as mine one needs some modification in the code. But I don't have experience and can't do it. If anyone could help plz reply.

Runehack123

2013-03-28 07:45:14

i think if you modify this you could definitely get it to work
I might give it a go.

PoppaSquatch

2013-03-28 15:57:54

*cheers on Runehack123*

michiganz

2013-03-29 09:58:03

would you make money doing this as well?

PYPJosh

2013-04-20 13:10:53

Has anyone fixed this script yet? Im looking for a MTA script but no one as uploaded one as of yet.

(sorry for waking up old thread)

maikel233

2013-04-21 16:59:46

I dont think so, But i think you could easily edit it, The base and most part of the code is aready there!

samerdl

2013-04-30 13:48:32

From: xtrapsp
The tutorials really aren't vague. You just aren't reading them properly


To be honest, one month later - your right. I said that because at that time i broke my head trying to understand scripts without knowing pascal, so i just learned it (pascal) in no relation to simba/runescape, and then re-read the tutorials, they are great and are very informative and helpful.
I can actually understand tpa's and their usage now :D


Edit: i am curious to know if you still want this revived?

I could help but i don't really 'understand' how the mage arena works, i've been there for 30 minutes now, on the original topic it says it will start in center of arena then run to the bonus shape (whats the bonus shape lol?) i can't revert the bitmaps for some reason so i don't know what hes aiming at with them, maybe you can explain to me please

anyway heres a version that compiles, it wont work though, we have to change few colors/bitmaps to make it work, but help us understand what colors/bitmaps is he referring to: Cube, Cylinder,Ico etc.. What are these?

heres the version that compiles with srl-osr.

{.Script Info:
# ScriptName = Mage Arena Enchanter
# Author = Sp0rk-eh
# Description = Enchants in the mage training arena (near the dueling arena)
# Version = 0.2
# Date = 31 October 2007
# Comments = N/A
/Script Info}


{Make sure your minimap is as perfect north as possible!}
{!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
{|}{|}
{|}{O.Start the Arena mode in the center of the Enchant Arena}{|}
{|}{O.Have cosmics in the first inventory slot, and no other items}{|}
{|}{O.Start the Buy mode next to the Rewards Guardian}{|}
{|}{|}
{!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
//Please post progress reports. They make me happy.

{Credits:
Pwnaz0r - providing some functions + chatter on msn
Dave - testing
Hy71194 - antiban
King Of Knives - inspiration of mm walls/procedure}

program MageArenaEnchanterBySp0rky;
{$I SRL-OSR/SRL.Simba}

const
//You may edit this
Mode = 'Arena'; //Arena or Buy

var
Cube, Cylinder, Ico, Pentamid, ShapeColor, TripsDone, iX, iY, x, y: Integer;
CurrentBonusShape, PlayerLocation, Chat, Namez, Spell, Experience, ExperienceThisTrip: string;
SrlStatsID, SrlStatsPassword, WhichSpellToCast: string;
DragonStones: Boolean;
ShapesEnchanted, TimesLogged, MageLevel, NumberOfCosmics, CosmicsToBuy, CosmicsBought: Integer;
RelativeEnchantAmount: Extended;
S2X1, S2X2, S2Y1, S2Y2, Nine, Number1, Number2, Number3, Number4, Number5, Zero, One, Two, Three, Four, Five, Six, Seven, Eight: Integer;
S1X1, S1X2, S1Y1, S1Y2, FixedTimes: Integer;
S3X1, S3X2, S3Y1, S3Y2: Integer;
S4X1, S4X2, S4Y1, S4Y2: Integer;
S5X1, S5X2, S5Y1, S5Y2: Integer;
PizPointString: string;
ReportVars,PizPoints, ShapesEnchanted2, WorldsHopped: Integer;


//And edit this

procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;

Players[0].Name := ''; // RS UserName
Players[0].Pass := ''; // RS Password
Players[0].Nick := '';

NumberOfCosmics := 85; //Number of cosmics you have in your inventory
CosmicsToBuy := 10000; //Number of cosmics to buy (5 enchant points per cosmic)
WhichSpellToCast := 'Auto' //Accepted = Auto, Lvl1, Lvl2, Lvl3, Lvl4, Lvl5, Lvl6

Players[0].Active := True; // Don't change

SrlStatsID := ''; //If you dont have these, just leave them blank.
SrlStatsPassword := ''; //If you dont have these, just leave them blank.

end;

//-------Do not edit beyond this point unless you know what you're doing!-------------
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------


procedure LoadBitmaps;
begin
Cube := BitmapFromString(100,150,'aA598978DA7DD04B0EC330080' +
'4D02B61FE5E5227B9FF910A4DD4A6A2EAE6098D18191900203C01' +
'590945A4AA5AC12B11AF199D3FC951896295D828B525957845FAA' +
'8796C5B692CC03448778931BBCEBA103C0CBF1561FDD3523D72B3' +
'79B66CC83ED6DDEB95E60C3B502438DEADA9F4CB09664877AF96E' +
'8C89DA66FC648DD7EDB7561FB81D3C84BD19EF4D');
Cylinder := BitmapFromString(100,150,'a690AD78DAC5913B0EC42' +
'00C44AF34FC0C9410C2FD8FB41E570959A495526CF3341AFC2C4B' +
'00C03C14E845115A534A3D95E964933AB32032676B8AB009B47CB' +
'13E31A769BDE7B29883B2A02AB3E7AB4CCBD1B6355AD2139B4AC1' +
'8DC16D72606471C028DE0514C918DA78365B9E0BEF966CF8C2B2D' +
'BBE5DB8B12EF377EB87DBAEAEF4D7565BF9B8ED7FD6637EFDA30F' +
'DAB');
Ico := BitmapFromString(100,150,'a6BB6D78DA9DD2498E03210C05' +
'D02B19F067581A07EE7FA4368322A24ABA53BD792A996F0B28888' +
'84A30886184DE4C4431A3F3A6CF3C2AD0618FA3EE67FC51C6F7EC' +
'4DE8239946C68B40A08A17154DE5D4918BE58DA8B69AB60555C3D' +
'25643B9213244DD7254B2FE4F306295253B0EB9CF7AB92B3C420D' +
'4B8E9C8A6C2BAB303D2CE3BF911B48743B7BB9C34BBB6A7B46CDD' +
'64549AEEEDEE94A9EBEB90720579D7BC09CE0979C381775CD45B4' +
'99ECBF8B8852B79FCE7877CE731AA576FAC70BB9BED2E5FC47E75' +
'DCD97199F7E3B27802BCE73FD0092C');
Pentamid := BitmapFromString(100,150,'aD40BE78DA6D8E4112C42' +
'00804BF0428A0C710E3FF9FB40E6EED7AC8A5996A0121229AF702' +
'455BA886A80DC5A8820AAFF50127BC46668797861ED5FBF76A921' +
'B14B440F19CF5C86DCEC86520CF0E5EF034400E7161A3E1F6671F' +
'424C5F7FF0EA52B8BCF87501177B9037B779F1357DD282CB3284B' +
'F4E6EBF6F38F90141C');
Status('Loaded Bitmaps');
end;

function FindFastRandoms: Boolean; // By WT-Fakawi.

var
i: Integer;

begin
for I := 1 to 10 do
begin
case I of
1: if FindDead then
Result := True;

2: if FindMod then
begin
Result := True;
Writeln('Mod Found');
end;
3: if Findnormalrandoms then
Result := True;

4: if Findnormalrandoms then
Result := True;

5: if Findnormalrandoms then
Result := True;

6: if Findnormalrandoms then
Result := True;

7: begin
if (not(TabExists(tab_inv))) then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;

8: if RC then
Result := True;

9: if Srl_infight then
begin
Result := True;
Mouse(625 + random(10), 35 + random(10), 1, 1, True);
Flag;
end;

10: if FindTalk then
Result := True;

end;
Wait(1);
end;
end;


function FindUnSolvableRandom: boolean;
var
c: integer;
begin
if not LoggedIn then exit;
for c := 0 to 6 do
begin
case c of
0: if FindDead then
begin
result := true;
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Loc := 'Dead';
Writeln(Players[CurrentPlayer].Rand);
LogOut;
end;
1: if Findnormalrandoms then
begin
result := true;
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Rand := 'Mime';
Writeln(Players[CurrentPlayer].Rand);
LogOut;
end;
2: if Findnormalrandoms then
begin
result := true;
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Rand := 'Maze';
Writeln(Players[CurrentPlayer].Rand);
LogOut;
end;
3: FindTalk; //if FindScapeRune then <-----
//begin <-----
// result:= true; <----- No ScapeRune Finding?
// Players[CurrentPlayer].Rand:= 'ScapeRune';<-----
//end; <-----
4: //if InBlack then
begin
{result:= true;
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Loc:= 'InBlack';
Writeln(Players[CurrentPlayer].loc);
LogOut;}//Upstairs is detected as inblack.
end;
5: if (not(TabExists(tab_inv))) then
begin
result := true;
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Loc := 'No Gametab';
Writeln(Players[CurrentPlayer].loc);
LogOut;
end;
6: FindTalk; //Optional. Some Talking are unsolvable.
end;
if result then exit;
end;
end;

procedure Randoms;
begin
FindUnSolvableRandom;
FindNormalRandoms;
end;


procedure LoadUp;
begin
S1X1 := 464;
S1Y1 := 38;
S1X2 := 470;
S1Y2 := 52;

S2X1 := 467;
S2Y1 := 38;
S2X2 := 476;
S2Y2 := 52;

S3X1 := 470;
S3Y1 := 38;
S3X2 := 482;
S3Y2 := 52;

S4X1 := 480;
S4Y1 := 38;
S4X2 := 490;
S4Y2 := 52;

S5X1 := 487;
S5Y1 := 38;
S5X2 := 496;
S5Y2 := 52;
end;

function InEnchantArena: Boolean;
begin
if (SimilarColors(GetColor(462, 253), 26265, 4)) and
(SimilarColors(GetColor(487, 257), 26265, 4)) then
Result := True
else
begin
Writeln('Not in the enchant arena. Go place yourself there.');
end;
end;

procedure GetPizPoints;
begin
Zero := BitmapFromString(6, 9, 'beNrLzcnOzTmTxgBBQDaECyQZGBCCQ' +
'BII4CohUhASLkskiWw4splwcYgbGGAgGwDk5i0l');
One := BitmapFromString(5, 10, 'beNpjYMjNz8VEZ9IYkNlABATIIlTh' +
'QkxGtosBAgAPNTO1');
Two := BitmapFromString(6, 10, 'beNpjYMjNz8VEZ9IYIAjOBZIMYAAX' +
'BLLhsnA2smIyuMhWIzuAARkAAEZqOw8=');
Three := BitmapFromString(5, 9, 'beNrLz83Nzz2TxgBEQAaEDSQZG' +
'BAiQDZEHM6Aq4ErgCuGG4IsiF8viA0AW3or0Q==');
Four := BitmapFromString(5, 10, 'beNrLz83NR0Fn0hjQuECAnwvXA' +
'udC1AAZcARRAJeFG4JmIERNLgDnQjI+');
Five := BitmapFromString(6, 10, 'beNrLz83NR0dn0hjgCC6CDOAiW' +
'HUhC0LUowkia0ezAtkoiHY0o0BsAAYFPFg=');
Six := BitmapFromString(7, 10, 'beNrLz80ryMNEufm5EHQmjQGIgA' +
'y4IITLwAAVRxaBcCEMoCBEDVwZsmlo2iEAzkZmYLKRDYGbzAADuQC' +
'+rEZz');
Seven := BitmapFromString(5, 10, 'beNrLz80ryENGZ9IY4AjIzc3P' +
'ZQADIBcIgFwgArIh4nAuhVIQhOACAEPjMn4=');
Eight := BitmapFromString(6, 9, 'beNrLz83Nzz2TxgBBQDaECyQZw' +
'ADCBpJAAJeFsJF1wVXi10WMORBZBhjIBQCeEjBr');
Nine := BitmapFromString(8, 10, 'beNrLz83Nx4fOpDFAEJogkGQAA2Qp' +
'IBsIMNlwLZjiyFagiUOswCqO1Rz84hDTcgEdRldV');
LoadUp;
if FindBitmapToleranceIn(Zero, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 0;
if FindBitmapToleranceIn(One, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 1;
if FindBitmapToleranceIn(Two, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 2;
if FindBitmapToleranceIn(Three, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 3;
if FindBitmapToleranceIn(Four, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 4;
if FindBitmapToleranceIn(Five, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 5;
if FindBitmapToleranceIn(Six, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 6;
if FindBitmapToleranceIn(Seven, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 7;
if FindBitmapToleranceIn(Eight, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 8;
if FindBitmapToleranceIn(Nine, x, y, S1X1, S1Y1, S1X2, S1Y2, 100)
then Number1 := 9;


if FindBitmapToleranceIn(Zero, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 0;
if FindBitmapToleranceIn(One, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 1;
if FindBitmapToleranceIn(Two, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 2;
if FindBitmapToleranceIn(Three, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 3;
if FindBitmapToleranceIn(Four, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 4;
if FindBitmapToleranceIn(Five, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 5;
if FindBitmapToleranceIn(Six, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 6;
if FindBitmapToleranceIn(Seven, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 7;
if FindBitmapToleranceIn(Eight, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 8;
if FindBitmapToleranceIn(Nine, x, y, S2X1, S2Y1, S2X2, S2Y2, 100)
then Number2 := 9;

if FindBitmapToleranceIn(Zero, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 0;
if FindBitmapToleranceIn(One, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 1;
if FindBitmapToleranceIn(Two, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 2;
if FindBitmapToleranceIn(Three, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 3;
if FindBitmapToleranceIn(Four, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 4;
if FindBitmapToleranceIn(Five, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 5;
if FindBitmapToleranceIn(Six, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 6;
if FindBitmapToleranceIn(Seven, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 7;
if FindBitmapToleranceIn(Eight, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 8;
if FindBitmapToleranceIn(Nine, x, y, S3X1, S3Y1, S3X2, S3Y2, 100)
then Number3 := 9;

if FindBitmapToleranceIn(Zero, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 0;
if FindBitmapToleranceIn(One, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 1;
if FindBitmapToleranceIn(Two, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 2;
if FindBitmapToleranceIn(Three, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 3;
if FindBitmapToleranceIn(Four, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 4;
if FindBitmapToleranceIn(Five, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 5;
if FindBitmapToleranceIn(Six, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 6;
if FindBitmapToleranceIn(Seven, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 7;
if FindBitmapToleranceIn(Eight, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 8;
if FindBitmapToleranceIn(Nine, x, y, S4X1, S4Y1, S4X2, S4Y2, 100)
then Number4 := 9;

if FindBitmapToleranceIn(Zero, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 0;
if FindBitmapToleranceIn(One, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 1;
if FindBitmapToleranceIn(Two, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 2;
if FindBitmapToleranceIn(Three, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 3;
if FindBitmapToleranceIn(Four, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 4;
if FindBitmapToleranceIn(Five, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 5;
if FindBitmapToleranceIn(Six, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 6;
if FindBitmapToleranceIn(Seven, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 7;
if FindBitmapToleranceIn(Eight, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 8;
if FindBitmapToleranceIn(Nine, x, y, S5X1, S5Y1, S5X2, S5Y2, 100)
then Number5 := 9;
PizPointString := (IntToStr(Number1) + IntToStr(Number2) + IntToStr(Number3) + IntToStr(Number4) + IntToStr(Number5));
PizPoints := StrToInt(PizPointString);
FreeBitmap(Zero);
FreeBitmap(One);
FreeBitmap(Two);
FreeBitmap(Three);
FreeBitmap(Four);
FreeBitmap(Five);
FreeBitmap(Six);
FreeBitmap(Seven);
FreeBitmap(Eight);
FreeBitmap(Nine);
end;

procedure FreeBitmaps;
begin
FreeBitmap(Cube);
FreeBitmap(Cylinder);
FreeBitmap(Ico);
FreeBitmap(Pentamid);
Status('Bitmaps Free');
end;

function BonusShape: string;
var
ix, iy, ShapeColor: Integer;
begin
LoadBitmaps;
if FindBitmapToleranceIn(Cube, ix, iy, 450, 250, 510, 320, 10) then
Result := 'Cube';
if FindBitmapToleranceIn(Cylinder, ix, iy, 450, 250, 510, 320, 10) then
Result := 'Cylinder';
if FindBitmapToleranceIn(Ico, ix, iy, 450, 250, 510, 320, 10) then
Result := 'Ico';
if FindBitmapToleranceIn(Pentamid, ix, iy, 450, 250, 510, 320, 10) then
Result := 'Pentamid';
FreeBitmaps;
if Result = '' then
begin
Writeln('Gone to backup shape finding');
ShapeColor := GetColor(491, 291);
if SimilarColors(ShapeColor, 1056410, 10) then
Result := 'Pentamid';
if SimilarColors(ShapeColor, 1461854, 10) then
Result := 'Cube';
if SimilarColors(ShapeColor, 13984609, 10) then
Result := 'Ico';
if SimilarColors(ShapeColor, 1279245, 10) then
Result := 'Cylinder';
end;
Status('Bonus Shape was: ' + Result + ' when last at center');
CurrentBonusShape := Result;
end;

procedure GetExp;
begin
if Spell = 'Lvl1' then
RelativeEnchantAmount := 13.125;
if Spell = 'Lvl2' then
RelativeEnchantAmount := 27.75;
if Spell = 'Lvl3' then
RelativeEnchantAmount := 44.25;
if Spell = 'Lvl4' then
RelativeEnchantAmount := 50.25;
if Spell = 'Lvl5' then
RelativeEnchantAmount := 58.5;
if Spell = 'Lvl6' then
RelativeEnchantAmount := 72.75;
end;


procedure GetMageLevelAndSetSpell;
begin
MageLevel := GetSkillLevel('Magic');
Writeln('Your magic level is ' + IntToStr(MageLevel));
if MageLevel <= 6 then
begin
Writeln('Go train mage, nub. You cant even enchant!');
Logout;
TerminateScript;
end;
if (MageLevel <= 26) and (MageLevel > 5) then
begin
Writeln('Using Level 1 Enchant');
Spell := 'Lvl1';
RelativeEnchantAmount := 13.125;
end;
if (MageLevel <= 48) and (MageLevel > 26) then
begin
Writeln('Using Level 2 Enchant');
Spell := 'Lvl2';
RelativeEnchantAmount := 27.75;
end;
if (MageLevel <= 56) and (MageLevel > 48) then
begin
Writeln('Using Level 3 Enchant');
Spell := 'Lvl3';
RelativeEnchantAmount := 44.25;
end;
if (MageLevel <= 67) and (MageLevel > 56) then
begin
Writeln('Using Level 4 Enchant');
Spell := 'Lvl4';
RelativeEnchantAmount := 50.25;
end;
if (MageLevel <= 86) and (MageLevel > 67) then
begin
Writeln('Using Level 5 Enchant');
Spell := 'Lvl5';
RelativeEnchantAmount := 58.5;
end;
if (MageLevel > 86) then
begin
Writeln('Using Level 6 Enchant');
Spell := 'Lvl6';
RelativeEnchantAmount := 72.75;
end;
end;


procedure StraightWallsPlease;
var
PerfectWall,PerfectWall2, x, y, I: Integer;
// ReportVars : TReport;
report:integer;
begin
PerfectWall := BitmapFromString(17, 5, 'beNrLzmagCyjKziYVvX' +
'jznVREsi0Ag+ZbDA==');
PerfectWall2 := loadbitmap('a5765A78DAB58ECB11C' +
'02008445BE2AF1E23D1FE4B4A96831DC86161DEB00B44C44E7F31' +
'DBAF1698BDA38526E66187783CE0DEB19902620BBAFA519970492' +
'F9757C2AE34A9E4BA1513AD0DA0C838248682CFF26603690C2279' +
'541D2EE589A08D8B972ACC5FCF1BBA72D9A61B7AEFE70F27D');
MakeCompass('E');
Wait(500 + random(500));
SendArrowWait(1, 620 + random(80))
repeat
SendArrowWait(1, 10 + random(10))
Wait(200 + random(200))
I := I + 1;
until FindBitmapToleranceIn(PerfectWall, x, y, MMX1, MMY1, MMX2, MMY2, 100) or (I = 40) or FindBitmapToleranceIn(PerfectWall2, x, y, MMX1, MMY1, MMX2, MMY2, 100)
if FindBitmapToleranceIn(PerfectWall, x, y, MMX1, MMY1, MMX2, MMY2, 100) or FindBitmapToleranceIn(PerfectWall2, x, y, MMX1, MMY1, MMX2, MMY2, 100) then
begin
//inc(report);
///ReportVars[5] := ReportVars[5] + 1;
Writeln('Fixed MM Walls');
exit;
end;
if I = 40 then
begin
Writeln('Not fixed...Trying again');
end;
MakeCompass('E');
Wait(500 + random(500));
SendArrowWait(1, 620 + random(80))
I := 0;
repeat
SendArrowWait(1, 10 + random(10))
Wait(200 + random(200))
I := I + 1;
until FindBitmapToleranceIn(PerfectWall, x, y, MMX1, MMY1, MMX2, MMY2, 150) or (I = 40)
if FindBitmapToleranceIn(PerfectWall, x, y, MMX1, MMY1, MMX2, MMY2, 150) then
Writeln('Fixed MM Walls');
if I = 40 then
begin
Writeln('Not fixed...Using Make Compass');
MakeCompass('N');
end;
FreeBitmap(PerfectWall)
FreeBitmap(PerfectWall2);
end;

procedure GoToPentamids;
begin
Writeln('Walking to Pentamids');
Status('Walking to Pentamids');
x := 604 + random(2);
y := 125 + random(2);
Mouse(x, y, 1, 1, True);
flag;
GetPizPoints;
x := 614 + random(2);
y := 103 + random(2);
Mouse(x, y, 1, 1, True);
flag;
Status('At Pentamids');
PlayerLocation := 'Pentamids';
end;

procedure GoToCubes;
begin
Writeln('Walking to Cubes');
Status('Walking to Cubes');
x := 599 + random(3);
y := 36 + random(3);
Mouse(x, y, 1, 1, True);
flag;
GetPizPoints;
x := 628 + random(3);
y := 67 + random(3);
Mouse(x, y, 1, 1, True);
flag;
Status('At Cubes');
PlayerLocation := 'Cubes';
end;

procedure GoToIcos;
begin
Writeln('Walking to Icos');
Status('Walking to Icos');
x := 684 + random(2);
y := 123 + random(2);
Mouse(x, y, 1, 1, True);
flag;
GetPizPoints;
x := 659 + random(2);
y := 116 + random(2);
Mouse(x, y, 1, 1, True);
flag;
Status('At Icos');
PlayerLocation := 'Icos';
end;

procedure AntiBan; //Hy71194's because im laze-E
var
a, b: Integer;
begin
if (not LoggedIn) then exit;
b := Random(100);
case b of
0: MMouse(random(MSX2), random(MSY2), 0, 0);
1: MouseSpeed := 9 + Random(3);
2: HoverSkill('random', false);
5: PickupMouse;
6: MouseSpeed := 9 + Random(3);
7: MouseSpeed := 9 + Random(3);
8: MMouse(random(MSX2), random(MSY2), 0, 0);
9: Wait(1 + Random(100));
10: begin
GameTab(1 + random(12));
for a := 0 to 6 do
begin
Wait(300 + Random(200));
end;
GameTab(4);
end;
end;
end;


procedure GoToCylinders;
begin
Writeln('Walking to Cylinders');
Status('Walking to Cylinders');
x := 690 + random(3);
y := 35 + random(3);
Mouse(x, y, 1, 1, True);
flag;
GetPizPoints;
x := 655 + random(3);
y := 71 + random(3);
Mouse(x, y, 1, 1, True);
flag;
Status('At Cylinders');
PlayerLocation := 'Cylinders';
end;

procedure GoToRandom;
begin
case random(4) of
0:
begin
GoToCubes;
CurrentBonusShape := 'Cube';
end;
1:
begin
GoToIcos;
CurrentBonusShape := 'Ico';
end;
2:
begin
GoToPentamids;
CurrentBonusShape := 'Pentamid';
end;
3:
begin
GoToCylinders;
CurrentBonusShape := 'Cylinder';
end;
end;
Status('Bonus Shape: ' + CurrentBonusShape);
end;

function ShopOutOfStock: Boolean;
begin
if (SimilarColors(GetColor(282, 193), 65535, 2)) and
(SimilarColors(GetColor(286, 194), 65535, 2)) and
(SimilarColors(GetColor(285, 198), 65535, 2)) and
(SimilarColors(GetColor(284, 191), 65535, 2)) then
begin
Status('Detected the stock of cosmics at 0');
Result := True
Writeln('The Shop is outa stock fool');
end
else
Result := False;
end;

function NotEnoughEnchantPoints: Boolean;
begin
end;

procedure Endme;
begin
Writeln(' All finished =P ');
Writeln(' Thanks for using Sp0rk-ehs ');
Writeln(' Mage Arena Enchanter ');
wait(2000);
Writeln('Please post progress reports!');
Writeln('http://www.srl-forums.com/forum/sp0rkys-mage-arena-t20212.html');
end;


procedure WalkToShapeFromCenter;
begin
Status('Walking To Shape');
if BonusShape = 'Cube' then
begin
GoToCubes;
Exit;
end;
if BonusShape = 'Cylinder' then
begin
GoToCylinders;
Exit;
end;
if BonusShape = 'Ico' then
begin
GoToIcos;
Exit;
end;
if BonusShape = 'Pentamid' then
begin
GoToPentamids;
Exit;
end;
if BonusShape = '' then
begin
Writeln('Fuckit, cant find a shape. Going random');
GoToRandom;
end;
end;

procedure TakeShapesBac;
var
ShapeText: string;
CouldntFindColor, TimesClickedShape: Integer;
begin
Status('Taking Shapes from the Pile');
TimesClickedShape := 0;
if (not (LoggedIn)) then exit;
if CurrentBonusShape = 'Cylinder' then
begin
ShapeText := 'linder';
ShapeColor := 1144589;
end;
if CurrentBonusShape = 'Cube' then
begin
ShapeText := 'ube';
ShapeColor := 1550786;
end;
if CurrentBonusShape = 'Ico' then
begin
ShapeText := 'cosa';
ShapeColor := 11752531;
end;
if CurrentBonusShape = 'Pentamid' then
begin
ShapeText := 'tami';
ShapeColor := 1716197;
end;
repeat
begin
if (not (LoggedIn)) then exit;
wait(100 + random(50));
if FindColorSpiralTolerance(x, y, ShapeColor, 5, 70, 515, 249, 4)
then
begin
MMouse(x, y, 1, 1);
wait(50 + random(25));
if IsUpText(ShapeText) then
Mouse(x, y, 1, 1, True);
TimesClickedShape := TimesClickedShape + 1;
Status('Clicked Shape Pile: ' + IntToStr(TimesClickedShape) + ' times');
flag;
wait(50 + random(50));
end
else
begin
CouldntFindColor := CouldntFindColor + 1;
Writeln('Cant Find Color');
if CouldntFindColor > 2 then
begin
Writeln('Really cant find color! It must not be in the middle of the screen')
Writeln('Tried to fix too many times, Giving up');
Logout;
TerminateScript;
Exit;
end;
end;
end;
until InvFull;
end;



{*******************************************************************************
function FindMMColorTol(var x, y: Integer; color, tol: Integer): Boolean;
By: Stupid3ooo
Description: Finds color on Minimap with tolerance
*******************************************************************************}

function FindMMColorTol(var x, y: Integer; color, tol: Integer): Boolean;
begin
Result := FindColorTolerance(x, y, color, MMX1, MMY1, MMX2, MMY2, tol);
end;


function FindCenter: Boolean;
begin
if (not (LoggedIn)) then exit;
if FindMMColorTol(x, y, 9011075, 7) then
begin
Status('Center Found... Walking Back')
Result := True;
Mouse(x + random(2), y + random(10), 1, 1, True);
Flag;
PlayerLocation := 'At Center';
end
else
begin
Result := False;
Writeln('Center Not Found... Logging')
Logout;
Status('Center Not Found... Logged Character Out')
end;
end;

procedure WalkBackToCenter;
begin
if PlayerLocation = 'Cylinders' then
begin
Status('Walking from Cylinders to center')
Mouse(615 + random(2), 113 + random(2), 1, 1, True);
flag;
GetPizPoints;
if (not (FindCenter)) then
begin
Status('Didnt find center. Walking then trying again')
Mouse(601 + random(2), 118 + random(2), 1, 1, True);
flag;
FindCenter
end;
end;
if PlayerLocation = 'Cubes' then
begin
Status('Walking from Cubes to center')
Mouse(678 + random(2), 110 + random(2), 1, 1, True);
flag;
GetPizPoints;
if (not (FindCenter)) then
begin
Status('Didnt find center. Walking then trying again')
Mouse(671 + random(2), 125 + random(2), 1, 1, True);
flag;
FindCenter;
end;
end;
if PlayerLocation = 'Pentamids' then
begin
Status('Walking from Pentamids to center')
Mouse(669 + random(2), 49 + random(2), 1, 1, True);
flag;
GetPizPoints;
if (not (FindCenter)) then
begin
Status('Didnt find center. Walking then trying again')
Mouse(690 + random(2), 38 + random(2), 1, 1, True);
flag;
FindCenter;
end;
end;
if PlayerLocation = 'Icos' then
begin
Status('Walking from Icos to center');
Mouse(607 + random(2), 55 + random(2), 1, 1, True);
flag;
GetPizPoints;
if (not (FindCenter)) then
begin
Status('Didnt find center. Walking then trying again')
Mouse(611 + random(2), 50 + random(2), 1, 1, True);
flag;
FindCenter;
end;
end;
end;

procedure BuyProg;
begin
ClearDebug;
Writeln('------------------------------------------');
Writeln('- Sp0rk-ehs Mage Arena Enchanter -');
Writeln('- Buy Mode -');
Writeln('- Worlds Hopped : ' + IntToStr(WorldsHopped));
Writeln('- Cosmics Bought: ' + IntToStr(CosmicsBought));
Writeln('------------------------------------------');
end;

function CheckPoints: Boolean;
begin
if FindBlackChatMessage('cannot afford that ite') then
begin

LogOut;
BuyProg;
Writeln('All out of points - Bought max amount');
TerminateScript;
end;
end;

function MageTrainingArenaShopScreen: Boolean;
var
ArenaShop,iix,iiy : Integer;
begin
if SimilarColors(GetColor(483, 35), 39423, 15) then
begin
Result := True;
end
else
begin
Writeln('Mage Training Arena Shop Window Not Found.');
Status('Mage Training Arena Shop Window Not Found.');
Result := False
end;
end;

procedure AntiBan2; //Hy71194's because im laze-E
var
a, b: Integer;
begin
if (not LoggedIn) then exit;
b := Random(100);
case b of
0: MMouse(random(MSX2), random(MSY2), 0, 0);
1:
begin
HoverSkill('magic', false);
GameTab(4);
end;
2:
begin
HoverSkill('random', false);
GameTab(4);
end;
5: PickupMouse;
6: MouseSpeed := 20 + Random(3);
7: MouseSpeed := 22 + Random(3);
8: MMouse(random(MSX2), random(MSY2), 0, 0);
9: Wait(1 + Random(100));
10: begin
GameTab(1 + random(12));
begin
Wait(300 + Random(200));
end;
GameTab(4);
end;
end;
end;

procedure BuyCosmics;
var
Bought, CosmicRune, ix, iy: Integer;
begin
if (not (LoggedIn)) then exit;
wait(2000 + random(1000));
if MageTrainingArenaShopScreen then
begin
CosmicRune := BitmapFromString(12, 9, 'beNptzmsKgzAQBOBzeMk' +
'qIhobX/HRNFUrpSi9nPQqDowsgRbmxzL7keweLMOAfPfgfbfI+nDb' +
'NCKf54yScU0tM/DLWoRY+luhZR6NmbuOL1Oy76+5GDJf+qvfgFH+3' +
'dqqxJEIHmSj49gH+BoXglGyzKNIQJ2mrVJglNJn4UXmMknIKM/+AP' +
'QJtrA=');
if FindBitmapToleranceIn(CosmicRune, x, y, MSX1, MSY1, MSX2, MSY2, 100) then
begin
MMouse(x, y, 1, 1);
Writeln('Found Cosmic Bitmap');
end;
FreeBitmap(CosmicRune);
wait(250 + random(50));
if IsUpText('osmic') then
repeat
begin
if (not (LoggedIn)) then exit;
if random(4) > 2 then
begin
AntiBan2;
end;
ix := x;
iy := y;
ix := ix + random(15);
iy := iy + random(15);
Mouse(ix, iy, 1, 1, False);
wait(40 + random(20));
ChooseOption('uy');
wait(30 + random(20));
Bought := Bought + 1;
CosmicsBought := CosmicsBought + 1;
Status('Bought: ' + IntToStr(Bought) + ' cosmics');
CheckPoints;
// ReportVars[3] := Bought;
end
until (bought = 105) or ShopOutOfStock or (not (MageTrainingArenaShopScreen)) or FindBlackChatMessage('stock');
mousespeed := 10;
end
else
begin
Writeln('Mage screen or guardian fuckup.');
Logout;
end;
end;

procedure TakeShapes;
var
ShapeText: string;
CouldntFindColor, TimesClickedShape: Integer;
begin
Status('Taking Shapes from the Pile');
TimesClickedShape := 0;
if (not (LoggedIn)) then exit;
if CurrentBonusShape = 'Cylinder' then
begin
ShapeText := 'linder';
ShapeColor := 1144589;
end;
if CurrentBonusShape = 'Cube' then
begin
ShapeText := 'ube';
ShapeColor := 1550786;
end;
if CurrentBonusShape = 'Ico' then
begin
ShapeText := 'cosa';
ShapeColor := 11752531;
end;
if CurrentBonusShape = 'Pentamid' then
begin
ShapeText := 'tami';
ShapeColor := 1716197;
end;
repeat
begin
if (not (LoggedIn)) then exit;
wait(100 + random(50));
if FindColorSpiralTolerance(x, y, ShapeColor, 5, 70, 515, 249, 4)
then
begin
MMouse(x, y, 1, 1);
wait(50 + random(25));
if IsUpText(ShapeText) then
Mouse(x, y, 1, 1, True);
TimesClickedShape := TimesClickedShape + 1;
Status('Clicked Shape Pile: ' + IntToStr(TimesClickedShape) + ' times');
flag;
wait(50 + random(50));
end
else
begin
CouldntFindColor := CouldntFindColor + 1;
Writeln('Cant Find Color');
if CouldntFindColor > 2 then
begin
Writeln('Really cant find color! It must not be in the middle of the screen')
Writeln('Walking back and re-calibrating Minimap Walls');
InEnchantArena;
WalkBackToCenter;
InEnchantArena;
StraightWallsPlease;
InEnchantArena;
WalkToShapeFromCenter;
InEnchantArena;
TakeShapesBac;
FixedTimes := FixedTimes + 1;
if FixedTimes > 4 then
begin
Writeln('Tried to fix too many times, Giving up');
Logout;
TerminateScript;
Exit;
end;
end;
end;
end;
until InvFull;
end;

procedure AssignXandY;
begin
if Spell = 'Lvl1' then
begin
x := 685 + random(8);
y := 234 + random(8);
end;
if Spell = 'Lvl2' then
begin
x := 613 + random(8);
y := 281 + random(8);
end;
if Spell = 'Lvl3' then
begin
x := 566 + random(8);
y := 329 + random(8);
end;
if Spell = 'Lvl4' then
begin
x := 589 + random(8);
y := 353 + random(8);
end;
if Spell = 'Lvl5' then
begin
x := 612 + random(8);
y := 400 + random(8);
end;

if Spell = 'Lvl6' then
begin
x := 685 + random(8);
y := 425 + random(8);
end;
end;

procedure CheckCosmics;
begin
if Spell = 'Lvl1' then
begin
if SimilarColors(GetColor(691, 235), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl2' then
begin
if SimilarColors(GetColor(619, 282), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl3' then
begin
if SimilarColors(GetColor(570, 330), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl4' then
begin
if SimilarColors(GetColor(594, 354), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl5' then
begin
if SimilarColors(GetColor(618, 400), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl6' then
begin
if SimilarColors(GetColor(690, 426), 71961, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
end;

procedure EnchantInventory;
var
ShapeColorInInvent: Integer;
begin
if (not (LoggedIn)) then exit;
if CurrentBonusShape = 'Cube' then
ShapeColorInInvent := 2921394;
if CurrentBonusShape = 'Pentamid' then
ShapeColorInInvent := 1319850;
if CurrentBonusShape = 'Ico' then
ShapeColorInInvent := 9848132;
if CurrentBonusShape = 'Cylinder' then
ShapeColorInInvent := 1344269;
GameTab(7);
repeat
if (not (LoggedIn)) then exit;
AssignXandY;
wait(900 + random(100));
if (not GameTab(7)) then
begin
GameTab(7);
end;
CheckCosmics;
MMouse(x, y, 0, 0);
if IsUpText('ant') then
begin
Mouse(x, y, 1, 1, True);
wait(100 + random(50))
if FindColorSpiralTolerance(x, y, ShapeColorInInvent, 694, 434, 717, 454, 4) then
begin
x := 693 + random(20)
y := 435 + random(20)
Mouse(x, y, 1, 1, True);
ShapesEnchanted := ShapesEnchanted + 1;
ShapesEnchanted2 := ShapesEnchanted2 + 1;
// ReportVars[1] := ShapesEnchanted2;
Status('Shapes enchanted this trip:' + IntToStr(ShapesEnchanted2));
end;
end;
until FindColorSpiralTolerance(x, y, 16316664, 694, 434, 717, 454, 4);
GameTab(4);
Status('All shapes in inventory enchanted!');
end;

procedure DepositOrbs;
var
Found: Boolean;
begin
if (not (LoggedIn)) then exit;
repeat
if (not (LoggedIn)) then exit;
wait(100 + random(100));
GetPizPoints;
if FindColorSpiralTolerance(x, y, 8685966, 5, 6, 511, 332, 4) then
MMouse(x, y, 1, 1);
if IsUpText('ole') then
begin
Found := True;
Status('Found orb deposit hole');
Mouse(x, y, 1, 1, True);
flag;
wait(500 + random(100));
Status('Orbs deposited');
ClickToContinue;
wait(400 + random(100));
ClickToContinue;
end;
until Found;
TripsDone := TripsDone + 1;
// ReportVars[0] := ReportVars[0] + 1;
end;

procedure CloseCosmicWindow;
begin
if (not (LoggedIn)) then exit;
Status('Closing mage arena buy screen');
x := 475 + random(9);
y := 30 + random(9);
MMouse(x, y, 1, 1)
wait(500 + random(200));
if IsUpText('lose') then
begin
Mouse(x, y, 1, 1, True);
Status('Mage Arena buy screen closed.');
wait(500 + random(200));
end;
end;

procedure FindPortal;
var
Tries: Integer;
Clicked: Boolean;
begin
Status('Trying to find enchant arena portal. Tried: ' + IntToStr(Tries) + ' times');
repeat
if (not (LoggedIn)) then exit;
if FindColorSpiralTolerance(x, y, 1842975, 20, 20, 338, 333, 3) then
begin
wait(250 + random(100))
MMouse(x, y, 1, 1)
Tries := Tries + 1;
Status('Trying to find enchant arena portal. Tried: ' + IntToStr(Tries) + ' times');
if IsUpText('chant') then
begin
Mouse(x, y, 1, 1, True)
Flag;
wait(1000 + random(1000));
Clicked := True;
Status('Enchant Arena Re-Entered');
end;
end;
until (Clicked) or (Tries > 20);
end;

procedure WalkToEnchantChamber;
begin
if (not (LoggedIn)) then exit;
SetRun(True);
if FindSymbol(x, y, 'minigame') then
begin
Status('Found minigame symbol');
Mouse(x - 40, y, 1, 1, True)
Flag;
end
else
begin
Writeln('Didnt find minigame symbol. Co-ords.');
Status('Using co-ords to walk to portal');
Mouse(620 + random(1), 15 + random(1), 1, 1, True)
wait(2000 + random(100));
flag;
end;
FindPortal;
end;

{*******************************************************************************
procedure OrderBy(Which, UpDown: string);
By: WT-Fakawi
Description: Orders Display.
*******************************************************************************}

procedure OrderBy(Which, UpDown: string);
var
Origin, OBx, OBy: Integer;
begin
case Which of
'world':
begin
case UpDown of
'up': Origin := 284;
'down': Origin := 297;
end
end;
'players':
begin
case UpDown of
'up': Origin := 393;
'down': Origin := 409;
end
end;
'location':
begin
case UpDown of
'up': Origin := 503;
'down': Origin := 519;
end
end;
'type':
begin
case UpDown of
'up': Origin := 613;
'down': Origin := 629;
end
end;
end;

MMouse(Origin, 7, 7, 7)
GetMousePos(OBx, OBy);
repeat
Mouse(OBx, OBy, 0, 0, True);
Wait(500);
until FindColorSpiralTolerance(OBx, OBy, 2851375, Origin, 7, Origin + 7, 7 + 7, 50);
end;

procedure TradeWithRewardsGuardian;
var
tries: Integer;
begin
if (not (LoggedIn)) then exit;
repeat
if (not (LoggedIn)) then exit;
wait(100 + random(100));
if FindColorSpiralTolerance(x, y, 5479603, 5, 6, 511, 332, 4) then
begin
Status('Moving mouse to rewards guardian');
MMouse(x, y, 1, 1);
tries := tries + 1;
if IsUpText('ewa') then
begin
Status('Rewards guardian found');
Mouse(x, y, 1, 1, False);
ChooseOption('rade')
flag;
Status('Chose to trade with guardian');
wait(1000 + random(500));
Exit;
end;
end;
until tries > 10;
Writeln('Couldnt find guardian');
Logout;
end;

procedure ChooseRandomWorld;
begin
Status('Choosing a random world');
case random(28) of
0: Mouse(388, 343, 2, 2, True);
1: Mouse(388, 366, 2, 2, True);
2: Mouse(388, 390, 2, 2, True);
3: Mouse(393, 411, 2, 2, True);
4: Mouse(393, 436, 2, 2, True);
5: Mouse(395, 459, 2, 2, True);
6: Mouse(394, 481, 2, 2, True);
7: Mouse(484, 44, 2, 2, True);
8: Mouse(489, 68, 2, 2, True);
9: Mouse(484, 90, 2, 2, True);
10: Mouse(493, 115, 2, 2, True);
11: Mouse(488, 135, 2, 2, True);
12: Mouse(493, 159, 2, 2, True);
13: Mouse(488, 181, 2, 2, True);
14: Mouse(489, 204, 2, 2, True);
15: Mouse(487, 227, 2, 2, True);
16: Mouse(494, 250, 2, 2, True);
17: Mouse(488, 272, 2, 2, True);
18: Mouse(490, 293, 2, 2, True);
19: Mouse(501, 324, 2, 2, True);
20: Mouse(486, 345, 2, 2, True);
21: Mouse(487, 367, 2, 2, True);
22: Mouse(486, 391, 2, 2, True);
23: Mouse(489, 386, 2, 2, True);
24: Mouse(481, 412, 2, 2, True);
25: Mouse(478, 438, 2, 2, True);
26: Mouse(486, 456, 2, 2, True);
27: Mouse(478, 481, 2, 2, True);
end;
end;

procedure ClickWorldSwitchButton;
begin
MMouse(8, 466, 90, 25);
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
repeat
Wait(10);
until (GetColor(17, 477) = 0);
end;

//Ty pwnaz0r

function ExToStr(i: integer; e: extended): string;
begin
result := FloatToStr(i * e);
end;
//Ty pwnaz0r

function NumToStr(i: integer; e: extended): string;
begin
result := IntToStr(Ceil(i * e));
end;

procedure Report;
begin
ClearReport;
AddToReport('/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\');
AddToReport('| Visit srl-forums.com |');
AddToReport('| for script updates |');
AddToReport('| ~Sp0rky~ |');
if (SrlStatsID = '') or (SrlStatsPassword = '') then
begin
AddToReport('|Please register for srl stats!|');
end;
AddToReport('| Thank you for using: |');
AddToReport('| M.A.E. v0.2 |');
AddToReport('\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/');
end;





procedure ProgressReport;
begin
ClearDebug;
Writeln('------------------------------------------');
Writeln('-Sp0rk-ehs Mage Arena Enchanter-');
Writeln('-Trips Done : ' + IntToStr(TripsDone));
WriteLn('-TimeRunning : ' + TimeRunning);
Writeln('-Enchanted : ' + IntToStr(ShapesEnchanted) + ' Shapes.');
Experience := NumToStr(ShapesEnchanted, RelativeEnchantAmount);
ExperienceThisTrip := NumToStr(ShapesEnchanted2, RelativeEnchantAmount);
Writeln('-Gained approx. : ' + Experience + ' Magic Exp.');
Writeln('-Pizzaz points : ' + IntToStr(PizPoints));
// ReportVars[2] := StrToInt(ExperienceThisTrip);
Writeln('-Logged back in : ' + IntToStr(TimesLogged) + ' times.');
Writeln('------------------------------------------');
ShapesEnchanted2 := 0;
end;

begin
cleardebug;
DeclarePlayers;
SetupSRL;
ActivateClient;
mousespeed := 10;
if Mode = 'Arena' then
begin
LoginPlayer;
Writeln('Arena Mode Initiated...');
makecompass('n');
if InEnchantArena then
begin
if (WhichSpellToCast = ('Auto')) or (WhichSpellToCast = ('auto')) then
begin
GetMageLevelAndSetSpell;
end
else
begin
Spell := WhichSpellToCast;
Writeln('Casting ' + Spell + ' Spell.');
GetExp;
end;
repeat
LoginPlayer;
WalkToShapeFromCenter;
InEnchantArena;
TakeShapes;
AntiBan;
InEnchantArena;
EnchantInventory;
AntiBan;
WalkBackToCenter;
InEnchantArena;
DepositOrbs;
AntiBan;
ProgressReport;
SrlRandomsReport;
Report;
if (not (LoggedIn)) then
begin
if TimesLogged > 2 then
begin
Writeln('Logged in too many times. Terminating for the safety of the user');
Players[CurrentPlayer].Active := False;
break;
end;
Writeln('Logging Player Back In');
Players[CurrentPlayer].Active := True;
wait(15000 + random(5000));
LoginPlayer;
Randoms;
TimesLogged := TimesLogged + 1;
WalkToEnchantChamber;
Randoms;
FindCenter;
end;
until (false) or (ShapesEnchanted >= NumberOfCosmics);
end;
end;

if Mode = 'Buy' then
begin
Writeln('Buy Mode Initiated...');
repeat
if (not (LoggedIn)) then
begin
Status('Clicking the worldswitch button');
ClickWorldSwitchButton;
Status('Ordering by players and type');
OrderBy('players', 'down');
OrderBy('type', 'down');
ChooseRandomWorld;
wait(2000);
Status('Logging player');
LoginPlayer;
WorldsHopped := WorldsHopped + 1;
ReportVars := ReportVars + 1;
end;
setangle(0);
Randoms;
TradeWithRewardsGuardian;
Wait(2000+random(500));
BuyCosmics;
CloseCosmicWindow;
Randoms;
Logout;
BuyProg;
SrlRandomsReport;
Report;
until (CosmicsToBuy <= CosmicsBought);
end;
Endme;
end.

I commented out ReportVars because it uses Treport function from SRL v4, which isn't supported by current versions inc(report) instead? i didn't think too much about converting it, the bitmaps aren't real in length, i tried to use loadbitmaps but it just failed, hes using bitmapfromstring2 which is also an SRL4 old version that isn't supported anymore.

So how do we localize our self in this area? it doesn't seem too difficult to revive to be honest.

Still interested @Fade03 ?

original topic found here: http://villavu.com/forum/showthread.php?t=18491

xtrapsp

2013-05-01 04:09:07

From: samerdl


Still interested @Fade03 ?

original topic found here: http://villavu.com/forum/showthread.php?t=18491


@Fade03

Chris!

2013-05-01 06:26:09

{.Script Info:
# ScriptName = Mage Arena Enchanter
# Author = Sp0rk-eh
# Description = Enchants in the mage training arena (near the dueling arena)
# Version = 0.2
# Date = 31 October 2007
# Comments = N/A
/Script Info}


{Make sure your minimap is as perfect north as possible!}
{!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
{|}{|}
{|}{O.Start the Arena mode in the center of the Enchant Arena}{|}
{|}{O.Have cosmics in the first inventory slot, and no other items}{|}
{|}{O.Start the Buy mode next to the Rewards Guardian}{|}
{|}{|}
{!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
//Please post progress reports. They make me happy.

{Credits:
Pwnaz0r - providing some functions + chatter on msn
Dave - testing
Hy71194 - antiban
King Of Knives - inspiration of mm walls/procedure}

program MageArenaEnchanterBySp0rky;
{$I SRL-OSR/SRL.Simba}

const
Mode = 'Arena';

var
Cube, Cylinder, Ico, Pentamid, ShapeColor, TripsDone, iX, iY, x, y: Integer;
CurrentBonusShape, PlayerLocation, Chat, Namez, Spell, Experience, ExperienceThisTrip: string;
SrlStatsID, SrlStatsPassword, WhichSpellToCast: string;
DragonStones: Boolean;
ShapesEnchanted, TimesLogged, MageLevel, NumberOfCosmics, CosmicsToBuy, CosmicsBought: Integer;
RelativeEnchantAmount: Extended;
S2X1, S2X2, S2Y1, S2Y2, Nine, Number1, Number2, Number3, Number4, Number5, Zero, One, Two, Three, Four, Five, Six, Seven, Eight: Integer;
S1X1, S1X2, S1Y1, S1Y2, FixedTimes: Integer;
S3X1, S3X2, S3Y1, S3Y2: Integer;
S4X1, S4X2, S4Y1, S4Y2: Integer;
S5X1, S5X2, S5Y1, S5Y2: Integer;
PizPointString: string;
ReportVars, PizPoints, ShapesEnchanted2, WorldsHopped: Integer;

procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
NumberOfCosmics := 85;
CosmicsToBuy := 10000;
WhichSpellToCast := 'Auto' Players[0].Active := True;
SrlStatsID := '';
SrlStatsPassword := '';
end;

procedure LoadBitmaps;
begin
Cube := BitmapFromString(100, 150, 'aA598978DA7DD04B0EC330080' + '4D02B61FE5E5227B9FF910A4DD4A6A2EAE6098D18191900203C01' + '590945A4AA5AC12B11AF199D3FC951896295D828B525957845FAA' + '8796C5B692CC03448778931BBCEBA103C0CBF1561FDD3523D72B3' + '79B66CC83ED6DDEB95E60C3B502438DEADA9F4CB09664877AF96E' + '8C89DA66FC648DD7EDB7561FB81D3C84BD19EF4D');
Cylinder := BitmapFromString(100, 150, 'a690AD78DAC5913B0EC42' + '00C44AF34FC0C9410C2FD8FB41E570959A495526CF3341AFC2C4B' + '00C03C14E845115A534A3D95E964933AB32032676B8AB009B47CB' + '13E31A769BDE7B29883B2A02AB3E7AB4CCBD1B6355AD2139B4AC1' + '8DC16D72606471C028DE0514C918DA78365B9E0BEF966CF8C2B2D' + 'BBE5DB8B12EF377EB87DBAEAEF4D7565BF9B8ED7FD6637EFDA30F' + 'DAB');
Ico := BitmapFromString(100, 150, 'a6BB6D78DA9DD2498E03210C05' + 'D02B19F067581A07EE7FA4368322A24ABA53BD792A996F0B28888' + '84A30886184DE4C4431A3F3A6CF3C2AD0618FA3EE67FC51C6F7EC' + '4DE8239946C68B40A08A17154DE5D4918BE58DA8B69AB60555C3D' + '25643B9213244DD7254B2FE4F306295253B0EB9CF7AB92B3C420D' + '4B8E9C8A6C2BAB303D2CE3BF911B48743B7BB9C34BBB6A7B46CDD' + '64549AEEEDEE94A9EBEB90720579D7BC09CE0979C381775CD45B4' + '99ECBF8B8852B79FCE7877CE731AA576FAC70BB9BED2E5FC47E75' + 'DCD97199F7E3B27802BCE73FD0092C');
Pentamid := BitmapFromString(100, 150, 'aD40BE78DA6D8E4112C42' + '00804BF0428A0C710E3FF9FB40E6EED7AC8A5996A0121229AF702' + '455BA886A80DC5A8820AAFF50127BC46668797861ED5FBF76A921' + 'B14B440F19CF5C86DCEC86520CF0E5EF034400E7161A3E1F6671F' + '424C5F7FF0EA52B8BCF87501177B9037B779F1357DD282CB3284B' + 'F4E6EBF6F38F90141C');
Status('Loaded Bitmaps');
end;

function FindFastRandoms: Boolean;
var
i: Integer;
begin
for I := 1 to 10 do
begin
case I of
1:
if FindDead then
Result := True;
2:
if FindMod then
begin
Result := True;
Writeln('Mod Found');
end;
3:
if Findnormalrandoms then
Result := True;
4:
if Findnormalrandoms then
Result := True;
5:
if Findnormalrandoms then
Result := True;
6:
if Findnormalrandoms then
Result := True;
7:
begin
if (not (TabExists(tab_inv))) then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
8:
if RC then
Result := True;
9:
if Srl_infight then
begin
Result := True;
Mouse(625 + random(10), 35 + random(10), 1, 1, True);
Flag;
end;
10:
if FindTalk then
Result := True;
end;
Wait(1);
end;
end;

function FindUnSolvableRandom: boolean;
var
c: integer;
begin
if not LoggedIn then
exit;
for c := 0 to 6 do
begin
case c of
0:
if FindDead then
begin
result := true;
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Loc := 'Dead';
Writeln(Players[CurrentPlayer].Rand);
LogOut;
end;
1:
if Findnormalrandoms then
begin
result := true;
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Rand := 'Mime';
Writeln(Players[CurrentPlayer].Rand);
LogOut;
end;
2:
if Findnormalrandoms then
begin
result := true;
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Rand := 'Maze';
Writeln(Players[CurrentPlayer].Rand);
LogOut;
end;
3: FindTalk;
4:
begin
end;
5:
if (not (TabExists(tab_inv))) then
begin
result := true;
Players[CurrentPlayer].Active := False;
Players[CurrentPlayer].Loc := 'No Gametab';
Writeln(Players[CurrentPlayer].loc);
LogOut;
end;
6: FindTalk;
end;
if result then
exit;
end;
end;

procedure Randoms;
begin
FindUnSolvableRandom;
FindNormalRandoms;
end;

procedure LoadUp;
begin
S1X1 := 464;
S1Y1 := 38;
S1X2 := 470;
S1Y2 := 52;
S2X1 := 467;
S2Y1 := 38;
S2X2 := 476;
S2Y2 := 52;
S3X1 := 470;
S3Y1 := 38;
S3X2 := 482;
S3Y2 := 52;
S4X1 := 480;
S4Y1 := 38;
S4X2 := 490;
S4Y2 := 52;
S5X1 := 487;
S5Y1 := 38;
S5X2 := 496;
S5Y2 := 52;
end;

function InEnchantArena: Boolean;
begin
if (SimilarColors(GetColor(462, 253), 26265, 4)) and (SimilarColors(GetColor(487, 257), 26265, 4)) then
Result := True
else
begin
Writeln('Not in the enchant arena. Go place yourself there.');
end;
end;

procedure GetPizPoints;
begin
Zero := BitmapFromString(6, 9, 'beNrLzcnOzTmTxgBBQDaECyQZGBCCQ' + 'BII4CohUhASLkskiWw4splwcYgbGGAgGwDk5i0l');
One := BitmapFromString(5, 10, 'beNpjYMjNz8VEZ9IYkNlABATIIlTh' + 'QkxGtosBAgAPNTO1');
Two := BitmapFromString(6, 10, 'beNpjYMjNz8VEZ9IYIAjOBZIMYAAX' + 'BLLhsnA2smIyuMhWIzuAARkAAEZqOw8=');
Three := BitmapFromString(5, 9, 'beNrLz83Nzz2TxgBEQAaEDSQZG' + 'BAiQDZEHM6Aq4ErgCuGG4IsiF8viA0AW3or0Q==');
Four := BitmapFromString(5, 10, 'beNrLz83NR0Fn0hjQuECAnwvXA' + 'udC1AAZcARRAJeFG4JmIERNLgDnQjI+');
Five := BitmapFromString(6, 10, 'beNrLz83NR0dn0hjgCC6CDOAiW' + 'HUhC0LUowkia0ezAtkoiHY0o0BsAAYFPFg=');
Six := BitmapFromString(7, 10, 'beNrLz80ryMNEufm5EHQmjQGIgA' + 'y4IITLwAAVRxaBcCEMoCBEDVwZsmlo2iEAzkZmYLKRDYGbzAADuQC' + '+rEZz');
Seven := BitmapFromString(5, 10, 'beNrLz80ryENGZ9IY4AjIzc3P' + 'ZQADIBcIgFwgArIh4nAuhVIQhOACAEPjMn4=');
Eight := BitmapFromString(6, 9, 'beNrLz83Nzz2TxgBBQDaECyQZw' + 'ADCBpJAAJeFsJF1wVXi10WMORBZBhjIBQCeEjBr');
Nine := BitmapFromString(8, 10, 'beNrLz83Nx4fOpDFAEJogkGQAA2Qp' + 'IBsIMNlwLZjiyFagiUOswCqO1Rz84hDTcgEdRldV');
LoadUp;
if FindBitmapToleranceIn(Zero, x, y, S1X1, S1Y1, S1X2, S1Y2, 100) then
Number1 := 0;
if FindBitmapToleranceIn(One, x, y, S1X1, S1Y1, S1X2, S1Y2, 100) then
Number1 := 1;
if FindBitmapToleranceIn(Two, x, y, S1X1, S1Y1, S1X2, S1Y2, 100) then
Number1 := 2;
if FindBitmapToleranceIn(Three, x, y, S1X1, S1Y1, S1X2, S1Y2, 100) then
Number1 := 3;
if FindBitmapToleranceIn(Four, x, y, S1X1, S1Y1, S1X2, S1Y2, 100) then
Number1 := 4;
if FindBitmapToleranceIn(Five, x, y, S1X1, S1Y1, S1X2, S1Y2, 100) then
Number1 := 5;
if FindBitmapToleranceIn(Six, x, y, S1X1, S1Y1, S1X2, S1Y2, 100) then
Number1 := 6;
if FindBitmapToleranceIn(Seven, x, y, S1X1, S1Y1, S1X2, S1Y2, 100) then
Number1 := 7;
if FindBitmapToleranceIn(Eight, x, y, S1X1, S1Y1, S1X2, S1Y2, 100) then
Number1 := 8;
if FindBitmapToleranceIn(Nine, x, y, S1X1, S1Y1, S1X2, S1Y2, 100) then
Number1 := 9;
if FindBitmapToleranceIn(Zero, x, y, S2X1, S2Y1, S2X2, S2Y2, 100) then
Number2 := 0;
if FindBitmapToleranceIn(One, x, y, S2X1, S2Y1, S2X2, S2Y2, 100) then
Number2 := 1;
if FindBitmapToleranceIn(Two, x, y, S2X1, S2Y1, S2X2, S2Y2, 100) then
Number2 := 2;
if FindBitmapToleranceIn(Three, x, y, S2X1, S2Y1, S2X2, S2Y2, 100) then
Number2 := 3;
if FindBitmapToleranceIn(Four, x, y, S2X1, S2Y1, S2X2, S2Y2, 100) then
Number2 := 4;
if FindBitmapToleranceIn(Five, x, y, S2X1, S2Y1, S2X2, S2Y2, 100) then
Number2 := 5;
if FindBitmapToleranceIn(Six, x, y, S2X1, S2Y1, S2X2, S2Y2, 100) then
Number2 := 6;
if FindBitmapToleranceIn(Seven, x, y, S2X1, S2Y1, S2X2, S2Y2, 100) then
Number2 := 7;
if FindBitmapToleranceIn(Eight, x, y, S2X1, S2Y1, S2X2, S2Y2, 100) then
Number2 := 8;
if FindBitmapToleranceIn(Nine, x, y, S2X1, S2Y1, S2X2, S2Y2, 100) then
Number2 := 9;
if FindBitmapToleranceIn(Zero, x, y, S3X1, S3Y1, S3X2, S3Y2, 100) then
Number3 := 0;
if FindBitmapToleranceIn(One, x, y, S3X1, S3Y1, S3X2, S3Y2, 100) then
Number3 := 1;
if FindBitmapToleranceIn(Two, x, y, S3X1, S3Y1, S3X2, S3Y2, 100) then
Number3 := 2;
if FindBitmapToleranceIn(Three, x, y, S3X1, S3Y1, S3X2, S3Y2, 100) then
Number3 := 3;
if FindBitmapToleranceIn(Four, x, y, S3X1, S3Y1, S3X2, S3Y2, 100) then
Number3 := 4;
if FindBitmapToleranceIn(Five, x, y, S3X1, S3Y1, S3X2, S3Y2, 100) then
Number3 := 5;
if FindBitmapToleranceIn(Six, x, y, S3X1, S3Y1, S3X2, S3Y2, 100) then
Number3 := 6;
if FindBitmapToleranceIn(Seven, x, y, S3X1, S3Y1, S3X2, S3Y2, 100) then
Number3 := 7;
if FindBitmapToleranceIn(Eight, x, y, S3X1, S3Y1, S3X2, S3Y2, 100) then
Number3 := 8;
if FindBitmapToleranceIn(Nine, x, y, S3X1, S3Y1, S3X2, S3Y2, 100) then
Number3 := 9;
if FindBitmapToleranceIn(Zero, x, y, S4X1, S4Y1, S4X2, S4Y2, 100) then
Number4 := 0;
if FindBitmapToleranceIn(One, x, y, S4X1, S4Y1, S4X2, S4Y2, 100) then
Number4 := 1;
if FindBitmapToleranceIn(Two, x, y, S4X1, S4Y1, S4X2, S4Y2, 100) then
Number4 := 2;
if FindBitmapToleranceIn(Three, x, y, S4X1, S4Y1, S4X2, S4Y2, 100) then
Number4 := 3;
if FindBitmapToleranceIn(Four, x, y, S4X1, S4Y1, S4X2, S4Y2, 100) then
Number4 := 4;
if FindBitmapToleranceIn(Five, x, y, S4X1, S4Y1, S4X2, S4Y2, 100) then
Number4 := 5;
if FindBitmapToleranceIn(Six, x, y, S4X1, S4Y1, S4X2, S4Y2, 100) then
Number4 := 6;
if FindBitmapToleranceIn(Seven, x, y, S4X1, S4Y1, S4X2, S4Y2, 100) then
Number4 := 7;
if FindBitmapToleranceIn(Eight, x, y, S4X1, S4Y1, S4X2, S4Y2, 100) then
Number4 := 8;
if FindBitmapToleranceIn(Nine, x, y, S4X1, S4Y1, S4X2, S4Y2, 100) then
Number4 := 9;
if FindBitmapToleranceIn(Zero, x, y, S5X1, S5Y1, S5X2, S5Y2, 100) then
Number5 := 0;
if FindBitmapToleranceIn(One, x, y, S5X1, S5Y1, S5X2, S5Y2, 100) then
Number5 := 1;
if FindBitmapToleranceIn(Two, x, y, S5X1, S5Y1, S5X2, S5Y2, 100) then
Number5 := 2;
if FindBitmapToleranceIn(Three, x, y, S5X1, S5Y1, S5X2, S5Y2, 100) then
Number5 := 3;
if FindBitmapToleranceIn(Four, x, y, S5X1, S5Y1, S5X2, S5Y2, 100) then
Number5 := 4;
if FindBitmapToleranceIn(Five, x, y, S5X1, S5Y1, S5X2, S5Y2, 100) then
Number5 := 5;
if FindBitmapToleranceIn(Six, x, y, S5X1, S5Y1, S5X2, S5Y2, 100) then
Number5 := 6;
if FindBitmapToleranceIn(Seven, x, y, S5X1, S5Y1, S5X2, S5Y2, 100) then
Number5 := 7;
if FindBitmapToleranceIn(Eight, x, y, S5X1, S5Y1, S5X2, S5Y2, 100) then
Number5 := 8;
if FindBitmapToleranceIn(Nine, x, y, S5X1, S5Y1, S5X2, S5Y2, 100) then
Number5 := 9;
PizPointString := (IntToStr(Number1) + IntToStr(Number2) + IntToStr(Number3) + IntToStr(Number4) + IntToStr(Number5));
PizPoints := StrToInt(PizPointString);
FreeBitmap(Zero);
FreeBitmap(One);
FreeBitmap(Two);
FreeBitmap(Three);
FreeBitmap(Four);
FreeBitmap(Five);
FreeBitmap(Six);
FreeBitmap(Seven);
FreeBitmap(Eight);
FreeBitmap(Nine);
end;

procedure FreeBitmaps;
begin
FreeBitmap(Cube);
FreeBitmap(Cylinder);
FreeBitmap(Ico);
FreeBitmap(Pentamid);
Status('Bitmaps Free');
end;

function BonusShape: string;
var
ix, iy, ShapeColor: Integer;
begin
LoadBitmaps;
if FindBitmapToleranceIn(Cube, ix, iy, 450, 250, 510, 320, 10) then
Result := 'Cube';
if FindBitmapToleranceIn(Cylinder, ix, iy, 450, 250, 510, 320, 10) then
Result := 'Cylinder';
if FindBitmapToleranceIn(Ico, ix, iy, 450, 250, 510, 320, 10) then
Result := 'Ico';
if FindBitmapToleranceIn(Pentamid, ix, iy, 450, 250, 510, 320, 10) then
Result := 'Pentamid';
FreeBitmaps;
if Result = '' then
begin
Writeln('Gone to backup shape finding');
ShapeColor := GetColor(491, 291);
if SimilarColors(ShapeColor, 1056410, 10) then
Result := 'Pentamid';
if SimilarColors(ShapeColor, 1461854, 10) then
Result := 'Cube';
if SimilarColors(ShapeColor, 13984609, 10) then
Result := 'Ico';
if SimilarColors(ShapeColor, 1279245, 10) then
Result := 'Cylinder';
end;
Status('Bonus Shape was: ' + Result + ' when last at center');
CurrentBonusShape := Result;
end;

procedure GetExp;
begin
case Spell of
'Lvl1': RelativeEnchantAmount := 13.125;
'Lvl2': RelativeEnchantAmount := 27.75;
'Lvl3': RelativeEnchantAmount := 44.25;
'Lvl4': RelativeEnchantAmount := 50.25;
'Lvl5': RelativeEnchantAmount := 58.5;
'Lvl6': RelativeEnchantAmount := 72.75;
end;
end;

procedure GetMageLevelAndSetSpell;
begin
MageLevel := GetSkillLevel('Magic');
Writeln('Your magic level is ' + IntToStr(MageLevel));
if MageLevel <= 6 then
begin
Writeln('Go train mage, nub. You cant even enchant!');
Logout;
TerminateScript;
end;
if (MageLevel <= 26) and (MageLevel > 5) then
begin
Writeln('Using Level 1 Enchant');
Spell := 'Lvl1';
RelativeEnchantAmount := 13.125;
end;
if (MageLevel <= 48) and (MageLevel > 26) then
begin
Writeln('Using Level 2 Enchant');
Spell := 'Lvl2';
RelativeEnchantAmount := 27.75;
end;
if (MageLevel <= 56) and (MageLevel > 48) then
begin
Writeln('Using Level 3 Enchant');
Spell := 'Lvl3';
RelativeEnchantAmount := 44.25;
end;
if (MageLevel <= 67) and (MageLevel > 56) then
begin
Writeln('Using Level 4 Enchant');
Spell := 'Lvl4';
RelativeEnchantAmount := 50.25;
end;
if (MageLevel <= 86) and (MageLevel > 67) then
begin
Writeln('Using Level 5 Enchant');
Spell := 'Lvl5';
RelativeEnchantAmount := 58.5;
end;
if (MageLevel > 86) then
begin
Writeln('Using Level 6 Enchant');
Spell := 'Lvl6';
RelativeEnchantAmount := 72.75;
end;
end;

procedure StraightWallsPlease;
var
PerfectWall, PerfectWall2, x, y, I: Integer;
report: integer;
begin
PerfectWall := BitmapFromString(17, 5, 'beNrLzmagCyjKziYVvX' + 'jznVREsi0Ag+ZbDA==');
PerfectWall2 := loadbitmap('a5765A78DAB58ECB11C' + '02008445BE2AF1E23D1FE4B4A96831DC86161DEB00B44C44E7F31' + 'DBAF1698BDA38526E66187783CE0DEB19902620BBAFA519970492' + 'F9757C2AE34A9E4BA1513AD0DA0C838248682CFF26603690C2279' + '541D2EE589A08D8B972ACC5FCF1BBA72D9A61B7AEFE70F27D');
MakeCompass('E');
Wait(500 + random(500));
SendArrowWait(1, 620 + random(80))
repeat
SendArrowWait(1, 10 + random(10)) Wait(200 + random(200)) I := I + 1;
until FindBitmapToleranceIn(PerfectWall, x, y, MMX1, MMY1, MMX2, MMY2, 100) or (I = 40) or FindBitmapToleranceIn(PerfectWall2, x, y, MMX1, MMY1, MMX2, MMY2, 100) if FindBitmapToleranceIn(PerfectWall, x, y, MMX1, MMY1, MMX2, MMY2, 100) or FindBitmapToleranceIn(PerfectWall2, x, y, MMX1, MMY1, MMX2, MMY2, 100) then
begin
Writeln('Fixed MM Walls');
exit;
end;
if I = 40 then
begin
Writeln('Not fixed...Trying again');
end;
MakeCompass('E');
Wait(500 + random(500));
SendArrowWait(1, 620 + random(80)) I := 0;
repeat
SendArrowWait(1, 10 + random(10)) Wait(200 + random(200)) I := I + 1;
until FindBitmapToleranceIn(PerfectWall, x, y, MMX1, MMY1, MMX2, MMY2, 150) or (I = 40) if FindBitmapToleranceIn(PerfectWall, x, y, MMX1, MMY1, MMX2, MMY2, 150) then
Writeln('Fixed MM Walls');
if I = 40 then
begin
Writeln('Not fixed...Using Make Compass');
MakeCompass('N');
end;
FreeBitmap(PerfectWall) FreeBitmap(PerfectWall2);
end;

procedure GoToPentamids;
begin
Writeln('Walking to Pentamids');
Status('Walking to Pentamids');
x := 604 + random(2);
y := 125 + random(2);
Mouse(x, y, 1, 1, True);
flag;
GetPizPoints;
x := 614 + random(2);
y := 103 + random(2);
Mouse(x, y, 1, 1, True);
flag;
Status('At Pentamids');
PlayerLocation := 'Pentamids';
end;

procedure GoToCubes;
begin
Writeln('Walking to Cubes');
Status('Walking to Cubes');
x := 599 + random(3);
y := 36 + random(3);
Mouse(x, y, 1, 1, True);
flag;
GetPizPoints;
x := 628 + random(3);
y := 67 + random(3);
Mouse(x, y, 1, 1, True);
flag;
Status('At Cubes');
PlayerLocation := 'Cubes';
end;

procedure GoToIcos;
begin
Writeln('Walking to Icos');
Status('Walking to Icos');
x := 684 + random(2);
y := 123 + random(2);
Mouse(x, y, 1, 1, True);
flag;
GetPizPoints;
x := 659 + random(2);
y := 116 + random(2);
Mouse(x, y, 1, 1, True);
flag;
Status('At Icos');
PlayerLocation := 'Icos';
end;

procedure AntiBan;
var
a, b: Integer;
begin
if (not LoggedIn) then
exit;
b := Random(100);
case b of
0: MMouse(random(MSX2), random(MSY2), 0, 0);
1: MouseSpeed := 9 + Random(3);
2: HoverSkill('random', false);
5: PickupMouse;
6: MouseSpeed := 9 + Random(3);
7: MouseSpeed := 9 + Random(3);
8: MMouse(random(MSX2), random(MSY2), 0, 0);
9: Wait(1 + Random(100));
10:
begin
GameTab(1 + random(12));
for a := 0 to 6 do
begin
Wait(300 + Random(200));
end;
GameTab(4);
end;
end;
end;

procedure GoToCylinders;
begin
Writeln('Walking to Cylinders');
Status('Walking to Cylinders');
x := 690 + random(3);
y := 35 + random(3);
Mouse(x, y, 1, 1, True);
flag;
GetPizPoints;
x := 655 + random(3);
y := 71 + random(3);
Mouse(x, y, 1, 1, True);
flag;
Status('At Cylinders');
PlayerLocation := 'Cylinders';
end;

procedure GoToRandom;
begin
case random(4) of
0:
begin
GoToCubes;
CurrentBonusShape := 'Cube';
end;
1:
begin
GoToIcos;
CurrentBonusShape := 'Ico';
end;
2:
begin
GoToPentamids;
CurrentBonusShape := 'Pentamid';
end;
3:
begin
GoToCylinders;
CurrentBonusShape := 'Cylinder';
end;
end;
Status('Bonus Shape: ' + CurrentBonusShape);
end;

function ShopOutOfStock: Boolean;
begin
if (SimilarColors(GetColor(282, 193), 65535, 2)) and (SimilarColors(GetColor(286, 194), 65535, 2)) and (SimilarColors(GetColor(285, 198), 65535, 2)) and (SimilarColors(GetColor(284, 191), 65535, 2)) then
begin
Status('Detected the stock of cosmics at 0');
Result := True Writeln('The Shop is outa stock fool');
end
else
Result := False;
end;

function NotEnoughEnchantPoints: Boolean;
begin
end;

procedure Endme;
begin
Writeln(' All finished =P ');
Writeln(' Thanks for using Sp0rk-ehs ');
Writeln(' Mage Arena Enchanter ');
wait(2000);
Writeln('Please post progress reports!');
Writeln('http://www.srl-forums.com/forum/sp0rkys-mage-arena-t20212.html');
end;

procedure WalkToShapeFromCenter;
begin
Status('Walking To Shape');
case BonusShape of
'Cube':
begin
GoToCubes;
Exit;
end;
'Cylinder':
begin
GoToCylinders;
Exit;
end;
'Ico':
begin
GoToIcos;
Exit;
end;
'Pentamid':
begin
GoToPentamids;
Exit;
end;
end;
if BonusShape = '' then
begin
Writeln('Fuckit, cant find a shape. Going random');
GoToRandom;
end;
end;

procedure TakeShapesBac;
var
ShapeText: string;
CouldntFindColor, TimesClickedShape: Integer;
begin
Status('Taking Shapes from the Pile');
TimesClickedShape := 0;
if (not (LoggedIn)) then
exit;
case CurrentBonusShape of
'Cylinder':
begin
ShapeText := 'linder';
ShapeColor := 1144589;
end;
'Cube':
begin
ShapeText := 'ube';
ShapeColor := 1550786;
end;
'Ico':
begin
ShapeText := 'cosa';
ShapeColor := 11752531;
end;
'Pentamid':
begin
ShapeText := 'tami';
ShapeColor := 1716197;
end;
end;
repeat
begin
if (not (LoggedIn)) then
exit;
wait(100 + random(50));
if FindColorSpiralTolerance(x, y, ShapeColor, 5, 70, 515, 249, 4) then
begin
MMouse(x, y, 1, 1);
wait(50 + random(25));
if IsUpText(ShapeText) then
Mouse(x, y, 1, 1, True);
TimesClickedShape := TimesClickedShape + 1;
Status('Clicked Shape Pile: ' + IntToStr(TimesClickedShape) + ' times');
flag;
wait(50 + random(50));
end
else
begin
CouldntFindColor := CouldntFindColor + 1;
Writeln('Cant Find Color');
if CouldntFindColor > 2 then
begin
Writeln('Really cant find color! It must not be in the middle of the screen') Writeln('Tried to fix too many times, Giving up');
Logout;
TerminateScript;
Exit;
end;
end;
end;
until InvFull;
end;

function FindMMColorTol(var x, y: Integer; color, tol: Integer): Boolean;
begin
Result := FindColorTolerance(x, y, color, MMX1, MMY1, MMX2, MMY2, tol);
end;

function FindCenter: Boolean;
begin
if (not (LoggedIn)) then
exit;
if FindMMColorTol(x, y, 9011075, 7) then
begin
Status('Center Found... Walking Back') Result := True;
Mouse(x + random(2), y + random(10), 1, 1, True);
Flag;
PlayerLocation := 'At Center';
end
else
begin
Result := False;
Writeln('Center Not Found... Logging') Logout;
Status('Center Not Found... Logged Character Out')
end;
end;

procedure WalkBackToCenter;
begin
case PlayerLocation of
'Cylinders':
begin
Status('Walking from Cylinders to center') Mouse(615 + random(2), 113 + random(2), 1, 1, True);
flag;
GetPizPoints;
if (not (FindCenter)) then
begin
Status('Didnt find center. Walking then trying again') Mouse(601 + random(2), 118 + random(2), 1, 1, True);
flag;
FindCenter
end;
end;
'Cubes':
begin
Status('Walking from Cubes to center') Mouse(678 + random(2), 110 + random(2), 1, 1, True);
flag;
GetPizPoints;
if (not (FindCenter)) then
begin
Status('Didnt find center. Walking then trying again') Mouse(671 + random(2), 125 + random(2), 1, 1, True);
flag;
FindCenter;
end;
end;
'Pentamids':
begin
Status('Walking from Pentamids to center') Mouse(669 + random(2), 49 + random(2), 1, 1, True);
flag;
GetPizPoints;
if (not (FindCenter)) then
begin
Status('Didnt find center. Walking then trying again') Mouse(690 + random(2), 38 + random(2), 1, 1, True);
flag;
FindCenter;
end;
end;
'Icos':
begin
Status('Walking from Icos to center');
Mouse(607 + random(2), 55 + random(2), 1, 1, True);
flag;
GetPizPoints;
if (not (FindCenter)) then
begin
Status('Didnt find center. Walking then trying again') Mouse(611 + random(2), 50 + random(2), 1, 1, True);
flag;
FindCenter;
end;
end;
end;
end;

procedure BuyProg;
begin
ClearDebug;
Writeln('------------------------------------------');
Writeln('- Sp0rk-ehs Mage Arena Enchanter -');
Writeln('- Buy Mode -');
Writeln('- Worlds Hopped : ' + IntToStr(WorldsHopped));
Writeln('- Cosmics Bought: ' + IntToStr(CosmicsBought));
Writeln('------------------------------------------');
end;

function CheckPoints: Boolean;
begin
if FindBlackChatMessage('cannot afford that ite') then
begin
LogOut;
BuyProg;
Writeln('All out of points - Bought max amount');
TerminateScript;
end;
end;

function MageTrainingArenaShopScreen: Boolean;
var
ArenaShop, iix, iiy: Integer;
begin
if SimilarColors(GetColor(483, 35), 39423, 15) then
begin
Result := True;
end
else
begin
Writeln('Mage Training Arena Shop Window Not Found.');
Status('Mage Training Arena Shop Window Not Found.');
Result := False
end;
end;

procedure AntiBan2;
var
a, b: Integer;
begin
if (not LoggedIn) then
exit;
b := Random(100);
case b of
0: MMouse(random(MSX2), random(MSY2), 0, 0);
1:
begin
HoverSkill('magic', false);
GameTab(4);
end;
2:
begin
HoverSkill('random', false);
GameTab(4);
end;
5: PickupMouse;
6: MouseSpeed := 20 + Random(3);
7: MouseSpeed := 22 + Random(3);
8: MMouse(random(MSX2), random(MSY2), 0, 0);
9: Wait(1 + Random(100));
10:
begin
GameTab(1 + random(12));
begin
Wait(300 + Random(200));
end;
GameTab(4);
end;
end;
end;

procedure BuyCosmics;
var
Bought, CosmicRune, ix, iy: Integer;
begin
if (not (LoggedIn)) then
exit;
wait(2000 + random(1000));
if MageTrainingArenaShopScreen then
begin
CosmicRune := BitmapFromString(12, 9, 'beNptzmsKgzAQBOBzeMk' + 'qIhobX/HRNFUrpSi9nPQqDowsgRbmxzL7keweLMOAfPfgfbfI+nDb' + 'NCKf54yScU0tM/DLWoRY+luhZR6NmbuOL1Oy76+5GDJf+qvfgFH+3' + 'dqqxJEIHmSj49gH+BoXglGyzKNIQJ2mrVJglNJn4UXmMknIKM/+AP' + 'QJtrA=');
if FindBitmapToleranceIn(CosmicRune, x, y, MSX1, MSY1, MSX2, MSY2, 100) then
begin
MMouse(x, y, 1, 1);
Writeln('Found Cosmic Bitmap');
end;
FreeBitmap(CosmicRune);
wait(250 + random(50));
if IsUpText('osmic') then
repeat
begin
if (not (LoggedIn)) then
exit;
if random(4) > 2 then
begin
AntiBan2;
end;
ix := x;
iy := y;
ix := ix + random(15);
iy := iy + random(15);
Mouse(ix, iy, 1, 1, False);
wait(40 + random(20));
ChooseOption('uy');
wait(30 + random(20));
Bought := Bought + 1;
CosmicsBought := CosmicsBought + 1;
Status('Bought: ' + IntToStr(Bought) + ' cosmics');
CheckPoints;
end
until (bought = 105) or ShopOutOfStock or (not (MageTrainingArenaShopScreen)) or FindBlackChatMessage('stock');
mousespeed := 10;
end
else
begin
Writeln('Mage screen or guardian fuckup.');
Logout;
end;
end;

procedure TakeShapes;
var
ShapeText: string;
CouldntFindColor, TimesClickedShape: Integer;
begin
Status('Taking Shapes from the Pile');
TimesClickedShape := 0;
if (not (LoggedIn)) then
exit;
if CurrentBonusShape = 'Cylinder' then
begin
ShapeText := 'linder';
ShapeColor := 1144589;
end;
if CurrentBonusShape = 'Cube' then
begin
ShapeText := 'ube';
ShapeColor := 1550786;
end;
if CurrentBonusShape = 'Ico' then
begin
ShapeText := 'cosa';
ShapeColor := 11752531;
end;
if CurrentBonusShape = 'Pentamid' then
begin
ShapeText := 'tami';
ShapeColor := 1716197;
end;
repeat
begin
if (not (LoggedIn)) then
exit;
wait(100 + random(50));
if FindColorSpiralTolerance(x, y, ShapeColor, 5, 70, 515, 249, 4) then
begin
MMouse(x, y, 1, 1);
wait(50 + random(25));
if IsUpText(ShapeText) then
Mouse(x, y, 1, 1, True);
TimesClickedShape := TimesClickedShape + 1;
Status('Clicked Shape Pile: ' + IntToStr(TimesClickedShape) + ' times');
flag;
wait(50 + random(50));
end
else
begin
CouldntFindColor := CouldntFindColor + 1;
Writeln('Cant Find Color');
if CouldntFindColor > 2 then
begin
Writeln('Really cant find color! It must not be in the middle of the screen') Writeln('Walking back and re-calibrating Minimap Walls');
InEnchantArena;
WalkBackToCenter;
InEnchantArena;
StraightWallsPlease;
InEnchantArena;
WalkToShapeFromCenter;
InEnchantArena;
TakeShapesBac;
FixedTimes := FixedTimes + 1;
if FixedTimes > 4 then
begin
Writeln('Tried to fix too many times, Giving up');
Logout;
TerminateScript;
Exit;
end;
end;
end;
end;
until InvFull;
end;

procedure AssignXandY;
begin
if Spell = 'Lvl1' then
begin
x := 685 + random(8);
y := 234 + random(8);
end;
if Spell = 'Lvl2' then
begin
x := 613 + random(8);
y := 281 + random(8);
end;
if Spell = 'Lvl3' then
begin
x := 566 + random(8);
y := 329 + random(8);
end;
if Spell = 'Lvl4' then
begin
x := 589 + random(8);
y := 353 + random(8);
end;
if Spell = 'Lvl5' then
begin
x := 612 + random(8);
y := 400 + random(8);
end;
if Spell = 'Lvl6' then
begin
x := 685 + random(8);
y := 425 + random(8);
end;
end;

procedure CheckCosmics;
begin
if Spell = 'Lvl1' then
begin
if SimilarColors(GetColor(691, 235), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl2' then
begin
if SimilarColors(GetColor(619, 282), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl3' then
begin
if SimilarColors(GetColor(570, 330), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl4' then
begin
if SimilarColors(GetColor(594, 354), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl5' then
begin
if SimilarColors(GetColor(618, 400), 71705, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
if Spell = 'Lvl6' then
begin
if SimilarColors(GetColor(690, 426), 71961, 4) then
begin
Writeln('Youve run out of cosmics');
LogOut;
TerminateScript;
end;
end;
end;

procedure EnchantInventory;
var
ShapeColorInInvent: Integer;
begin
if (not (LoggedIn)) then
exit;
if CurrentBonusShape = 'Cube' then
ShapeColorInInvent := 2921394;
if CurrentBonusShape = 'Pentamid' then
ShapeColorInInvent := 1319850;
if CurrentBonusShape = 'Ico' then
ShapeColorInInvent := 9848132;
if CurrentBonusShape = 'Cylinder' then
ShapeColorInInvent := 1344269;
GameTab(7);
repeat
if (not (LoggedIn)) then
exit;
AssignXandY;
wait(900 + random(100));
if (not GameTab(7)) then
begin
GameTab(7);
end;
CheckCosmics;
MMouse(x, y, 0, 0);
if IsUpText('ant') then
begin
Mouse(x, y, 1, 1, True);
wait(100 + random(50)) if FindColorSpiralTolerance(x, y, ShapeColorInInvent, 694, 434, 717, 454, 4) then
begin
x := 693 + random(20) y := 435 + random(20) Mouse(x, y, 1, 1, True);
ShapesEnchanted := ShapesEnchanted + 1;
ShapesEnchanted2 := ShapesEnchanted2 + 1;
Status('Shapes enchanted this trip:' + IntToStr(ShapesEnchanted2));
end;
end;
until FindColorSpiralTolerance(x, y, 16316664, 694, 434, 717, 454, 4);
GameTab(4);
Status('All shapes in inventory enchanted!');
end;

procedure DepositOrbs;
var
Found: Boolean;
begin
if (not (LoggedIn)) then
exit;
repeat
if (not (LoggedIn)) then
exit;
wait(100 + random(100));
GetPizPoints;
if FindColorSpiralTolerance(x, y, 8685966, 5, 6, 511, 332, 4) then
MMouse(x, y, 1, 1);
if IsUpText('ole') then
begin
Found := True;
Status('Found orb deposit hole');
Mouse(x, y, 1, 1, True);
flag;
wait(500 + random(100));
Status('Orbs deposited');
ClickToContinue;
wait(400 + random(100));
ClickToContinue;
end;
until Found;
TripsDone := TripsDone + 1;
end;

procedure CloseCosmicWindow;
begin
if (not (LoggedIn)) then
exit;
Status('Closing mage arena buy screen');
x := 475 + random(9);
y := 30 + random(9);
MMouse(x, y, 1, 1) wait(500 + random(200));
if IsUpText('lose') then
begin
Mouse(x, y, 1, 1, True);
Status('Mage Arena buy screen closed.');
wait(500 + random(200));
end;
end;

procedure FindPortal;
var
Tries: Integer;
Clicked: Boolean;
begin
Status('Trying to find enchant arena portal. Tried: ' + IntToStr(Tries) + ' times');
repeat
if (not (LoggedIn)) then
exit;
if FindColorSpiralTolerance(x, y, 1842975, 20, 20, 338, 333, 3) then
begin
wait(250 + random(100)) MMouse(x, y, 1, 1) Tries := Tries + 1;
Status('Trying to find enchant arena portal. Tried: ' + IntToStr(Tries) + ' times');
if IsUpText('chant') then
begin
Mouse(x, y, 1, 1, True) Flag;
wait(1000 + random(1000));
Clicked := True;
Status('Enchant Arena Re-Entered');
end;
end;
until (Clicked) or (Tries > 20);
end;

procedure WalkToEnchantChamber;
begin
if (not (LoggedIn)) then
exit;
SetRun(True);
if FindSymbol(x, y, 'minigame') then
begin
Status('Found minigame symbol');
Mouse(x - 40, y, 1, 1, True) Flag;
end
else
begin
Writeln('Didnt find minigame symbol. Co-ords.');
Status('Using co-ords to walk to portal');
Mouse(620 + random(1), 15 + random(1), 1, 1, True) wait(2000 + random(100));
flag;
end;
FindPortal;
end;

procedure OrderBy(Which, UpDown: string);
var
Origin, OBx, OBy: Integer;
begin
case Which of
'world':
begin
case UpDown of
'up': Origin := 284;
'down': Origin := 297;
end
end;
'players':
begin
case UpDown of
'up': Origin := 393;
'down': Origin := 409;
end
end;
'location':
begin
case UpDown of
'up': Origin := 503;
'down': Origin := 519;
end
end;
'type':
begin
case UpDown of
'up': Origin := 613;
'down': Origin := 629;
end
end;
end;
MMouse(Origin, 7, 7, 7) GetMousePos(OBx, OBy);
repeat
Mouse(OBx, OBy, 0, 0, True);
Wait(500);
until FindColorSpiralTolerance(OBx, OBy, 2851375, Origin, 7, Origin + 7, 7 + 7, 50);
end;

procedure TradeWithRewardsGuardian;
var
tries: Integer;
begin
if (not (LoggedIn)) then
exit;
repeat
if (not (LoggedIn)) then
exit;
wait(100 + random(100));
if FindColorSpiralTolerance(x, y, 5479603, 5, 6, 511, 332, 4) then
begin
Status('Moving mouse to rewards guardian');
MMouse(x, y, 1, 1);
tries := tries + 1;
if IsUpText('ewa') then
begin
Status('Rewards guardian found');
Mouse(x, y, 1, 1, False);
ChooseOption('rade') flag;
Status('Chose to trade with guardian');
wait(1000 + random(500));
Exit;
end;
end;
until tries > 10;
Writeln('Couldnt find guardian');
Logout;
end;

procedure ChooseRandomWorld;
begin
Status('Choosing a random world');
case random(28) of
0: Mouse(388, 343, 2, 2, True);
1: Mouse(388, 366, 2, 2, True);
2: Mouse(388, 390, 2, 2, True);
3: Mouse(393, 411, 2, 2, True);
4: Mouse(393, 436, 2, 2, True);
5: Mouse(395, 459, 2, 2, True);
6: Mouse(394, 481, 2, 2, True);
7: Mouse(484, 44, 2, 2, True);
8: Mouse(489, 68, 2, 2, True);
9: Mouse(484, 90, 2, 2, True);
10: Mouse(493, 115, 2, 2, True);
11: Mouse(488, 135, 2, 2, True);
12: Mouse(493, 159, 2, 2, True);
13: Mouse(488, 181, 2, 2, True);
14: Mouse(489, 204, 2, 2, True);
15: Mouse(487, 227, 2, 2, True);
16: Mouse(494, 250, 2, 2, True);
17: Mouse(488, 272, 2, 2, True);
18: Mouse(490, 293, 2, 2, True);
19: Mouse(501, 324, 2, 2, True);
20: Mouse(486, 345, 2, 2, True);
21: Mouse(487, 367, 2, 2, True);
22: Mouse(486, 391, 2, 2, True);
23: Mouse(489, 386, 2, 2, True);
24: Mouse(481, 412, 2, 2, True);
25: Mouse(478, 438, 2, 2, True);
26: Mouse(486, 456, 2, 2, True);
27: Mouse(478, 481, 2, 2, True);
end;
end;

procedure ClickWorldSwitchButton;
begin
MMouse(8, 466, 90, 25);
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
repeat
Wait(10);
until (GetColor(17, 477) = 0);
end;

function ExToStr(i: integer; e: extended): string;
begin
result := FloatToStr(i * e);
end;

function NumToStr(i: integer; e: extended): string;
begin
result := IntToStr(Ceil(i * e));
end;

procedure Report;
begin
ClearReport;
AddToReport('/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\');
AddToReport('| Visit srl-forums.com |');
AddToReport('| for script updates |');
AddToReport('| ~Sp0rky~ |');
if (SrlStatsID = '') or (SrlStatsPassword = '') then
begin
AddToReport('|Please register for srl stats!|');
end;
AddToReport('| Thank you for using: |');
AddToReport('| M.A.E. v0.2 |');
AddToReport('\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/');
end;

procedure ProgressReport;
begin
ClearDebug;
Writeln('------------------------------------------');
Writeln('-Sp0rk-ehs Mage Arena Enchanter-');
Writeln('-Trips Done : ' + IntToStr(TripsDone));
WriteLn('-TimeRunning : ' + TimeRunning);
Writeln('-Enchanted : ' + IntToStr(ShapesEnchanted) + ' Shapes.');
Experience := NumToStr(ShapesEnchanted, RelativeEnchantAmount);
ExperienceThisTrip := NumToStr(ShapesEnchanted2, RelativeEnchantAmount);
Writeln('-Gained approx. : ' + Experience + ' Magic Exp.');
Writeln('-Pizzaz points : ' + IntToStr(PizPoints));
Writeln('-Logged back in : ' + IntToStr(TimesLogged) + ' times.');
Writeln('------------------------------------------');
ShapesEnchanted2 := 0;
end;

begin
cleardebug;
DeclarePlayers;
SetupSRL;
ActivateClient;
mousespeed := 10;
if Mode = 'Arena' then
begin
LoginPlayer;
Writeln('Arena Mode Initiated...');
makecompass('n');
if InEnchantArena then
begin
if (WhichSpellToCast = ('Auto')) or (WhichSpellToCast = ('auto')) then
begin
GetMageLevelAndSetSpell;
end
else
begin
Spell := WhichSpellToCast;
Writeln('Casting ' + Spell + ' Spell.');
GetExp;
end;
repeat
LoginPlayer;
WalkToShapeFromCenter;
InEnchantArena;
TakeShapes;
AntiBan;
InEnchantArena;
EnchantInventory;
AntiBan;
WalkBackToCenter;
InEnchantArena;
DepositOrbs;
AntiBan;
ProgressReport;
SrlRandomsReport;
Report;
if (not (LoggedIn)) then
begin
if TimesLogged > 2 then
begin
Writeln('Logged in too many times. Terminating for the safety of the user');
Players[CurrentPlayer].Active := False;
break;
end;
Writeln('Logging Player Back In');
Players[CurrentPlayer].Active := True;
wait(15000 + random(5000));
LoginPlayer;
Randoms;
TimesLogged := TimesLogged + 1;
WalkToEnchantChamber;
Randoms;
FindCenter;
end;
until (false) or (ShapesEnchanted >= NumberOfCosmics);
end;
end;
if Mode = 'Buy' then
begin
Writeln('Buy Mode Initiated...');
repeat
if (not (LoggedIn)) then
begin
Status('Clicking the worldswitch button');
ClickWorldSwitchButton;
Status('Ordering by players and type');
OrderBy('players', 'down');
OrderBy('type', 'down');
ChooseRandomWorld;
wait(2000);
Status('Logging player');
LoginPlayer;
WorldsHopped := WorldsHopped + 1;
ReportVars := ReportVars + 1;
end;
setangle(0);
Randoms;
TradeWithRewardsGuardian;
Wait(2000 + random(500));
BuyCosmics;
CloseCosmicWindow;
Randoms;
Logout;
BuyProg;
SrlRandomsReport;
Report;
until (CosmicsToBuy <= CosmicsBought);
end;
Endme;
end.

Well here's a nicely formatted script or you. I also change SOME of the numerous if..thens to cases. It compiles nicely. There's still some if..thens to fix up but yeah.

samerdl

2013-05-01 06:47:42

From: Chris!

Well here's a nicely formatted script or you. I also change SOME of the numerous if..thens to cases. It compiles nicely. There's still some if..thens to fix up but yeah.



Any idea what the Bitmaps direct to? i couldn't convert it from string to bitmap. Think i'll take a shot at this if no one else wants to :p

samerdl

2013-05-02 01:04:33

just watched a video tutorial - I GET IT NOW .

http://www.youtube.com/watch?v=len31Zgmfqg

Oh by the way, the script i posted WORKS! not sure for how long it can work, but it works lol! you just gota start inside the enchant area at the CENTER but i wouldn't recommend using it, unless you create add more mouse randomrange

you can also make it load smart if you want, by defining smart at the start of the script

hdhdhd

2013-05-02 07:02:12

can you still fully revive this because i would love to have an mta bot :D

hdhdhd

2013-05-02 07:03:12

yes please do it im sure everyone would love you for it

samerdl

2013-05-02 08:06:25

From: hdhdhd
yes please do it im sure everyone would love you for it


To write something that just power trains - enchants the same pile of orbs then deposits then repeats - is easy - you too could probably write it in about 1-2 hours.

To write something that collects then enchants the bonus items properly without failing would take a bit longer.

{it would first collect all the items, then enchant them as they flash on the screen then deposit then recollect and enchant accordingly as the bonus item flash on the screen and repeat}

I think i can make a power trainer, i'll try to look into it tonight/tomorrow (still got some stuff to do on another project + studies), not promising anything.

For now lets try to recruit and convince better scripters into the project;

calling out the following from oldschool script section:

@wthomas
@Nebula
@ineedbot
@Eduard
@maikel233

You are all mentioned - please respond to this thread if your interested in taking up the project and rejuvenating SRL with an epic & exclusive Revived Mage arena script.

Any one? Please respond to this thread, if no then i'll try a kick at it. (But i suck!)

wthomas

2013-05-02 08:53:18

I have a few points to make on this topic. Firstly all those you mentioned including myself probably knew of this thread before your mention. Thus I can conclude that the chance that any of them will change their mind of the matter is pretty low. Secondly, it takes about half a brain and 1 hour or a full brain and 30 minutes to make this script work by changing a few outdated srl functions and sorting the random events out. There are cheaper ways to train magic that this so people would only use it for making indirect profit, and lots of it.

I might have a look at this but I'm over weighed with assignments right now, you may have noticed my lack of presence on the IRC and also forum during the last 2 weeks. Its funny you mention me right now, its the first time I looked at the forums in the last 3 days :p

samerdl

2013-05-02 09:02:38

Because i love you Thomas!

Edit: thomas your right, i'll try to work on this after class or tomorrow! not trying to bother you or anything. Sorry!. Thanks for taking time and responding friend, take care!

and ye i haven't seen you on irc in ages

vegita2002001

2013-05-06 13:10:10

I am curious, has your script worked?

Doofoofoo

2013-05-07 09:30:35

I adjusted a few things that seemed to be outdated:

all the GameTab(x) need to be an identifier not a number DIRECT EXAMPLE: 'tab_Magic' for the magic tab (the number 7 is used in this code) and 'tab_Inv' (4 is used in this code)

secondly the IsUpText at about Line 1230 doesn't seem to be the correct call so I just commented the if statement out…

Finally, add {$DEFINE SMART8} to the top as samerdl has said.

Not familiar with this type of coding/language but from logical reasoning and trial and error these fixes have helped mine run! (Going strong for ten minutes update this later!)

Thanks samerdl for posting that updated code!! <3
Doofoofoo

**UPDATE/EDIT** Script is running near flawlessly for 3 hrs 30 mins!!! Pizzazz pts. are roughly the expected value for your enchant level, which makes sense. Decent speed (about 800+ casts/hr).

IMayoboeiI

2013-05-07 14:57:01

From: Doofoofoo
I adjusted a few things that seemed to be outdated:

all the GameTab(x) need to be an identifier not a number DIRECT EXAMPLE: 'tab_Magic' for the magic tab (the number 7 is used in this code) and 'tab_Inv' (4 is used in this code)

secondly the IsUpText at about Line 1230 doesn't seem to be the correct call so I just commented the if statement out…

Finally, add {$DEFINE SMART8} to the top as samerdl has said.

Not familiar with this type of coding/language but from logical reasoning and trial and error these fixes have helped mine run! (Going strong for ten minutes update this later!)

Thanks samerdl for posting that updated code!! <3
Doofoofoo

**UPDATE/EDIT** Script is running near flawlessly for 3 hrs 30 mins!!! Pizzazz pts. are roughly the expected value for your enchant level, which makes sense. Decent speed (about 800+ casts/hr).



How about releasing it? Considered it?

Doofoofoo

2013-05-07 15:15:11

I just attached it here, ran for me 6hrs straight hope it works for you!

samerdl

2013-05-11 19:18:28

From: Doofoofoo
I just attached it here, ran for me 6hrs straight hope it works for you!



Well done friend! its revived! now if only we can make it enchant during bonus times and collect all cubes! will get to that later

Also, lol just noticed there is like 50 sentences of If then.. Why didn't he just do For Do