Проблема с дропом руды в NDW

тут можно задать вопрос по скриптингу
Post Reply
Riff
Posts: 2
Joined: 11.12.2021 0:11

Проблема с дропом руды в NDW

Post by Riff »

Суть в проблемы в том, шо чар принеся руду на лодку не стакает а пытается закинуть саму руду на соседнюю лодку. Изменение дистанции поиска при сбросе результатов не дало.
Есть у кого какие нить соображения?
Riff
Posts: 2
Joined: 11.12.2021 0:11

Re: Проблема с дропом руды в NDW

Post by Riff »

Program Mining;
type MiningR = record
tile:word;
px,py,pz:integer;
end;
Var MiningP: array [0..42] of MiningR;
ItemCount,b:Integer;


Const
eda = $097B;
nearX =0000;
nearY =0000;
onboadx = 0000;
onboady = 0000;
onboadz = -2;
Trap = $6C2DF86C;
NeedWeight = 250;
OreType = $19B9;
PickType = $0E85;
PickGump = '3717';
TinkGump = '7865';
Tinktype = $1EB9;
CopperType = $1BF2;

{$Include 'all.inc'}


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:\Users\Гость\Downloads\Stealth_v8.9.11\Scripts\Scripts\1 Craft\mining\Tile.txt');
for b := 0 to List.Count-1 do
GetMiningTiles(List.strings,b);
ItemCount:=b;
end;



procedure redcheck;
begin
finddistance:=16;
findvertical:=255;
if (WarTargetID>0) or (GetNotoriety(findtype($ffff, ground)) = 4) or (GetNotoriety(findtype($ffff, ground)) = 6) or (GetNotoriety(findtype($ffff, ground)) = 3) then
begin
UOSay ('.guards');
AddToSystemJournal('Валю гандона!');
wait (10000);
end;
wait(50);
While not connected or dead do wait(1000);
end;


procedure checkcoord;
begin
redcheck;
CheckSave;
checkdead;
begin
if (GetZ(self) = OnBoadZ) and (GetX(self) = OnBoadX) and (GetY(self) = OnBoadY) then begin
AddToSystemJournal('подходим к трапу');
MoveXY(OnBoadX,OnBoadY,true,2,true)
wait(2000);
{if (GetX(self) = OnBoadX) and (GetY(self) = OnBoadY) then begin
AddToSystemJournal('сходим на берег')}
repeat
UseObject(Trap);
wait(1000);
Raw_Move(0,true);
wait(2000);
Raw_Move(0,true);
wait(2000);
until (GetX(self) = nearX) and (GetY(self) = nearY);
AddToSystemJournal('Сход на берег завершен успешно');
end
end
end;

procedure CheckPick;
Begin
redcheck;
AddToSystemJournal('проверка кирки');
WaitConnection(10000);
CheckSave;
if (Count(PickType) < 2) then
begin
FindType(Tinktype,ground);
if FindCount < 2 then
begin
UseObject(FindType(TinkType,ground));
WaitTargetobject(findtype(CopperType,ground));
WaitGump(TinkGump)
wait(11000);
WaitJournalLine(Now, 'You create|destroy|You put', 30000);
Drophere(FindType(TinkType,backpack));
end
else
begin
repeat
WaitConnection(10000);
CheckSave;
FindType(CopperType,ground);
if FindCount > 0 then
begin
FindDistance := 0;
UseObject(FindType(TinkType,ground));
WaitTargetobject(findtype(CopperType,ground));
WaitGump(PickGump);
wait(10000);
WaitJournalLine(Now, 'You create|destroy|You put', 30000);
end;
until Count(PickType) >= 2
end;
end;
FindType(TinkType,ground);
Addtosystemjournal('в наличии тинкеров '+intToStr(findfullquantity)+'!');
FindType(CopperType,ground);
Addtosystemjournal('В наличии купера '+intToStr(findfullquantity)+'!');
end;

