I am just fiddling around trying to make a guild coal miner/banker, but as of yet haven't written any procedures for walking because I am struggling to work out which method will be the best for what I am doing.
Never the less, this is my current coal mining procedure which works reasonably well at the moment. A few questions -
- Once the script finds the initial color (the slightly lighter rock color) I then want it to draw the ATPA boxes and check to see if the dark "coal present" color is within that box, before moving the mouse and clicking. At present it simply searches for the light color and then checks the uptext, if thats wrong it will rotate the camera angle and move on until it finds one with the appropriate uptext. but this looks rather 'bot-like' and would prefer it just recognised the coal before it moved and clicked with the uptext being more of a failsafe than a necessary procedure.
- It's currently using FindColorsSpiralTolerance and I have it set to spiral from the centre of the main screen. However, it seems to like clicking rocks on the outer edges of the main screen even when there are coal-filled rocks right near my character.. Any ideas as to why that's happening?
Simba Code:procedure MineCoal;
var
i,C,T,CTS: integer;
MyTPA: TPointArray;
TPAA: T2DPointArray;
M: TPoint;
begin
if not LoggedIn then
TerminateScript else
if not FindNormalRandoms then
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
if not FindColorsSpiralTolerance(MSCX,MSCY,MyTPA,4688547,MSX1,MSY1,MSX2,MSY2,3) then
FindColorsSpiralTolerance(MSCX,MSCY,MyTPA,789773,MSX1,MSY1,MSX2,MSY2,3) else
if FindColorsSpiralTolerance(MSCX,MSCY,MyTPA,4688547,MSX1,MSY1,MSX2,MSY2,3) then
begin
ColorToleranceSpeed(CTS);
TPAA := TPAToATPAEx(MyTPA, 26, 24);
SortATPASize(TPAA, True);
for i:= 0 to High(MyTPA) do
M:= MyTPA[i];
WriteLn(IntToStr(High(MyTPA)));
MMouse(M.x-1,M.y-1,3,3);
end else
begin
repeat
CompassMovement(10,180,False);
WriteLn('Couldnt Find Coal, Exiting');
Exit;
until (FindColorsSpiralTolerance(MSCX,MSCY,MyTPA,789773,MSX1,MSY1,MSX2,MSY2,3)) or (FindColorsSpiralTolerance(MSCX,MSCY,MyTPA,4688547,MSX1,MSY1,MSX2,MSY2,3))
end;
if WaitUpTextMulti(['oal'],600) then
begin
C:= InvCount;
ClickMouse2(True);
FFlag(0);
MarkTime(T);
While IsMining do
Wait(RandomRange(500,1000));
if FindBlackChatMessage('o ore') or FindBlackChatMessage('anage') or (InvCount <> C) or (T > 10000) then
Exit;
end else
WriteLn('Couldnt Find UpText, Try Again');
CompassMovement(10,180,False);
Exit;
end;
Also, if there are any recommendations for failsafes I should add in, different, easier or more human-like ways to do any of this procedure please let me know. Any feedback and criticism is welcome and appreciated.





Reply With Quote



