Code: Select all
program Mining;
{$Include 'all.inc'}
const
M_nothing1 = 'There is nothing here';
M_nothing2 = 'That is too far';
M_nothing3 = 'Try mining elsewhere.';
M_nothing4 = 'You cannot mine so close';
M_nothing5 = 'You have no line';
M_nothing6 = 'reach';
M_fizzles1 = 'You loosen some rocks';
M_fizzles2 = 'не смогли выкопать ничего';
M_needwait = 'You decide not to mine';
M_success = 'in your pack.';
Shovel = $0F39;
Sunduk = $41049D15;
Sumka = $40F9596B;
Ore = $19B9;
//MyMaxWeight = 200;
procedure CheckHide;
begin
if Hidden then exit;
if WarMode = true then SetWarMode(false);
repeat
UseSkill('Hiding');
wait(4500);
checksave;
until Hidden or (not Connected);
end;
procedure Kopat;
var k, r, x, y : Integer;
var mn1, mn2, mn3, mn4, mn5, mn6, mf1, mf2, mw1, ms1 : Integer;
var ctime : TDateTime;
begin
addtosystemjournal(inttostr(GetX(self)) + ' ' + inttostr(GetY(self)) + ': Ia?eiaai iaeiieo. Aan ?a?a: ' + inttostr(Weight));
for x := -2 to 2 do
begin
for y := -2 to 2 do
if Weight > 200 then
begin
break;
end;
begin
r := 0;
repeat
waitconnection(5000);
CheckHide;
if TargetPresent then CancelTarget;
if WarMode = true then SetWarMode(false);
ctime := Now;
UseType($0F39, $0000);
WaitForTarget(5000);
If TargetPresent then TargetToTile(1342, GetX(self)+x, GetY(self)+y, GetZ(self));
k := 0;
repeat
wait(100);
k := k + 1;
checksave;
mn1 := InJournalBetweenTimes(M_nothing1, ctime, Now);
mn2 := InJournalBetweenTimes(M_nothing2, ctime, Now);
mn3 := InJournalBetweenTimes(M_nothing3, ctime, Now);
mn4 := InJournalBetweenTimes(M_nothing4, ctime, Now);
mn5 := InJournalBetweenTimes(M_nothing5, ctime, Now);
mn6 := InJournalBetweenTimes(M_nothing6, ctime, Now);
mf1 := InJournalBetweenTimes(M_fizzles1, ctime, Now);
mf2 := InJournalBetweenTimes(M_fizzles2, ctime, Now);
ms1 := InJournalBetweenTimes(M_success, ctime, Now);
until (mn1<>-1) or (mn2<>-1) or (mn3<>-1) or (mn4<>-1) or (mn5<>-1) or (mn6<>-1) or (mf1<>-1) or (mf2<>-1) or (ms1<>-1) or (HP < MaxHP) or Dead or (k > 300);
if (mw1<>-1) then wait(3000);
until (mn1<>-1) or (mn2<>-1) or (mn3<>-1) or (mn4<>-1) or (mn5<>-1) or (mn6<>-1);
end;
end;
end;
procedure GotoXY(x,y,prec : integer; runflag : boolean);
// x,y - координаты, в которые идем
// prec - точность подхода
// runflag - бежать или идти
// v. 1.04 (с) Edred, скрипт портирован с инжекта
// оригинальная версия Yoko с доработкой AGRS и Edred.
var ld, ldc, dx, dy, mx, my : Integer;
begin
ld := 0; ldc := 0;
while true do
begin
dx := GetX(self) - x; if dx < 0 then dx := 0 - dx;
dy := GetY(self) - y; if dy < 0 then dy := 0 - dy;
if dy > dx then dx := dy;
if dx <= prec then exit;
mx := GetX(self); my := GetY(self);
dx := mx - x; if dx < 0 then dx := 0 - dx;
dy := my - y; if dy < 0 then dy := 0 - dy;
if dy > dx then dx := dy;
if dx <= prec then exit;
if ld = dx then begin
ldc := ldc + 1;
if ldc > 100 then begin addtosystemjournal( 'GotoXY: Cannot reach location!' ); exit; end;
end
else ld := dx;
waitconnection(5000);
if mx = x then begin
if my = y then exit;
// North
if my > y then begin Raw_Move(0,runflag); continue; end;
// South
Raw_Move(4,runflag); continue;
end;
if mx < x then begin
// Northeast
if my > y then begin Raw_Move(1,runflag); continue; end;
// East
if my = y then begin Raw_Move(2,runflag); continue; end;
// Southeast
Raw_Move(3,runflag); continue;
end;
// Southwest
if my < y then begin Raw_Move(5,runflag); continue; end;
// West
if my = y then begin Raw_Move(6,runflag); continue; end;
// Nortwest
Raw_Move(7,runflag); continue;
end;
end;
procedure Vugryzka;
begin
waitconnection(3000);
UseObject(Sunduk);
wait(1000);
checksave;
UseObject(Sumka);
wait(1000);
checksave;
repeat
if FindType(Ore,backpack) >= 1 then FindType(Ore,backpack);
if FindItem <> 0 then
begin
MoveItem(FindItem,1000,Sumka,0,0,0);
wait(1000);
checksave;
end;
until finditem = 0;
end;
begin
repeat
GotoXY(4574,3157,0,false);
GotoXY(4566,3165,0,false);
GotoXY(4557,3172,0,false);
GotoXY(4551,3172,0,false);
Kopat;
GotoXY(4548,3172,0,false);
Kopat;
GotoXY(4546,3170,0,false);
Kopat;
GotoXY(4549,3167,0,false);
Kopat;
GotoXY(4551,3169,0,false);
GotoXY(4551,3169,0,false);
GotoXY(4555,3172,0,false);
GotoXY(4566,3165,0,false);
GotoXY(4566,3165,0,false);
GotoXY(4574,3157,0,false);
wait(1500)
Vugryzka;
until false;
end.