procedure DropOre;
var g : integer;
OreCol : Array [0..16] of Word;
Begin
finddistance := 1;
CheckSave;
AddToSystemJournal('Скидываем руду в лодку');
oreCol[0] := $07DF; // Cooper
oreCol[1] := $0000; // Iron
oreCol[2] := $0482; // Steel
oreCol[3] := $05D7; // Gem
oreCol[4] := $045E; // Anra
oreCol[5] := $07D6; // Valurit
oreCol[6] := $006f; // LavaRock
oreCol[7] := $09f9; // IceRock
oreCol[8] := $0940; // Shadow
oreCol[9] := $094A; // Azurite
oreCol[10] := $0943; // Doom
oreCol[11] := $094E; // BlueSteel
oreCol[12] := $0214; // DarkRuby
oreCol[13] := $0487; // Crystalit
oreCol[14] := $0946; // Onix
oreCol[15] := $093F; // Mefril
oreCol[16] := $0119; //
for g := 0 to 16 do
begin
redcheck;
CheckSave;
FindTypeEx(oreType,oreCol[g],backpack,true);
if FindCount > 0 then
begin
stack(oreType,oreCol[g]);
wait(500);
end;
end;
findtype (eda,ground);
Addtosystemjournal('В наличчии фишстеков '+intToStr(findfullquantity)+'!');
Addtosystemjournal('==========================');
FindTypeEx(OreType,oreCol[3],ground,true);
Addtosystemjournal('Gem: '+intToStr(findfullquantity)+'!');
FindTypeEx(OreType,oreCol[1],ground,true);
Addtosystemjournal('Iron: '+intToStr(findfullquantity)+'!');
FindTypeEx(OreType,oreCol[2],ground,true);
Addtosystemjournal('Steel: '+intToStr(findfullquantity)+'!');
FindTypeEx(OreType,oreCol[4],ground,true);
Addtosystemjournal('Anra: '+intToStr(findfullquantity)+'!');
FindTypeEx(OreType,oreCol[5],ground,true);
Addtosystemjournal('Valurit: '+intToStr(findfullquantity)+'!');
FindTypeEx(OreType,oreCol[6],ground,true);
Addtosystemjournal('Lavarock: '+intToStr(findfullquantity)+'!');
FindTypeEx(OreType,oreCol[7],ground,true);
Addtosystemjournal('Acerock: '+intToStr(findfullquantity)+'!');
FindTypeEx(OreType,oreCol[8],ground,true);
Addtosystemjournal('Shadow '+intToStr(findfullquantity)+'!');
FindTypeEx(OreType,oreCol[9],ground,true);
Addtosystemjournal('Azurite: '+intToStr(findfullquantity)+'!');
FindTypeEx(OreType,oreCol[10],ground,true);
Addtosystemjournal('Doom: '+intToStr(findfullquantity)+'!');
FindTypeEx(OreType,oreCol[11],ground,true);
Addtosystemjournal('BlueSteel '+intToStr(findfullquantity)+'!');
FindTypeEx(OreType,oreCol[12],ground,true);
Addtosystemjournal('DarkRuby: '+intToStr(findfullquantity)+'!');
FindTypeEx(OreType,oreCol[13],ground,true);
Addtosystemjournal('Crystallit: '+intToStr(findfullquantity)+'!');
FindTypeEx(OreType,oreCol[14],ground,true);
Addtosystemjournal('Onix: '+intToStr(findfullquantity)+'!');
FindTypeEx(OreType,oreCol[15],ground,true);
Addtosystemjournal('Mifril: '+intToStr(findfullquantity)+'!');
Addtosystemjournal('==========================');
hungry (1,ground);
end;

procedure GotoOnBoad;
{зайдем на лодочку}
Begin
redcheck;
CheckSave;
repeat
MoveXY( nearX, nearY,true,0,true);
wait(1000);
until(GetX(self) = nearX) and (GetY(self) = nearY);
AddToSystemJournal('Мы возле лодки');
wait(1000);
repeat
UseObject(Trap);
wait(1500);
until (GetX(self) = OnBoadX) and (GetY(self) = OnBoadY);
DropOre;
CheckPick;
checkcoord;
end;

procedure checkweight;
{проверим вес}
begin
if (Weight > NeedWeight) then
begin
AddToSystemJournal('Перевес,не дело..');
GotoOnBoad;
end;
redcheck;
checkcoord;
end;

procedure CheckEquip;
Var EquipPick : Cardinal;
Begin
AddToSystemJournal('Одеваеем кирку');
if GetType(ObjAtLayer(RhandLayer)) <> PickType then
begin
redcheck;
Disarm;
wait(3500);
FindType(PickType, backpack);
if findCount < 2 then
begin
GotoOnBoad;
end;
begin
EquipPick := finditem;
Equip(RhandLayer, EquipPick);
end;
end;
end;



procedure GrabOre;
var v : byte;
OreCol : Array [0..16] of Word;
Begin
finddistance := 2;
redcheck;
CheckSave;
AddToSystemJournal('Собираем руду');
oreCol[0] := $0000; // Cooper
oreCol[1] := $0000; // Iron
oreCol[2] := $0482; // Steel
oreCol[3] := $05D7; // Gem
oreCol[4] := $045E; // Anra
oreCol[5] := $07D6; // Valurit
oreCol[6] := $006f; // LavaRock
oreCol[7] := $09f9; // IceRock
oreCol[8] := $0940; // Shadow
oreCol[9] := $094A; // Azurite
oreCol[10] := $0943; // Doom
oreCol[11] := $094E; // BlueSteel
oreCol[12] := $0214; // DarkRuby
oreCol[13] := $0487; // Crystalit
oreCol[14] := $0946; // Onix
oreCol[15] := $093F; // Mefril
oreCol[16] := $0119; //
for v := 0 to 16 do
begin
finddistance := 2;
FindTypeEx(oreType,oreCol[v],ground,false);
if FindCount > 0 then
begin
Grab(finditem,GetQuantity(finditem));
wait(500);
end;
end;
end;



Function Mining(tile:Word;x,y,z:Integer):boolean;
begin
redcheck;
CheckEquip;
wait(500);
{if TargetPresent then CancelTarget;
CheckTargetError(2,2); }
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?!', 60000);
wait(500)
GrabOre;
checkweight;
end;



BEGIN
Addtosystemjournal('===========Джа любит тебя=)=============');
FindVertical := 10;
SetArStatus(true);
getcoord;
checkweight;
redcheck;
While (not Dead) do
begin
for b :=0 to 42 do
begin
WaitConnection(1000);
redcheck;
checkweight;
CheckSave;
CheckCoord;
begin
Addtosystemjournal('Идем на координату'+intToStr(MiningP.px)+', '+intToStr(MiningP.py)+'!');
MoveXY(MiningP.px,MiningP.py,true,1,true);
Addtosystemjournal('Tile number '+intToStr(b)+'!');
Mining(MiningP.tile,MiningP.px,MiningP.py,MiningP.pz);;
end;
end;
end;
end.
Post Reply