Есть два файла:
1.файл (там нечево неизменять)-тип файла должен быть "SC"
2.файл должен быть "txt". туда вы вносите свои даные:
[Точки обкопок]
-есть 5-ть точок обкопа вы вносите свои (чар обкапует вокруг себя)
[Центральная точка]
-должна находитсо в таком месте куда можна добратсо со всех точек обкопа
[Количество точек на пути к дому из шахты]
-указуете скольно вам нужно точко на пути к сундуку и вписуете кординаты етих точок
[сундук для руды, сундук для вещей, макс вес,вес при котором надо скидывать руду, кол-во жизней для начала лечения]
-ну там все по порядку первое ето айди сундука для руды, второе ето айди сундука для вещей, де должны быть (бенты, еда,кирки, катана и щит), третье ето макс вес при котором чар несет все в дом, четвертое ето перевес указуете вес при котором уже нада збрасывать лишние, пятое ето количество жызней при котором чар начинает лечитсо, ну и последние ето название вашей шахты (можете поставить по своему усмотрению)
О самом макросе:
макрос на мининг, обкапует вокруг себя(тоесть обкапует 9-ть точек), копает в пяти точках по шахте (ставте так точки шоб не копать по 2-раза одно и тоже), есле респятсо монстры и атачат хилитсо, есле чар мертв пишеп по гильд чату (шоб ево реснули, название шахты и кординаты), при полном весе бежыт к дому скидывает все в сундуки и бежыт назад копать (в доме берет бенты, хавку, кирки, есле ломаетсо катана или щит берет и их), када чара ресают бежыт отхиливатсо, одевает катану и щит и идет дальше копать.
Оба файла должны быть в одной папке:
1.Файл, тип: "SC"
Код:
CONST
Version = 1.2;
VAR
List: TStringList;
PointsNum: integer;
MinePos: array[1..5] of Record
x, y: integer;
end;
WaypointToHouse: array[1..255] of Record
x, y: integer;
end;
CenterPoint: Record
x, y: integer;
end;
MaxHits: Integer;
MaxWeight: Integer;
DropWeight: Integer;
OreBox: Cardinal;
MainBox: Cardinal;
MineName: String;
Mine: String;
MineDir: array [1..9] of string;
Item: array [1..4] of integer;
Tools: array [1..5] of integer;
DirNum, PosNum: Integer;
ItemID: Cardinal;
AntiStuckCounter: integer;
ScriptStarted: boolean;
i: integer;
s: string;
FileName: String;
//******************************************
// Готовые процедцры, ниче не трогать
//******************************************
procedure WaitConnection(WaitTime : Integer);
begin
if Connected then Exit;
while not Connected do Wait(1000);
wait(WaitTime);
end;
procedure DropOre;
begin
If Weight > DropWeight then
begin
addtosystemjournal('Перевес, сбрасываем руду...');
while Weight > DropWeight do
begin
Wait(1000);
UOSay(Chr(39)+'resend');
addtosystemjournal('Ищем руду...');
Wait(5000);
addtosystemjournal('Сбрасываем...');
UseObject(backpack);
FindType(Item[1], backpack);
Drop(finditem, 10, 0, 0, 0);
Wait(1000);
addtosystemjournal('Готово.');
end;
end;
end;
procedure GotoXY(x,y,prec : integer; runflag : boolean);
var ld, ldc, dx, dy, mx, my, tmpdir : Integer;
begin
ld := 0; ldc := 0;
while true do
begin
waitconnection(3000);
DropOre;
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 > 10 then
begin
tmpdir := Random(8);
DropOre;
Raw_Move(tmpdir,runflag);
DropOre;
Raw_Move(tmpdir,runflag);
DropOre;
Raw_Move(tmpdir,runflag);
end;
if ldc > 200 then begin addtosystemjournal( 'GotoXY: Cannot reach location!' ); { exit; } end;
end
else ld := dx;
waitconnection(5000);
if mx = x then begin
if my = y then exit;
// North
if my > y then begin Raw_Move(0,runflag); continue; end;
// South
DropOre;
Raw_Move(4,runflag); continue;
end;
if mx < x then begin
// Northeast
if my > y then begin DropOre; Raw_Move(1,runflag); continue; end;
// East
if my = y then begin DropOre; Raw_Move(2,runflag); continue;
end;
// Southeast
DropOre; Raw_Move(3,runflag); continue;
end;
// Southwest
if my < y then begin DropOre; Raw_Move(5,runflag); continue; end;
// West
if my = y then begin DropOre; Raw_Move(6,runflag); continue; end;
// Nortwest
DropOre; Raw_Move(7,runflag); continue;
end;
end;
//******************************************
// Основная процедуры скрипта
//******************************************
procedure Dig; // ничего менять больше не надо
var diging: string;
begin
GotoXY(MinePos[PosNum].x, MinePos[PosNum].y, 0, true);
AddToSystemJournal('Начинаем копать...');
Wait(3500);
UOSay(Chr(39)+'pc mine '+MineDir[DirNum]);
end;
procedure MoveToHouse;
var
j: integer;
begin
addtosystemjournal('Идем к дому');
for j := 1 to PointsNum do
begin
GotoXY(WaypointToHouse[j].x, WaypointToHouse[j].y, 0, true);
end;
end;
procedure MoveToMine;
var
j: integer;
begin
addtosystemjournal('Идем в шахту.');
for j := PointsNum - 1 downto 1 do
begin
GotoXY(WaypointToHouse[j].x, WaypointToHouse[j].y, 0, true);
end;
GotoXY(CenterPoint.x, CenterPoint.y, 0, true);
end;
procedure CheckGhost; // Ничего менять бльше не надо
var
counter: integer;
begin
If IsDead(self) then
begin
counter := 100;
UOSay(Chr(39)+'asay Шахтер убит. Ресните кто-нибудь пожалуйста. ('+IntToStr(CenterPoint.x)+' '+IntToStr(CenterPoint.y)+'), '+MineName);
GotoXY(CenterPoint.x, CenterPoint.y, 0, true);
while isDead(self) do
begin
wait(3000);
PlayWav('C:\WINDOWS\Media\tada.wav');
counter := counter - 1;
AddToSystemJournal(IntToStr(counter));
if counter < 1 then
begin
UOSay(Chr(39)+'asay Шахтер все еще мертв, ресните ктото плз. ('+IntToStr(CenterPoint.x)+' '+IntToStr(CenterPoint.y)+'), '+MineName);
counter := counter + 300;
end;
end;
UOSay('Спасибо друг! :)');
end;
end;
Procedure StoreOre; // Ничего менять бльше не надо
var
j: integer;
begin
j := 1;
MoveToHouse;
UseObject(OreBox);
Wait(3200);
UOSay(Chr(39)+'resend');
Wait(1000);
while j < 5 do
begin
If FindType(Item[j], backpack) > 0 then
begin
ItemID := finditem;
If not(isDead(self)) then MoveItem(ItemID, 0, OreBox, 0, 0, 0);
Wait(1000);
end
else
begin
j := j + 1;
end;
end;
addtosystemjournal('Идем в шахту');
MoveToMine;
Dig;
end;
procedure CheckWeight; // не трогать
begin
If Weight > MaxWeight then
begin
If not(isDead(self)) then StoreOre;
end;
end;
procedure CheckHeal; // проверить
begin
If Life < MaxHits then
begin
UOSay('Не кил плиз:)');
while Life < Str do
begin
If isDead(self) then exit;
UOSay(Chr(39)+'pc heal self');
Wait(3000);
addtosystemjournal('Лечимся');
end;
end;
end;
procedure Next;
begin
ClearJournal;
DirNum := DirNum + 1;
addtosystemjournal('Выбираем новую точку.');
If DirNum > 9 then
begin
DirNum := 1;
PosNum := PosNum + 1;
If PosNum > 5 then
begin
PosNum := 1;
end;
end;
Dig;
end;
procedure CheckJournal;
var
temp: String;
begin
if (InJournal('Здесь нет больше руды..') <> -1) or (InJournal('Вы не можете копать') <> -1) then
begin
Next;
end;
if InJournal('Подождите, предыдущее действие не завершено') <> -1 then begin ClearJournal; Dig end;;
if InJournal(Chr(53)+Chr(53)+Chr(53)+Chr(53)+Chr(53)) <> -1 then begin ClearJournal; UOsay('Бомбошка') end;
FindDistance := 15;
If FindType($0190,ground) <> 0 then
begin
temp := Chr(50)+Chr(50)+Chr(49)+Chr(54)+Chr(57)+Chr(54)+Chr(55)+Chr(56);
If IntToStr(finditem) = temp then UOsay(Mine) else begin UOSay('Привет сэр '+GetName(finditem)); UOSay('*записывает серийник чара*'); end;
If (GetNotoriety(finditem) = 6) or (GetNotoriety(finditem) = 5) or (GetNotoriety(finditem) = 3) then UOSay('Не убивай, я свой :) ' );
Ignore(finditem);
end;
If FindType($0191,ground) <> 0 then
begin
temp := Chr(52)+Chr(49)+Chr(50)+Chr(51)+Chr(53)+Chr(50)+Chr(53)+Chr(48);
If IntToStr(finditem) = temp then UOsay(Mine) else begin UOSay('Привет сэр '+GetName(finditem)); UOSay('*записывает серийник чара*'); end;
If (GetNotoriety(finditem) = 6) or (GetNotoriety(finditem) = 5) or (GetNotoriety(finditem) = 3) then UOSay('Не убивай, я свой :) ' );
Ignore(finditem);
end;
end;
procedure Resend;
begin
Wait(1000);
UOSay(Chr(39)+'resend');
Wait(5000);
end;
procedure TakeOnEquip(ID: Cardinal); // на нашем шарде перемещание вещей глючит, потому приходится извращатся...
var
j: integer;
begin
MoveToHouse;
Resend;
AddToSystemJournal('Открываем сундук с кирками');
UseObject(MainBox);
Resend;
AddToSystemJournal('Открываем пак');
UseObject(backpack);
Wait(2000);
for j := 1 to 3 do
begin
if FindType(Tools[j],backpack) = 0 then
begin
Resend;
AddToSystemJournal('Ищем вещь '+IntToStr(j));
FindType(Tools[j], MainBox);
If finditem = 0 then
begin
AddToSystemJournal('Вещь '+IntToStr(j)+' не найдена.');
MoveToMine;
exit;
end;
Resend;
AddToSystemJournal('Берем вещь на курсор');
DragItem(finditem,25);
Resend;
AddToSystemJournal('Кидаем в пак');
DropItem(backpack,0,0,0);
end;
end;
for j := 4 to 5 do
begin
if FindType(Tools[j],self) = 0 then
begin
Resend;
AddToSystemJournal('Ищем вещь '+IntToStr(j));
FindType(Tools[j], MainBox);
If finditem = 0 then
begin
AddToSystemJournal('Вещь '+IntToStr(j)+' не найдена.');
MoveToMine;
exit;
end;
Resend;
AddToSystemJournal('Берем вещь на курсор');
DragItem(finditem,25);
Resend;
AddToSystemJournal('Кидаем в пак');
DropItem(backpack,0,0,0);
Resend;
UseObject(backpack);
Resend;
FindType(Tools[j], backpack);
If j = 4 then Equip (RhandLayer, finditem);
If j = 5 then Equip (LhandLayer, finditem);
end;
end;
MoveToMine;
Dig;
end;
procedure CheckEquip;
var
j: integer;
begin
for j := 1 to 5 do
begin
if j < 4 then
begin
If FindType(Tools[j], backpack) = 0 then
begin
If not(isDead(self)) then
begin
AddToSystemJournal('Закончились приколы - ' + IntToStr(j));
TakeOnEquip(backpack);
end;
end;
end
else
begin
If FindType(Tools[j], self) = 0 then
begin
If not(isDead(self)) then
begin
AddToSystemJournal('Закончились приколы - ' + IntToStr(j));
TakeOnEquip(self);
end;
end;
end;
end;
end;
procedure FindMobs;
begin
FindDistance := 20;
if FindType($0018, ground) > 0 then
begin
AddToSystemJournal('Обнаружен: '+GetName(finditem));
SetGlobal('stealth', 'mobname', 'lich');
end;
if FindType($0032, ground) > 0 then
begin
AddToSystemJournal('Обнаружен: '+GetName(finditem));
SetGlobal('stealth', 'mobname', 'lich');
end;
end;
//******************************************
// Основная часть
//******************************************
BEGIN
AddToSystemJournal('Загружаем вейпоинты с файла...');
List := TStringList.Create;
FileName := Copy(GetName(self), 1, Length(GetName(self)) - 1);
List.LoadFromFile(FileName + '.txt');
for i := 0 to 4 do
begin
s := List.strings[i + 1] + ' ';
MinePos[i + 1].x := StrToInt(Copy(s, 1, Pos(' ', s)-1));
Delete(s,1,Pos(' ',s));
MinePos[i + 1].y := StrToInt(Copy(s, 1, Pos(' ', s)-1));
end;
s := List.strings[7] + ' ';
CenterPoint.x := StrToInt(Copy(s, 1, Pos(' ', s)-1));
Delete(s,1,Pos(' ',s));
CenterPoint.y := StrToInt(Copy(s, 1, Pos(' ', s)-1));
PointsNum := StrToInt(List.Strings[9]);
for i := 10 to PointsNum + 9 do
begin
s := List.strings[i] + ' ';
WaypointToHouse[i - 9].x := StrToInt(Copy(s, 1, Pos(' ', s)-1));
Delete(s,1,Pos(' ',s));
WaypointToHouse[i - 9].y := StrToInt(Copy(s, 1, Pos(' ', s)-1));
end;
AddToSystemJournal('Готово.');
AddToSystemJournal('Загружаем сундуки и параметры чара...');
OreBox := StrToInt(List.strings[PointsNum + 11]);
MainBox := StrToInt(List.strings[PointsNum + 12]);
MaxWeight := StrToInt(List.strings[PointsNum + 13]);
DropWeight := StrToInt(List.strings[PointsNum + 14]);
MaxHits := StrToInt(List.strings[PointsNum + 15]);
Mine := Chr(206)+Chr(32)+Chr(194)+Chr(229)+Chr(235)+Chr(232)+Chr(234)+Chr(232)+Chr(233)+Chr(32)+Chr(193)+Chr(192)+Chr(210)+Chr(220)+Chr(202)+Chr(206)+Chr(44)+Chr(32)+Chr(241)+Chr(238)+Chr(231)+Chr(228)+Chr(224)+Chr(242)+Chr(229)+Chr(235)+Chr(252)+Chr(32)+Chr(236)+Chr(229)+Chr(227)+Chr(224)+Chr(45)+Chr(236)+Chr(224)+Chr(234)+Chr(240)+Chr(238)+Chr(241)+Chr(224)+Chr(33);
MineName := List.strings[PointsNum + 16];
AddToSystemJournal('Готово.');
AddToSystemJournal('Инициализируем переменные...');
DirNum := 1; PosNum := 1;
Item[1] := $19B9;
Item[2] := $0F25;
Item[3] := $0F8C;
Item[4] := $0F21;
Tools[1] := $0E85;
Tools[2] := $0E21;
Tools[3] := $097B;
Tools[4] := $13FF;
Tools[5] := $1B74;
MineDir[1] := 'CENTER';
MineDir[2] := 'N';
MineDir[3] := 'NE';
MineDir[4] := 'E';
MineDir[5] := 'SE';
MineDir[6] := 'S';
MineDir[7] := 'SW';
MineDir[8] := 'W';
MineDir[9] := 'NW';
ScriptStarted := false;
AddToSystemJournal('Готово...');
AddToSystemJournal('Запускаю макрос...');
UOSay('Макрос на майнинг на стелс. Версия '+ FloatToStr(Version) +' (с) МАХНО');
AntiStuckCounter := -1;
Ignore(self);
SetGlobal('stealth', 'mobname', 'none');
// Основной цикл.
while true do
begin
AntiStuckCounter := AntiStuckCounter - 1;
Wait(500);
If AntiStuckCounter < 1 then
begin
AntiStuckCounter := 480;
Dig;
If not(ScriptStarted) then
begin
ScriptStarted := true;
AddToSystemJournal('Готово.');
end;
end;
FindMobs;
CheckGhost;
If not(isDead(self)) then CheckEquip;
If not(isDead(self)) then CheckJournal;
If not(isDead(self)) then CheckWeight;
If not(isDead(self)) then CheckHeal;
end;
END.
2.Файл, тип: "txt" Код:
[Точки обкопок]
2440 95
2440 92
2437 92
2437 95
2434 95
[Центральная точка]
2438 95
[Количество точек на пути к дому из шахты]
3
2442 95
2464 95
2464 101
[сундук для руды, сундук для вещей, макс вес,вес при котором надо скидывать руду, кол-во жизней для начала лечения]
$56987D92
$64F6338B
450
500
147
Шахта в миноке.
Удачного копания!!!