SCAR Code:
program PMOW;
{.Include SRL/SRL.SCAR}
{.Include SRL/SRL/Skill/WoodCutting.SCAR}
//Global Vars
Var Mined, Chopped, loads :integer;
Var XPG :string;
procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
///// fill all of below in
Players[0].Name := 'f'; // username
Players[0].Pass := 'y'; //password
Players[0].Nick := 'i'; //3-4 letters of your name. No first letter or caps
Players[0].Active := true; //if it's active
Players[0].strings[0]:= 'copper'; //what rock you mining? copper, iron or tin(If mining)
Players[0].strings[1]:= 'chop'; // chop or mine
Players[0].integers[0]:= 50; // ore/logs to mine/chop
end;
Procedure Anti;
begin
case random(40) of
0:HoverSkill('Random',false);
1:SleepAndMoveMouse(1000+random(500));
2:RandomRClick;
3:PickUpMouse;
4:RandomMovement;
end;
wait(500+random(500))
end;
function ACIron: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 1711918, MSX1, MSY1, MSX2, MSY2, 24);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 3.83) and (H <= 4.92) and (S >= 28.55) and (S <= 29.65) and (L >= 8.80) and (L <= 19.24) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 0.81) and (X <= 3.20) and (Y >= 0.74) and (Y <= 2.85) and (Z >= 0.57) and (Z <= 1.99) then
begin
Result := arC[i];
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
function ACCopper: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 4621284, MSX1, MSY1, MSX2, MSY2, 32);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 6.33) and (H <= 6.46) and (S >= 56.89) and (S <= 97.79) and (L >= 51.74) and (L <= 64.92) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 31.45) and (X <= 52.03) and (Y >= 25.38) and (Y <= 41.71) and (Z >= 7.78) and (Z <= 12.53) then
begin
Result := arC[i];
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
function ACtin: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 9671834, MMX1, MMY1, MMX2, MMY2, 24);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 0.00) and (H <= 2.40) and (S >= 2.52) and (S <= 4.42) and (L >= 53.71) and (L <= 64.33) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 23.62) and (X <= 35.26) and (Y >= 24.33) and (Y <= 36.37) and (Z >= 25.98) and (Z <= 38.43) then
begin
Result := arC[i];
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Procedure DropIt;
Var Log, Ore, X, Y, O :integer;
begin
Log := DTMFromString('78DA63DCCDC4C0B089910119B899CA318840D' +
'9FF8180713350CD4A54350C0C4C601226CAB81FC85F4E40CD5120' +
'7F35AA1A517E365435A7806AB61261D72E026A3611A1662D90BF1' +
'1BF1A00F16E1068');
If(Not(InvFull))then exit;
If Not (FindDtm(Log, X, Y, MIX1, MIY1, MIX2, MIY2)) or
(FindDtm(Ore, X, Y, MIX1, MIY1, MIX2, MIY2)) then exit;
////////////////////////////////////////////////////////////////
If(FindDtm(Log, X, Y, MIX1, MIY1, MIX2, MIY2)) or
(FindDtm(Ore, X, Y, MIX1, MIY1, MIX2, MIY2)) then
begin
marktime(O)
repeat
mouse(x,y,3,3,false)
wait(25+random(50))
WaitOption('rop', 100+Random(50))
until(not(FindBitmapToleranceIn(Ore, x, y, MIX1, MIY1, MIX2, MIY2, 20))) and (FindDtm(Ore, X, Y, MIX1, MIX1, MIX2, MIY2)) or (TimeFromMark(O) >= 30000)
loads:=loads+1
end;
end;
procedure MineIt;
var X, Y, I, E :integer;
begin
if(not(loggedin))then exit;
if(invfull) then dropit;
case Lowercase(Players[currentplayer].strings[0]) of
'iron':findcolorspiraltolerance(x,y,ACIron,msx1,msy1,msx2,msy2,20);
'copper':findcolorspiraltolerance(x,y,ACCopper,msx1,msy1,msx2,msy2,20);
'tin':findcolorspiraltolerance(x,y,ACtin,msx1,msy1,msx2,msy2,20);
end;
mmouse(x,y,3,3);
if(waituptext('ine',300+random(300)))then
begin
GetMousePos(x, y);
mouse(x,y,3,3,true);
i := InvCount;
MarkTime(E);
while (InvCount = i) and (TimeFromMark(E) < Players[currentplayer].integers[1]) do Anti;
if(not(invcount = i)) then Mined:=Mined+1
end;
end;
function ACTree: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.06, 1.53);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 2056014, MSX1, MSY1, MSX2, MSY2, 11);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 2.99) and (X <= 13.21) and (Y >= 4.08) and (Y <= 16.52) and (Z >= 0.96) and (Z <= 6.51) then
begin
Result := arC[i];
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Procedure Chopping;
Var x,y :integer;
Var MTB :Tbox;
begin
if(not(loggedin))then exit;
if(invfull) then dropit;
If(FindColorSpiralTolerance(x, y, ACTree, MSX1,MSY1,MSX2,MSY2, 20)) then
mmouse(x,y,3,3);
if(waituptext('ree',50+random(75))) or (waituptext('ak',300+random(300))) then
begin
mouse(x,y,3,3,true);
Wait(2037+Random(13))
MTB.X1:= MSCX-40;
MTB.Y1:= MSCX-40;
MTB.X2:= MSCX+40;
MTB.Y2:= MSCX+40;
while (PixelShift(MTB, 947+Random(53)) < 800) do Anti;
Chopped := Chopped +1
end;
end;
Procedure ScriptTerminate;
begin
Writeln('|===Junkj"s [P]ower [M]iner [Or] [W]oodcutter');
Writeln('|Ran for ' + TimeRunning);
Case Lowercase(Players[0].strings[1]) of
'mine': Writeln('|Mined ' + IntToStr(Mined) + ' ore and gained ' + IntToStr(Mined*(StrToInt(XPG))) + ' XP');
'chop': Writeln('|Chopped ' + IntToStr(Chopped) + ' and gained ' + IntToStr(Chopped*25) + ' XP');
end;
Writeln('|Did ' + IntToStr(Loads) + ' Loads');
Writeln('|CopyRighted PMOW© by the original creater: JunkJ®');
Writeln('========THANK-JOO-FOR-USING-MY-SCRIPT========');
end;
Procedure DeclareXP;
begin
case Lowercase(Players[currentplayer].strings[0]) of
'iron': XPG := '35';
'copper': XPG := '17.5';
'tin': XPG := '17.5';
end;
end;
Procedure DeclareA;
begin
Case (Lowercase(Players[CurrentPlayer].Strings[1])) of
'chop' : Chopping;
'mine' : MineIt;
end;
end;
begin
SetUpSRL;
ActivateClient;
ClearDebug;
Disguise('PMOW© by JunkJ®')
DeclarePlayers;
GraphicsSet:= True;
DeclareXP;
If(Not(Loggedin))Then loginplayer;
Repeat
DeclareA;
DropIt;
Until(Mined >= Players[CurrentPlayer].integers[0]) or (Chopped >= Players[CurrentPlayer].integers[0])
end.