Code: Select all
Program Mining;
type MiningR = record
tile:word;
px,py,pz:integer;
end;
Var MiningP: array [0..68] of MiningR;
a,d,e : byte;
ItemCount,b:Integer;
Const
eda = $097B;
nearX = 2594;
nearY = 544;
EnterX=2557;
EnterY=501;
ExitX=2558;
ExitY=499;
onboadx = 2594;
onboady = 547;
onboadz = -2;
Trap = $5CBAFB3E;
maxweight = 230;
OreType = $19B9;
PickType = $0E85;
PickGump = '3717';
TinkGump = '7865';
Tinktype = $1EB9;
CopperType = $1BF2;
TockaX = 2594;
TockaY = 530;
TochaX = 2584;
TochaY = 528;
TchkaX = 2577;
TchkaY = 525;
TohkaX = 2570;
TohkaY = 515;
{$Include 'all.inc'}
procedure Check_Stability;
begin
WaitConnection(3000);
CheckDead;
CheckSave;
wait(500);
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:\Documents and Settings\o_O\Рабочий стол\stealth_v1.0 (rc 3)\Scripts\Tiles.txt');
for b := 0 to List.Count-1 do
GetMiningTiles(List.strings[b],;
ItemCount:=b;
end;
procedure hodilka(x,y,prec : integer; runflag : boolean);
// x,y - eii?aeiaou, a eioi?ua eaai
// prec - oi?iinou iiaoiaa
// runflag - aa?aou eee eaoe
// v. 1.04 (n) Edred, ne?eio ii?oe?iaai n ei?aeoa
// i?eaeiaeuiay aa?ney Yoko n ai?aaioeie AGRS e Edred.
var ld, ldc, dx, dy, mx, my : Integer;
begin
ld := 0; ldc := 0; d := 0; e := 2;
AddToSystemJournal('e ooo Inoaia iiianeiii');
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 > 4 then begin
addtosystemjournal( 'GotoXY: Cannot reach location!' );
if (GetX(self) = OnBoadX) and (GetY(self) = OnBoadY) then begin
AddToSystemJournal('Похоже застряли, повторим проверку');
UseObject(Trap);
wait(1500);
end;
a := 0
repeat
Raw_Move(d,runflag);
a := a+1
until a = e
d := d + 2;
If d = 8 then d:=0 e:= e+1 ldc :=0
end;
end
else ld := dx;
waitconnection(3000);
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 checkcoord;
begin
CheckSave;
checkdead;
begin
if (GetZ(self) = OnBoadZ) then begin
AddToSystemJournal('Мы в лодке')
hodilka(OnBoadX,OnBoadY,0, true);
wait(500);
{if (GetX(self) = OnBoadX) and (GetY(self) = OnBoadY) then begin
AddToSystemJournal('Мы в шлюпке')}
//repeat
UseObject(Trap);
wait(1500);
hodilka(nearX,nearY,0, true);
//until (GetX(self) = nearX) and (GetY(self) = nearY);
AddToSystemJournal('Вышли с лодки');
wait(500);
hodilka(TockaX,TockaY,0, true);
AddToSystemJournal('Мы типа на 1-й точке');
wait(500);
hodilka(TochaX,TochaY,0, true);
AddToSystemJournal('Мы типа на 2-й точке');
wait(500);
hodilka(TchkaX,TchkaY,0, true);
AddToSystemJournal('Мы типа на 3-й точке');
wait(500);
hodilka(TohkaX,TohkaY,0, true);
AddToSystemJournal('Мы типа на 4-й точке');
wait(500);
hodilka(EnterX,EnterY,0, true);
AddToSystemJournal('Мы на входе в шахту');
wait(500);
hodilka(ExitX,ExitY,0, true);
AddToSystemJournal('Вошли в шахту');
end
end
end;
procedure CheckPick;
Begin
AddToSystemJournal('I?iaa?yai eino?oiaio');
WaitConnection(3000);
CheckSave;
if (Count(PickType) < 2) then
begin
begin
FindType(Tinktype,ground);
if FindCount < 2 then
begin
UseObject(FindType(TinkType,ground));
WaitTargetobject(findtype(CopperType,ground));
WaitGump(TinkGump)
wait(500);
WaitJournalLine(Now, 'You create|destroy|You put', 30000);
Drophere(FindType(TinkType,backpack));
end
else
begin
repeat
WaitConnection(3000);
CheckSave;
checkdead;
FindType(CopperType,ground);
if FindCount > 0 then
begin
UseObject(FindType(TinkType,ground));
WaitTargetobject(findtype(CopperType,ground));
WaitGump(PickGump);
wait(500);
WaitJournalLine(Now, 'You create|destroy|You put', 30000);
end
else
begin
AddToSystemJournal('Нема купера,атас!!!');
Disconnect;
end
until Count(PickType) >= 2
end
end
FindType(TinkType,ground);
Addtosystemjournal('Ooecia ia caiea '+intToStr(findfullquantity)+'!');
FindType(CopperType,ground);
Addtosystemjournal('Iaoaeea ia caiea '+intToStr(findfullquantity)+'!');
end
End;
procedure DropOre;
var g : integer;
OreCol : Array [0..14] of Word;
Begin
finddistance := 1;
CheckSave;
AddToSystemJournal('Типа руду скидываем');
oreCol[0] := $0482; // Steel
oreCol[1] := $05D7; // Gem
oreCol[2] := $045E; // Anra
oreCol[3] := $07D6; // Valurit
oreCol[4] := $006F; // Lavarok
oreCol[5] := $09F9; // IceRock
oreCol[6] := $0940; // Shadow
oreCol[7] := $094A; // Azurite
oreCol[8] := $0943; // Doom
oreCol[9] := $094E; // BlueSteel
oreCol[10] := $0214; // DarkRuby
oreCol[11] := $0487; // Crystalit
oreCol[12] := $0946; // Onix
oreCol[13] := $093F; // Mefril
oreCol[14] := $0119; //
for g := 0 to 14 do
begin
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)+'!');
hungry (1,ground);
End;
procedure GotoOnBoad;
{зайдем на лодочку}
Begin
CheckSave;
checkdead;
hodilka(ExitX,ExitY,0, true);
AddToSystemJournal('Мы еще в шахте');
wait(500);
hodilka(EnterX,EnterY,0, true);
AddToSystemJournal('Мы на входе в шахту');
wait(500);
hodilka(TohkaX,TohkaY,0, true);
AddToSystemJournal('Мы типа на 4-й точке');
wait(500);
hodilka(TchkaX,TchkaY,0, true);
AddToSystemJournal('Мы типа на 3-й точке');
wait(500);
hodilka(TochaX,TochaY,0, true);
AddToSystemJournal('Мы типа на 2-й точке');
wait(500);
hodilka(TockaX,TockaY,0, true);
AddToSystemJournal('Мы типа на 1-й точке');
wait(500);
hodilka( nearX, nearY, 0,true);
AddToSystemJournal('Мы возле лодки');
wait(1000);
repeat
UseObject(Trap);
wait(1500);
until (GetX(self) = OnBoadX) and (GetY(self) = OnBoadY);
CheckPick;
End;
procedure CheckEquip;
Var EquipPick : Cardinal;
Begin
AddToSystemJournal('Одеваеем кирку');
if GetType(ObjAtLayer(RhandLayer)) <> PickType then
begin
Disarm;
wait(1000);
FindType(PickType, backpack);
if findCount < 2 then
begin
GotoOnBoad;
end
else
begin
EquipPick := finditem;
Equip(RhandLayer, EquipPick);
end
end
checkdead;
End;
procedure GrabOre;
var v : byte;
oreCol : Array [0..14] of Word;
Begin
Check_Stability;
finddistance := 2;
oreCol[0] := $0482; // Steel
oreCol[1] := $05D7; // Gem
oreCol[2] := $045E; // Anra
oreCol[3] := $07D6; // Valurit
oreCol[4] := $006F; // Lavarok
oreCol[5] := $09F9; // IceRock
oreCol[6] := $0940; // Shadow
oreCol[7] := $094A; // Azurite
oreCol[8] := $0943; // Doom
oreCol[9] := $094E; // BlueSteel
oreCol[10] := $0214; // DarkRuby
oreCol[11] := $0487; // Crystalit
oreCol[12] := $0946; // Onix
oreCol[13] := $093F; // Mefril
oreCol[14] := $0119; //
for v := 0 to 14 do
begin
finddistance := 2;
FindTypeEx(oreType,oreCol[v],ground,false);
if FindCount > 0 then
begin
AddToSystemJournal('Типа собираем руду');
Grab(finditem,GetQuantity(finditem));
wait(500);
end;
end;
End;
Function Mining(tile:Word;x,y,z:Integer):boolean;
begin
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)
ClearJournal;
GrabOre;
end;
procedure checkweight;
{проверим вес}
begin
if (Weight > MaxWeight) then begin
AddToSystemJournal('Перевес,не дело..');
GotoOnBoad;
DropOre;
end
checkcoord;
CheckEquip;
end;
{Eieoeaeecaoey ne?eioa}
BEGIN
FindVertical := 10;
SetArStatus(true);
getcoord;
ClearJournal;
AddToSystemJournal('Сэйв чи шо...');
While (not Dead) do
begin
for b :=0 to 68 do
begin
WaitConnection(1000);
CheckSave;
CheckDead;
CheckCoord;
CheckWeight;
begin
Addtosystemjournal('Идем на координату'+intToStr(MiningP[b].px)+', '+intToStr(MiningP[b].py)+'!');
hodilka(MiningP[b].px,MiningP[b].py,1,true);
Addtosystemjournal('Tile number '+intToStr(+'!');
Mining(MiningP[b].tile,MiningP[b].px,MiningP[b].py,MiningP[b].pz);
end
end
end
end.
a( nearX, nearY, 0,true);
AddToSystemJournal('Мы возле лодки');
wait(1000);
repeat
UseObject(Trap);
wait(1500);
until (GetX(self) = bX1) and (GetY(self) = bY1);
CheckPick;
DropOre;
End;
procedure CheckEquip;
var
pickaxe : Cardinal;
Begin
Check_Stability;
if GetType(ObjAtLayer(RhandLayer)) <> PickType then
begin
Disarm;
wait(1000);
FindType(PickType, backpack);
if FindCount > 0 then
begin
pickaxe := finditem;
Equip(RhandLayer, pickaxe);
repeat
wait(1000);
until ObjAtLayer(RhandLayer) = pickaxe
end
else
begin
AddToSystemJournal('не повериш - кирки нету');
checkcoord;
GotoOnBoad;
DropOre;
checkcoord;
AddToSystemJournal('перезапускаемся ))');
Disconnect;
wait(1000);
Connect;
wait(5000);
repeat
until Connected;
AddToSystemJournal('перезапустились ))');
end
end
end;
procedure CheckElemental;
var n : integer; l : TStringList;
begin
if InJournalBetweenTimes('what is this?!', time, Now) > 0 then
begin
UOSay('???');
end
l := TStringList.Create();
finddistance :=10;
FindType(-1,ground);
GetFindedList(l);
for n:= l.count/3*2 to (l.count-1) do if (IsNPC(StrToInt('$'+l.strings[n]))) and (GetNotoriety(StrToInt('$'+l.strings[n]))>3) then UOSay(';-)')
l.free;
finddistance :=2;
end;
procedure GrabOre;
Begin
Check_Stability;
finddistance :=2;
FindType($19B9,ground);
//AddToSystemJournal('поиск руды. найдено абы какой руды '+intToStr(FindCount));
FindTypeEx($19B9,$05D7,ground,false);
If FindCount > 0 then
begin
MoveItem(FindItem,0,backpack,0,0,0);
AddToSystemJournal('Подобрал еще Gem.');
end
FindTypeEx($19B9,$045E,ground,false);
If FindCount > 0 then
begin
MoveItem(FindItem,0,backpack,0,0,0);
AddToSystemJournal('Подобрал еще Anra.');
end
FindTypeEx($19B9,$07D6,ground,false);
If FindCount > 0 then
begin
MoveItem(FindItem,0,backpack,0,0,0);
AddToSystemJournal('Подобрал еще Valurit.');
end
FindTypeEx($19B9,$006F,ground,false);
If FindCount > 0 then
begin
MoveItem(FindItem,0,backpack,0,0,0);
AddToSystemJournal('Подобрал еще Lavarok.');
end
FindTypeEx($19B9,$09F9,ground,false);
If FindCount > 0 then
begin
MoveItem(FindItem,0,backpack,0,0,0);
AddToSystemJournal('Подобрал еще IceRock.');
end
FindTypeEx($19B9,$0940,ground,false);
If FindCount > 0 then
begin
MoveItem(FindItem,0,backpack,0,0,0);
AddToSystemJournal('Подобрал еще Shadow.');
end
FindTypeEx($19B9,$094A,ground,false);
If FindCount > 0 then
begin
MoveItem(FindItem,0,backpack,0,0,0);
AddToSystemJournal('Подобрал еще Azurite.');
end
FindTypeEx($19B9,$0943,ground,false);
If FindCount > 0 then
begin
MoveItem(FindItem,0,backpack,0,0,0);
AddToSystemJournal('Подобрал еще Doom.');
end
FindTypeEx($19B9,$094E,ground,false);
If FindCount > 0 then
begin
MoveItem(FindItem,0,backpack,0,0,0);
AddToSystemJournal('Подобрал еще BlueSteel.');
end
FindTypeEx($19B9,$0214,ground,false);
If FindCount > 0 then
begin
MoveItem(FindItem,0,backpack,0,0,0);
AddToSystemJournal('Подобрал еще DarkRuby.');
end
FindTypeEx($19B9,$0487,ground,false);
If FindCount > 0 then
begin
MoveItem(FindItem,0,backpack,0,0,0);
AddToSystemJournal('Подобрал еще Crystalit.');
end
FindTypeEx($19B9,$0946,ground,false);
If FindCount > 0 then
begin
MoveItem(FindItem,0,backpack,0,0,0);
AddToSystemJournal('Подобрал еще Onix.');
end
FindTypeEx($19B9,$093F,ground,false);
If FindCount > 0 then
begin
MoveItem(FindItem,0,backpack,0,0,0);
AddToSystemJournal('Подобрал еще Mefril.');
end
End;
procedure checkweight;
{???????? ???}
begin
if (Weight > MaxWeight) then begin
AddToSystemJournal('Перегруз, бегом на базу...');
GotoOnBoad;
DropOre;
end
checkcoord;
//CheckEquip;
end;
procedure Mine();
var
z: integer;
begin
AddToSystemJournal('перезапускаемся ))');
Disconnect;
wait(1000);
Connect;
wait(5000);
repeat
until Connected;
AddToSystemJournal('перезапустились ))');
l_x := (GetX(self) - 2);
h_x := (GetX(self) + 2);
l_y := (GetY(self) - 2);
h_y := (GetY(self) + 2);
z := GetZ(self);
for c_x := l_x to h_x do
begin
for c_y := l_y to h_y do
begin
if TargetPresent then
begin
CancelTarget;
wait(500);
end
CheckEquip;
time := Now;
Check_Stability;
UseObject(ObjAtLayer(RhandLayer));
WaitTargetXYZ(c_x, c_y, z);
CheckElemental;
GrabOre;
WaitJournalLine(Now,'here|broke|That is|_|what is this', 30000);
GrabOre;
checkweight;
CheckElemental;
end
end
end;
BEGIN
SetArStatus(true);
FindVertical := 10;
getcoord;
While (not Dead) do
begin
Ignore($58AAFA12);
for b :=0 to 12 do {количество тайлов минус 1}
begin
WaitConnection(1000);
CheckSave;
CheckDead;
CheckCoord;
CheckWeight;
begin
Addtosystemjournal('???? ?? ??????????'+intToStr(MiningP[b].px)+', '+intToStr(MiningP[b].py)+'!');
hodilka(MiningP[b].px,MiningP[b].py,1,true);
Addtosystemjournal('Tile number '+intToStr(b)+'!');
Mine;
//Mining(MiningP[b].tile,MiningP[b].px,MiningP[b].py,MiningP[b].pz);
GrabOre;
end
end
end
end.
16:35:43 [Gooddy]: Compiling
16:35:43 [Gooddy]: Compiler: [Error] (Текстовый документ (2).txt at 61:32): Syntax error
16:35:43 [Gooddy]: Compiling failed
16:35:43 [Gooddy]: Script Текстовый документ (2).txt stoped successfuly
Помогите пожалуйста!