SCAR Code:
program New;
{.include srl/srl.scar}
{.include srl/srl/skill/magic.scar}
Const
CastsToDo=5000;
UsingSmart=True; //This is only for minimised autoing
var
x,y,i,mx,my,MageLVL,casted,DummyColour:Integer;
Spell:String;
procedure MyWait(Time: Integer);
var
Marker: Integer;
begin
MarkTime(Marker);
while (TimeFromMark(Marker) < Time) do
begin
Wait(50);
FindNonInventoryRandoms;
if (i=10) then
begin
FindNormalRandoms;
i:=0;
end;
end;
end;
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := 'cakedon ko';
Players[0].Pass := 'magicgate';
Players[0].Nick := 'aked';
Players[0].Active := True;
End;
(*¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\
|| TR - Displays the about of time the script has been running ||
|| (Only added here so I can have hours->hrs,etc. shortened) ||
|| By: Phalanx + RsN, small edit by Hy71194 ||
\\_________________________________________________________________*)
function TR: String;
var
RHours, Minutes, Seconds, RMinutes, RSeconds: LongInt;
Time: string;
begin
Seconds := GetTimeRunning div 1000;
Minutes := Seconds div 60;
RHours := Minutes div 60;
Time := IntToStr(Seconds) + ' Secs';
if Minutes <> 0 then
begin
RSeconds := Seconds mod (Minutes * 60);
Time := IntToStr(Minutes) + ' Mins and ' + IntToStr(RSeconds) +
' Secs';
end;
if RHours <> 0 then
begin
RMinutes := Minutes mod (RHours * 60);
RSeconds := Seconds mod (Minutes * 60);
Time := IntToStr(RHours) + ' Hrs, ' + IntToStr(RMinutes) +
' Mins, and ' + IntToStr(RSeconds) + ' Secs';
end;
Result := Time;
end;
Procedure Proggy;
var
ExpForSpell, ExpGained:Integer;
Begin
If Spell = 'Confuse' then ExpForSpell:= 13; // Pretty sure that
If Spell = 'Weaken' then ExpForSpell:= 21; // this could be a
If Spell = 'Curse' then ExpForSpell:= 29; // case, dont know how though.
ExpGained:= Casted*ExpForSpell;
WriteLn('The script has run for: '+TR);
WriteLn('Casted '+IntToStr(casted)+'/'+IntToStr(CastsToDo));
WriteLn('Gained '+(IntToStr(ExpGained))+' exp.');
End;
Procedure SetupMage1;
begin
Players[CurrentPlayer].level[6] := GetSkillInfo('magic',False);
MageLVL:= Players[CurrentPlayer].level[6];
MyWait(500);
if MageLVL > 2 then Spell:= 'Confuse';
if MageLVL > 10 then Spell:= 'Weaken';
if MageLVL > 18 then Spell:= 'Curse';
ClearDebug;
Writeln('Using the spell: '+Spell);
end;
procedure ChangeMusic; // Leeched off HY :D
begin // Changes RS Music track :)
GameTab(13);
Wait(Random(2000));
MouseBox(715,284,728,435,1);
Wait(40+Random(3000));
if FindColorTolerance(mx,my, 65280, 562, 270, 661, 450, 5) then
begin
Mouse(mx + Random(125), my + Random(8), 0, 0, True);
Wait(Random(3000));
end else
begin
MouseBox(562,268,711,449,1);
Wait(Random(5000));
end;
FindNormalRandoms;
end;
function AutoColor: Integer;
var
I, R, G, B, Len, TestColor: Integer;
H, S, L, X, Y, Z: Extended;
P: TPointArray;
begin
Result := -1;
FFlag(0);
FindColorsTolerance(P, 9664355, MMX1, MMY1, MMX2, MMY2, 120);
Len := High(P);
for I := 0 to Len do
if RS_OnMinimap(P[I].X, P[I].Y) then
begin
TestColor := GetColor(P[I].X, P[I].Y);
ColorToRGB(TestColor, R, G, B);
if InRange(R - B, -68, -28) then
if InRange(R - G, -40, 0) then
if InRange(G - B, -48, -8) then
begin
ColorToHSL(TestColor, H, S, L);
if InRange(Round(H - L), -4, 26) then
if InRange(Round(S - H), -55, -25) then
if InRange(Round(S - L), -44, -14) then
begin
ColorToXYZ(TestColor, X, Y, Z);
if InRange(Round(X - Y), -8, 6) then
if InRange(Round(Y - Z), -19, -5) then
begin
Result := TestColor;
Exit;
end;
end;
end;
end;
WriteLn('Autocolor did not find the color.');
end;
Procedure CastTehSpells;
begin
CastOn(Spell,'Magic dummy',DummyColour,20);
casted:= casted+1;
i:=i+1;
ClearDebug;
Proggy;
MyWait(1000+Random(200));
end;
begin
SetupSRL;
DeclarePlayers;
If Not LoggedIn then loginplayer;
SetupMage1;
MakeCompass('e');
AutoColor;
DummyColour:=AutoColor;
repeat
CastTehSpells;
until(casted=CastsToDo)
end.