uncfan1119
2009-11-02 17:37:45
I'll be improving this every chance I get.
Things to improve:
+Antiban
+Antirandoms
note to self: make new script just do
if (findblackchatmessage('ana'))) then wrriteln('1')
repeat until false taht ^
and run it
to check if the damn func is even working
you can just maek a DTM of the text also :D
Functiion DidIMine:Bollean
begin
result:=FindDTM(mined ore dtm)
end;
repeat
antiban
antirandoms
wait(500)
until DidIMine
Things to improve:
+Antiban
+Antirandoms
program New; //by uncfan1119
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Mining.scar}
var
clicks: integer;
function CopperColor: 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, 2439763, MSX1, MSY1, MSX2, MSY2, 108);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the copper color.');
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 <= 7.89) and (S >= 0.00) and (S <= 38.55) and (L >= 0.00) and (L <= 46.88) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 0.00) and (X <= 23.02) and (Y >= 0.00) and (Y <= 21.01) and (Z >= 0.00) and (Z <= 9.34) then
begin
Result := arC[i];
Writeln('CopperColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the copper color.');
end;
function TinColor: 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, 8750475, MSX1, MSY1, MSX2, MSY2, 25);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the tin color.');
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.04) and (S <= 3.34) and (L >= 47.63) and (L <= 58.65) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 18.22) and (X <= 28.78) and (Y >= 18.79) and (Y <= 29.74) and (Z >= 20.10) and (Z <= 31.43) then
begin
Result := arC[i];
Writeln('TinColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the tin color.');
end;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
{ Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := False;
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := False;
Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Active := False;
Players[4].Name := '';
Players[4].Pass := '';
Players[4].Nick := '';
Players[4].Active := False; }
end;
procedure DropOres;
var
i: Integer;
begin
for i := 2 to 28 do
begin
if existsitem(i) then
dropitem(i);
end;
wait(1000+random(500));
end;
procedure PowerMine;
var
x, y: Integer;
clicks: integer;
begin
if FindColorSpiralTolerance(X, Y, TinColor, MSX1, MSY1, MSX2, MSY2, 25) or FindColorSpiralTolerance(X, Y, CopperColor, MSX1, MSY1, MSX2, MSY2, 108) then
begin
mmouse( x, y, 6, 6 );
wait(100+random(300));
if IsUpText('ine') then
begin
getmousepos(x, y);
wait(100+random(300))
mouse(x, y, 2, 2, true);
clicks := clicks + 1;
repeat
wait(50+random(200));
until(findblackchatmessage('ana'));
end;
end;
end;
procedure MainLoop;
begin
repeat
repeat
PowerMine;
until(clicks = 28);
DropOres;
until(false);
end;
begin
SetupSRL;
DeclarePlayers;
ActivateClient;
LoginPlayer;
Wait(1000);
MainLoop;
end.note to self: make new script just do
if (findblackchatmessage('ana'))) then wrriteln('1')
repeat until false taht ^
and run it
to check if the damn func is even working
you can just maek a DTM of the text also :D
Functiion DidIMine:Bollean
begin
result:=FindDTM(mined ore dtm)
end;
repeat
antiban
antirandoms
wait(500)
until DidIMine