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 = 4081;
nearY = 293;
EnterX=4049;
EnterY=315;
ExitX=4037;
ExitY=315;
onboadx = 4081;
onboady = 290;
onboadz = -2;
Trap = $5A3D7407;
maxweight = 320;
OreType = $19B9;
PickType = $0E85;
PickGump = '3717';
TinkGump = '7865';
Tinktype = $1EB9;
CopperType = $1BF2;
{$Include 'all.inc'}
procedure checkdead;
Begin
if Dead then
begin
AddToSystemJournal('Скрипт стартовал'+TimeToStr(now)+'(c)Абба');
Disconnect;
end
End;
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('D:\Games\Ultima Online Samurai Empire\Stealth_v1.0 (RC 3)\Tiles.txt');
for b := 0 to List.Count-1 do
GetMiningTiles(List.strings[b],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(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( 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(b)+'!');
Mining(MiningP[b].tile,MiningP[b].px,MiningP[b].py,MiningP[b].pz);
end
end
end
end.
Вот из етого скрипта я взял тот кусок тут же уже все настроено а точто ты дал сылку я ж немагу заменить етот скрипт тем потомучто будут не палатки .