The Claw
2007-06-16 00:42:24
Well AntiGas in my script isnt working. This is a section of my mining procedures -
As you can see, it calls the procedure MineCheck every time it mines an ore, to see if its still mining, and if it is, wait for it. In there I have my antirandoms, and anti gas. If gas is found at x, y its meant to HandleGas which is this -
but for some reason, it doesnt do that at all. its going through the waiting thing fine, but it just never finds the gas. Its obviously a problem with this line of code:
But i cant tell what it is. Im thinking its something to do with the x, y. In this case, x and y are the co-ords that SCAR has stored the location of the rock into. I think thats what you have to do? but yeh not sure.
help greatly appreciated.
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
| |
| Mining - All the mining procedures. |
| |
|=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-|
| |
| MineCheck - Checks if mining or not. |
| Thx to wizzup for TimeFromMark things. |
| |
|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
procedure MineCheck; //checks if the user is mining or not, by animation. waits until mined
begin
if GetAnimation > 0 then
begin
Writeln('We are mining the rock');
AntiRandom;
MarkTime(IdleMark);
MarkTime(IdleMark2);
MarkTime(IdleMark3);
MarkTime(IdleMark4);
repeat
Idling;
if GasCheck(x, y) then begin HandleGas; Writeln('gas'); end;
if TimeFromMark(IdleMark3) >= 10 then begin AntiRandom; end;
MarkTime(IdleMark3);
Wait(1);
until GetAnimation = -1;
Writeln('Rock has been mined');
AntiRandom;
Exit;
end;
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-|
| |
| Better rocks - while mining coal, checks to see if mith |
| or addy have respawned. |
| |
|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function BetterRocks: Boolean;
begin
MineAddy1 := FindClosestObject(AddyRock1);
MineAddy2 := FindClosestObject(AddyRock2);
MineMith1 := FindClosestObject(MithRock1);
MineMith2 := FindClosestObject(MithRock2);
MineMith3 := FindClosestObject(MithRock3);
MineTotal := MineAddy1 + MineAddy2 + MineMith1 + MineMith2 + MineMith3;
if MineTotal > 0 then
begin
Writeln('Found better rocks, sorry coal but your gonna have to wait');
Result := True;
GetMinimapPos(3144, 3146, x, y);
Mouse(x, y, 2, 2, true);
Flag;
Wait(2000 + random(1000));
end else
Result := False;
end;
{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-|
| |
| MineAddy - Mines the addy rocks |
| |
|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
procedure MineAddy;
begin
repeat
if not LoggedIn then Exit;
if InvFull then Exit;
AntiRandom;
GetMinimapPos(3146, 3146, x, y);
Mouse(x, y, 3, 3, true);
Flag;
Wait(3000 + random(1000));
MineAddy1 := FindClosestObject(AddyRock1);
if MineAddy1 > 0 then
begin
Writeln('Addy rock 1 found');
repeat
MSCoordsofUID(MineAddy1, 50, x, y);
Wait(500 + random(100));
MMouse(x, y, 2, 2);
until IsUpText('ine');
Mouse(x, y, 2, 2, true);
Flag;
Wait(2000);
MineCheck;
end;
MineAddy2 := FindClosestObject(AddyRock2);
if MineAddy2 > 0 then
begin
Writeln('Addy rock 2 found. Mining.');
repeat
MSCoordsofUID(MineAddy2, 50, x, y);
Wait(500 + random(100));
MMouse(x, y, 2, 2);
until IsUpText('ine');
Mouse(x, y, 2, 2, true);
Flag;
Wait(2000);
MineCheck;
end;
if InvFull then Exit;
until MineAddy1 or MineAddy2 <= 0;
begin
Status('Addy rocks not found');
end;
end;As you can see, it calls the procedure MineCheck every time it mines an ore, to see if its still mining, and if it is, wait for it. In there I have my antirandoms, and anti gas. If gas is found at x, y its meant to HandleGas which is this -
procedure HandleGas; //thx Sumillion
var
TempMouseSpeed, GasTime: Integer;
begin
Writeln('OMFG Gas found! Run to the hillz!');
TempMouseSpeed := MouseSpeed;
MouseSpeed := 5;
Mouse(MMCX, MMCY, 5, 5, true);
MarkTime(GasTime);
MouseSpeed := TempMouseSpeed;
while (TimeFromMark(GasTime) < 35000) do
if (Random(20) > 15) then
IdleTime(500, 500, 0.4)
else
Wait(1000);
GasAvoided := GasAvoided + 1;
//ReportVars[3] := ReportVars[3] + 1;
end;but for some reason, it doesnt do that at all. its going through the waiting thing fine, but it just never finds the gas. Its obviously a problem with this line of code:
if GasCheck(x, y) then begin HandleGas; Writeln('gas'); end;But i cant tell what it is. Im thinking its something to do with the x, y. In this case, x and y are the co-ords that SCAR has stored the location of the rock into. I think thats what you have to do? but yeh not sure.
help greatly appreciated.