thanks i dont get those errors anymore :D
for some reason my drop procedures not working anymore though?
and the progress reports not printing to the command line :c
program powerminer;
//{$DEFINE SMART}
{$i srl/srl.simba}
var
getrunningtime, xpgain, timegone: integer;
var
CoalInInv, XpPerHour, currentxp: integer;
const
SRLStats_Username = ''; // your SRL stats username
SRLStats_password = ''; // your srl stats password
version = '1.0';
custommousespeed = 15;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username?
Players[0].Pass := ''; // Password?
Players[0].Nick := ''; // 3 letters of your username (not the first letter)
Players[0].Active := True;
end;
procedure antiban;
begin
case random(1500) of
0..25:
begin
HoverSkill('Mining',false);
MouseBox(645,169,670,203,1);
end;
26..51:
begin
sleep(1500+random(1500));
end;
60..75:
begin
GameTab(tab_Friends);
sleep(80+random(225));
MouseBox(644,168,669,202,1);
end;
80..95:
begin
Mouse(260,160,5,6,false);
sleep(200+random(100));
MMouse(190,276,10,30);
sleep(250+random(100));
MMouse(495,45,50,50);
end;
120..125:
begin
ToggleMoneyPouch(true);
sleep(200+random(250));
Mouse(532,98,10,10,false);
WaitOptionMulti(['Examine money','money pouch'],200);
sleep(500+random(200));
ToggleMoneyPouch(false);
end;
800..825:
begin
SleepAndMoveMouse(2000+random(2000));
end;
end;
end;
procedure progressreport;
begin
ClearDebug;
TimeGone := (getrunningtime/1000);
if(TimeGone = 0) then
exit;
CoalinInv := InvCount
CurrentXp := GetXPBar(1);
XpGain := (Currentxp-GetXPBarTotal);
XpPerHour :=(3600*(xpgain))/((timegone));
begin
writeln('*Simple Powerminer version one*');
writeln('*We have mined:' +IntToStr(CoalinInv) + 'coal*');
writeln('*We have gained:' + IntToStr(XpGain) + 'xp / Thats' + IntToStr(XpPerHour)+ 'xp per hour*');
writeln('*Total running time:' + IntToStr(getrunningtime/60000) + 'minutes*');
end;
end;
function autocoalcolor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00, 0.31);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 1776668, MMX1, MMY1, MMX2, MMY2, 4);
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 >= 0.59) and (X <= 1.76) and (Y >= 0.63) and (Y <= 1.86) and (Z >= 0.64) and (Z <= 1.95) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(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 Failsafe(Reason:String);
begin
Players[CurrentPlayer].Loc:=reason;
Logout;
Stats_commit;
TerminateScript;
end;
function minecoalrocks:Boolean;
var
x, y, PlusOne, counter, TooLong: Integer;
begin
Marktime(TooLong);
PlusOne := InvCount+1;
x:= MSCX
y:= MSCY
if FindObjTPA(x, y, autocoalcolor, 15, 2, 10, 10, 20, ['Mine Coal']) then
begin
writeln('coal rock found');
GetMousePos(x,y);
case random (2) of
0: mouse(x, y, 5, 5, True);
1: begin
Mouse(x, y, 5, 5, False);
WaitOption('Mine', 500);
end;
end;
flag;
marktime(counter);
repeat
FindNormalRandoms;
antiban;
wait(1000);
if invcount=plusone then
writeln('you add an ore of coal to your inventory');
until (invcount=PlusOne) or (TimeFromMark(counter) > 10000);
end;
end;
procedure DropCoal;
var
x, y, coal, I:integer;
Box:TBox;
coalpattern:TIntegerArray;
begin
coal := DTMFromString('m1gAAAHic42JgYFjAxMCwCIjXAfFKJgh/BhBPgtJzgXg2EH8H4ldA/AGI/wExAzOE/gbEb6ByLEAxDQ15oCQTEZg4wEgkRgAAo18OkA==');
coalpattern := [1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,24,28];
for I := 0 to 27 do
begin
Box := InvBox(coalpattern[I]);
If findDTM(coal, x, y, Box.x1, Box.y1, Box.x2, Box.y2) then
begin
MouseItem(coalpattern[I], mouse_right);
ChooseOption('Dro');
end;
end;
end;
begin
SetupSRL;
DeclarePlayers;
FindNormalRandoms;
progressreport;
MouseSpeed := CustomMouseSpeed;
repeat
minecoalrocks;
DropCoal;
progressreport;
until(false);
end.
and what I mean by the coal thing is I used ACA to find the color of the coal rock… and literally only the coal rock is highlighted in the program… so it should click on the coal rock, which it does… however once it mines its way to the edge of the screen it gets stuck on the edge of the screen and keeps hovering over it (which is ACA 0) the black void around the screen that you get whenever your underground. even though it doesn't highlight it in ACA :S
edit: thats the whole program right there… if you run it youll see what i mean