Вот скрипт... роет в минок шахте.
Code: Select all
Program Mining;
Const
id_OreContainer = $4003951F;
id_JewelContainer = $40069428;
id_Forge = $40006283;
UseStealth = false;
UseSmelt = true;
t_Pickaxe = $0E85;
var k : Integer; TilesX, TilesY : Array of Word;
Procedure Reload;
var t_Ore : Array of Word;
i, moveDelay : Integer;
id_RecContainer : Cardinal;
Quit : Boolean;
Begin
moveDelay := 1100; t_Ore := [$1BEF, $19B9, $19B8, $19BA, $19B7, $0F0F, $0F10, $0F11, $0F13, $0F15, $0F16, $0F18, $0F25, $0F26];
For i := 0 to 13 do
Begin
Quit := false;
Repeat
If FindType(t_Ore[i], BackPack) > 0 then
Begin
If i < 5 then id_RecContainer := id_OreContainer else id_RecContainer := id_JewelContainer;
Repeat
Wait(100);
Until CheckLag(10000);
MoveItem(FindItem, -1, id_RecContainer, 0, 0, 0);
Wait(moveDelay);
End
else Quit := true;
Until Quit;
End;
If Count(t_Pickaxe) < 4 then
Begin
For i := 1 to 4 - Count(t_Pickaxe) do
Begin
If FindType(t_Pickaxe, id_JewelContainer) > 0 then
Begin
Repeat
Wait(100);
Until CheckLag(10000);
MoveItem(FindItem, -1, BackPack, 0, 0, 0);
Wait(moveDelay);
End
else
Begin
AddToSystemJournal('Закончились кирки');
Break;
End;
End;
End;
End;
Procedure GoToDest(dest : String);
var BtoCX, BtoCY : Array of Integer;
i, a, b : Integer;
Begin
BtoCX := [2512, 2515, 2521, 2528, 2528, 2553, 2556, 2558, 2558, 2567];
BtoCY := [553, 544, 538, 538, 501, 501, 504, 503, 496, 483];
If dest = 'bank' then
Begin
a := -9; b := -1;
End
else
Begin
a := 1; b := 9;
End;
For i := a to b do
Begin
newMoveXY(BtoCX[ABS(i)], BtoCY[ABS(i)], false, 1, true);
End;
End;
Procedure Smelt;
var t_Ore : Array of Word;
i : Integer;
rQuit : Boolean;
Begin
t_Ore := [$19B9, $19B8, $19BA, $19B7]
For i := 0 to 3 do
Begin
rQuit := false
Repeat
If FindType(t_Ore[i], BackPack) > 0 then
Begin
UseObject(FindItem);
Wait(100);
End
else
Begin
rQuit := true;
End;
Until rQuit;
End;
End;
Procedure DelJournal(msg : String);
Begin
While InJournal(msg) > 0 do SetJournalLine(InJournal(msg), ' ')
End;
Procedure MiningAround;
var i, j, mx, my, d : Integer;
Delay : Cardinal;
msg : Array of String;
Begin
msg := ['loosen some', 'put the', 'here is no', 'far away', 'mining', 'so close', 'line of sight', 't use'];
For i := -2 to 2 do
Begin
For j := -2 to 2 do
Begin
AddToSystemJournal('Копаю на ' + IntToStr(i) + ' ' + IntToStr(j));
mx := GetX(self); my := GetY(self);
Repeat
If Weight >= 700 then
Begin
If UseSmelt then
Begin
NewMoveXY(GetX(id_Forge), GetY(id_Forge), false, 1, true);
Smelt;
End;
AddToSystemJournal('Иду к банку');
GoToDest('bank');
AddToSystemJournal('Разгружаюсь');
Reload;
AddToSystemJournal('Иду в шахту');
GoToDest('cave');
End;
If TargetPresent then
CancelTarget;
If WarMode = true then
SetWarMode(false);
Repeat
Wait(100);
Until CheckLag(10000);
AddToSystemJournal('Дебаг 1');
Delay := Timer;
AddToSystemJournal('Дебаг 2');
For d := 0 to 7 do DelJournal(msg[d]);
AddToSystemJournal('Журнал очищен');
WaitTargetTile(1342, GetX(self) + i, GetY(self) + j, GetZ(self));
UseType(t_Pickaxe, 0);
Repeat
Wait(100)
Until (InJournal(msg[0]) > 0) or (InJournal(msg[1]) > 0) or (InJournal(msg[2]) > 0) or (InJournal(msg[3]) > 0) or (InJournal(msg[4]) > 0) or (InJournal(msg[5]) > 0) or (InJournal(msg[6]) > 0) or (InJournal(msg[7]) > 0) or (Delay + 15000 <= Timer);
Until (InJournal(msg[2]) > 0) or (InJournal(msg[3]) > 0) or (InJournal(msg[4]) > 0) or (InJournal(msg[5]) > 0) or (InJournal(msg[6]) > 0) or (InJournal(msg[7]) > 0);
End;
End;
End;
Begin
TilesX := [2559, 2560, 2560, 2564, 2565, 2568, 2573, 2578, 2578, 2578, 2573, 2574, 2569, 2568, 2571, 2570, 2565, 2564];
TilesY := [496, 491, 487, 484, 479, 476, 476, 476, 481, 485, 485, 481, 481, 486, 489, 489, 489, 493];
While true do
Begin
For k := 0 to 17 do
Begin
AddToSystemJournal('Пошёл к точке ' + IntToStr(k));
newMoveXY(TilesX[k], TilesY[k], false, 1, true);
AddToSystemJournal('Копаю')
MiningAround;
End;
End;
End.
Что-то не могу догнать как работает InJournalBetweenTimes