вот ссылка нс код с http://stealth.od.ua/Doc:RU/Api/S
если не ошибаюсь то примерно так function Step(Direction : Byte; Running : Boolean) : Byte
Code: Select all
Program Mining;
type MiningR = record
tile:word;
px,py,pz:integer;
end;
Var MiningP: array [0..1342] of MiningR; // это количество ваших тайлов, которое нужно изменить в зависимости от ваших тайлов
ItemCount,b:Integer;
Const
eda = $103B;
point1X = 150; // это перед шахтой
point1Y = 3066; // это перед шахтой
point2X = 150; // внутри шахты - примерно 2-3 шага от входа
point2Y = 3063; // внутри шахты - примерно 2-3 шага от входа
nearX = 144; // возле лодки
nearY = 3066; // возле лодки
onboadx = 141; // на лодке
onboady = 3066; // на лодке
onboadz = -2; // на лодке
Trap = $4188968A; // SERIAL - трапа лодки (с помощью Injection ,info )
waightlimit = 310; // максимальный лимит веса
OreType = $19B9; // в этих строках ничего менять не надо!
PickType = $0E85; // в этих строках ничего менять не надо!
PickGump = '3717'; // в этих строках ничего менять не надо!
Tinktype = $1EB9; // в этих строках ничего менять не надо!
CopperType = $19B9;// в этих строках ничего менять не надо!
{$Include 'all.inc'}
procedure checkdead;
begin
if Dead then
begin
AddToSystemJournal('Чар мертв. Время смерти: '+TimeToStr(now)+' (c)Доктор Франкинштейн');
MoveXY(452,3469, True, 0, True);
wait(500)
end;
end;
Procedure GetMiningTiles(s:String;WPos:Integer);
begin
s := s + ' ';
MiningP[WPos].tile:=StrToInt(Copy(s,1,Pos(' ',s)-1));
Delete(s,1,Pos(' ',s));
MiningP[WPos].px:=StrToInt(Copy(s,1,Pos(' ',s)-1));
Delete(s,1,Pos(' ',s));
MiningP[WPos].py:=StrToInt(Copy(s,1,Pos(' ',s)-1));
Delete(s,1,Pos(' ',s));
MiningP[WPos].pz:=StrToInt(Copy(s,1,Pos(' ',s)-1));
Delete(s,1,Pos(' ',s));
end;
Procedure GetCoord;
var
List:TStringList;
b:integer;
begin
List:=TStringList.Create;
List.LoadFromFile('C:\Zulu Hotel Europe\!ZHE_Stealth\MiningShaxta!!!.txt');
for b := 0 to List.Count-1 do
GetMiningTiles(List.strings[b],b);
ItemCount:=b;
end;
procedure checkcoord;
begin
CheckSave;
if (GetY(self) = OnBoady) then
begin
repeat
AddToSystemJournal('я в лодке')
UseObject(Trap);
wait(500);
newMoveXY(143,3066,True,0,False); // собственно координаты трапа
wait(500);
until (GetX(self) = nearX) and (GetY(self) = nearY);
AddToSystemJournal('Сошел на берег успешно!');
end;
end;
procedure CheckCooper;
begin
FindType(CopperType, Backpack);
if (FindFullQuantity < 10) then
begin
FindTypeEx(CopperType,$0000,Ground,true);
MoveItem(finditem, 25, Backpack, 0,0,0);
wait(500);
end;
end;
procedure CheckPick;
begin
CheckSave;
checkdead;
CheckCooper;
if (Count(PickType) < 2) then
begin
repeat
CheckCooper;
ClearJournal;
WaitGump(PickGump);
WaitTargetobject(findtype(CopperType, Backpack));
UseObject(FindType(TinkType, Ground));
WaitJournalLine(Now, 'You create|destroy|You put', 30000);
wait(500);
CheckCooper;
until (Count(PickType) >= 2);
end;
end;
procedure DropOre;
var g : integer;
OreCol : Array [0..17] of Word;
Begin
finddistance := 2;
CheckSave;
AddToSystemJournal('Сбрасываем руду');
oreCol[0] := $0602; // Copper Ore
oreCol[1] := $0000; // Iron Ore
oreCol[2] := $0482; // Steel Ore
oreCol[3] := $045E; // Anra Ore
oreCol[4] := $07D6; // Valurite Ore
oreCol[5] := $0852; // Old Britain Ore
oreCol[6] := $04EA; // Lavarock Ore
oreCol[7] := $04AB; // Black Dwarf Ore
oreCol[8] := $07F8; // Spectral Ore
oreCol[9] := $0948; // Shadow Ore
oreCol[10] := $095F; // Azurite Ore
oreCol[11] := $0A09; // Icerock Ore
oreCol[12] := $094C; // Doom Ore
oreCol[13] := $0A3D; // Blue Steel Ore
oreCol[14] := $04B0; // Dark Ruby Ore
oreCol[15] := $0487; // Crystallite Ore
oreCol[16] := $094F; // Onyx Ore
oreCol[17] := $0947; // Mithril Ore
for g := 0 to 17 do
begin
CheckSave;
FindTypeEx(CopperType,oreCol[g],backpack,true);
if FindCount > 0 then
begin
stack(CopperType,oreCol[g]);
wait(500);
end;
end;
hungry (1,ground);
wait(500);
Addtosystemjournal('=========================================');
FindType(CopperType,ground);
Addtosystemjournal('Всего металла на лодке - '+intToStr(findfullquantity));
FindTypeEx(CopperType,$0602,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Copper Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$0000,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Iron Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$0482,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Steel Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$045E,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Anra Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$07D6,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Valurite Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$0852,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Old Britain Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$04EA,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Lavarock Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$04AB,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Black Dwarf Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$07F8,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Spectral Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$0948,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Shadow Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$095F,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Azurite Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$0A09,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Icerock Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$094C,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Doom Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$0A3D,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Blue Steel Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$04B0,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Dark Ruby Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$0487,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Crystallite Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$094F,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Onyx Ore - '+intToStr(findfullquantity));
end;
FindTypeEx(CopperType,$0947,ground,False);
if FindCount > 0 then
begin
Addtosystemjournal('Mithril Ore - '+intToStr(findfullquantity));
end;
FindType(TinkType,ground);
Addtosystemjournal('Тулзов на лодке - '+intToStr(findfullquantity));
FindType(eda,ground);
Addtosystemjournal('Еды осталось - '+intToStr(findfullquantity));
Addtosystemjournal('=========================================');
End;
procedure GotoOnBoad;
begin
CheckSave;
checkdead;
MoveXY(point1X,point1Y, True, 0, True);
MoveXY(point2X,point2Y, True, 0, True);
MoveXY(nearX,nearY, True, 0, True);
wait(500);
repeat
UseObject(Trap);
wait(1000);
until (GetX(self) = OnBoadX) and (GetY(self) = OnBoadY);
wait(500);
Hungry(1,ground);
DropOre;
CheckPick;
checkcoord;
end;
procedure checktools;
begin
FindType(PickType, Backpack);
if (FindCount < 2) then
begin
GotoOnBoad;
end;
end;
procedure CheckEquip;
Var EquipPick : Cardinal;
begin
if (GetType(ObjAtLayer(RhandLayer)) <> PickType) then
begin
Disarm;
wait(500);
checktools;
FindType(PickType, Backpack);
EquipPick := finditem;
Equip(RhandLayer, EquipPick);
end;
end;
function Mining(tile:Word;x,y,z:Integer):boolean;
begin
CheckSave;
checkdead;
WaitTargetTile(tile,x,y,z);
UseObject(ObjAtLayer(RhandLayer));
WaitJournalLine(Now, 'no more ore|broke|stop mining|cannot see|far away|cannot mine|what is this?!', 30000);
end;
procedure checkweight;
begin
if (Weight > waightlimit) then
begin
GotoOnBoad;
end;
end;
Begin
SetArStatus(true);
checkdead;
getcoord;
ClearJournal;
AddToSystemJournal('Скрипт успешно стартовал.');
While (not Dead) do
begin
for b :=0 to 1342 do
begin
CheckSave;
CheckDead;
CheckCoord;
CheckWeight;
MoveXY(MiningP[b].px,MiningP[b].py, True, 1, True);
Addtosystemjournal('Tile number '+intToStr(b)+'!');
CheckEquip;
Mining(MiningP[b].tile,MiningP[b].px,MiningP[b].py,MiningP[b].pz);
Wait(500);
end;
end;
End.