Kaladin
2014-01-30 03:09:24
Hi guys, long night so not really sure what is causing this, all I know is that its not looping through the TPA's at a decent speed/at all.
Its something to do with my TryMine I think, any help would be much appreciated.
Thanks
Also could be due to my bounds being incorrect, I want it so that it only searches the mainscreen (No inv etc), when I tried with just mainscreen.getbounds it was finding ore when there was none (I guessed inventory) so if I'm being dumb about anything I do apologize.
EDIT: Okay I've tested various things and it must be my colors. Will try fix and report back.
EDIT2: Not colours :S Tried alot of different fixes and I can't come up with the answer, the log reads as follows;
Any ideas? ;/
EDIT3: … Combination of various fails on my part, when doing recolouring I clicked a black square and didn't realize, as well as some other things I think xD Ah well, thanks for everyone who tried to help, all nighters make my brain not work well but its hard to sleep when having this much fun xD :D
Its something to do with my TryMine I think, any help would be much appreciated.
Thanks
program ResourceMiner;
{$DEFINE SMART}
{$I SRL-6/SRL.Simba}
{$i sps/lib/sps-rs3.simba}
// SETUP //-----------------------------------------------------------------------------------\\
//--------------------------------------------------------------------------------------------\\
//--------------------------------------------------------------------------------------------\\
const
nick:= 'agoWin';
file:= 'default';
//--------------------------------------------------------------------------------------------\\
//--------------------------------------------------------------------------------------------\\
//--------------------------------------------------------------------------------------------\\
//--------------------------------------------------------------------------------------------\\
//--------------------------------------------------------------------------------------------\\
Var
ores, b: integer;
banking, flagHard: boolean;
bounds: Tbox;
procedure init;
begin
smartEnableDrawing := true;
setupSRL;
banking:= false;
Players.Setup([nick], file);
CurrentPlayer := 0;
ores:=0;
bounds.setBounds(0,0,305,275);
end;
Function Antiban: Boolean;
Var
I: Integer;
Begin
Writeln('performing antiban');
I := Random(600);
Case I Of
1: boredHuman(false);
2..7:
Begin
hoverSkill(Skill_Mining);
Wait(GaussRangeInt(1000,2000));
End;
8..50: mouseMovingObject;
51..100: SleepAndMoveMouse(1000);
101..400:
Begin
MouseOffClient(Random(4));
Wait(1000+Random(100));
End;
501..600: Wait(RandomRange(1000, 2000));
End;
End;
function findOre: boolean;
var
x, y, i, r: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn then
exit;
if tabBackpack.count < 28 then
begin
if banking = false then // color // tol //CTS, hue, sat from ACA
if findColorsSpiralTolerance(x, y, TPA, 9461341, bounds, 30, colorSetting(2, 0.02, 0.20)) then
if (Length(TPA) < 1) then // if no matching TPoints are found, exit
exit;
ATPA := TPA.toATPA(50, 100); // split our TPA into boxes of 30 x 30 pixels and put into an ATPA
ATPA.sortFromMidPoint(mainscreen.playerPoint); // sort the array from player, so closest TPA to player is first in array
for i := 0 to high(ATPA) do
begin // move move to each TPA one at a time, until we get a match
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['Min', 'ithr', 'ore'], 200) then
begin
r:= random(100);
GetMousePos(x, y);
Mouse(point(x, y).rand(1), MOUSE_LEFT, MOUSE_HUMAN);
wait(200 + random(300));
if tabBackpack.waitForShift(30000) then
begin
inc(ores);
writeln(ores);
end;
end;
end;
end;
end;
function findBank: boolean;
var
x, y, i: integer;
TPA: TPointArray;
TP: TPoint;
ATPA: T2DPointArray;
begin
if findColorsSpiralTolerance(x, y, TPA, 1911999, mainScreen.getBounds(), 10, colorSetting(2, 0.04, 1.68)) then
if (Length(TPA) < 1) then // if no matching TPoints are found, exit
exit;
ATPA := TPA.toATPA(50, 100); // split our TPA into boxes of 30 x 30 pixels and put into an ATPA
ATPA.sortFromMidPoint(mainscreen.playerPoint); // sort the array from player, so closest TPA to player is first in array
for i := 0 to high(ATPA) do
begin // move move to each TPA one at a time, until we get a match
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
GetMousePos(x, y);
if isMouseOverText(['Exit Mysterious door'], 200) then
begin
b := Random(1000);
x:= x+80;
y:= y+40;
mouse(x,y, MOUSE_MOVE);
wait(100 + random(400));
fastClick(MOUSE_LEFT);
wait(200 + random(600));
exit(true);
end;
end;
end;
function tryBank(): boolean;
begin
if findBank then
begin
banking:= true;
wait(500+random(700));
mouse(340+random(5), 305+random(5), MOUSE_MOVE);
fastClick(MOUSE_LEFT);
wait(500+random(700));
mouse(464, 64, MOUSE_LEFT, MOUSE_MOVE);
fastClick(MOUSE_LEFT);
wait(300+random(400));
banking:= false;
end else
banking:= false;
exit(false);
end;
function tryMine(): boolean;
var
t := getSystemTime() + 60000; // maximum one minute (can change to whatever you want) used as a failsafe in case something goes wrong
begin
while ((not result) and (getSystemTime() < t)) do
findOre;
result := (tabBackpack.count() = 28);
wait(500+random(400));
end;
Procedure mainLoop;
begin
if not isLoggedIn then
exit;
if tabBackpack.count = 28 then
begin
if not banking then
minimap.tpaWalk(3161795, 30, point(minimap.x2, minimap.y1), 10);
tryBank;
end else
tryMine();
end;
begin
init;
players[currentPlayer].login();
wait(1000+random(3000));
minimap.setAngle(MM_DIRECTION_EAST);
mainScreen.setAngle(MS_ANGLE_HIGH);
repeat
mainLoop;
until b > 10000 ;
end.
Also could be due to my bounds being incorrect, I want it so that it only searches the mainscreen (No inv etc), when I tried with just mainscreen.getbounds it was finding ore when there was none (I guessed inventory) so if I'm being dumb about anything I do apologize.
EDIT: Okay I've tested various things and it must be my colors. Will try fix and report back.
EDIT2: Not colours :S Tried alot of different fixes and I can't come up with the answer, the log reads as follows;
-- TPlayer.login()
---- Already logged in
---- Logged in: agoWin
-- TPlayer.login(): True
---- TRSGameTab.__initTabs(): Setup gametab properties
Any ideas? ;/
EDIT3: … Combination of various fails on my part, when doing recolouring I clicked a black square and didn't realize, as well as some other things I think xD Ah well, thanks for everyone who tried to help, all nighters make my brain not work well but its hard to sleep when having this much fun xD :D