Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Plain Text by 232 ( 7 years ago )
Program Carpentry;
Const
// Координаты
boatX = 2581; // Координата X у лодки
boatY = 538; // Координата Y у лодки
trapID = $4BE59423; // Айди трапа
chestID = $4BEA7E80; // Сундук с баблом
vendorX = 2575; // Координата X у вендора
vendorY = 531; // Координата Y у вендора
trashX = 2570; // Координата X у трэша
trashY = 528; // Координата Y у трэша
trashID = $4A7D9CED; // Айди трэша
// Ресурсы
logsType = $1BF2; // Тайп Логов
logsColor = $0602; // Цвет Логов
ingotsType = $1BF2; // Тайп ингота
ingotsColor = $0602; // Цвет ингота
// Инструменты
tinkerToolsType = $1EBC; // Тайп тинкер тулсов
tinkerToolsGump = '7868'; // Гамп тинкер тулсов
jointingPlaneType = $1EBC; // Тайп рубанка
jointingPlaneGump = '7868'; // Гамп рубанка
// Прокачка
makeItemType = $100E; // Тайп Делаемого Предмета
makeItemGump = '4110'; // Гамп делаемого предмета
// Системные
minLogsQuantity = 10; // Минимальное количество логов для стругания
requiredLogsQuantity = 200; // Сколько дерева брать с лодки
sellItemsToVendor = true; // Продавать вендору - true, кидать в треш - false
weightLimit = 55; // Максимальный вес при превышении которого предметы продаются или выкидываются
GoldType = $0EED;
var a:integer;
{$Include 'all.inc'}
Procedure CheckMaterials(materialType:Word; materialColor:Word; requiredAmount:Integer);
Begin
AddToSystemJournal('Проверяю ресурсы для инструмента');
FindTypeEx(materialType, materialColor, Backpack, false);
If FindQuantity < requiredAmount Then Begin
AddToSystemJournal('Надо взять ресурсы');
a := FindQuantity;
FindTypeEx(materialType, materialColor, Ground, false);
If FindQuantity > requiredAmount Then Begin
MoveItem(FindItem, requiredAmount - a, Backpack, 0, 0, 0);
End
Else
Begin
AddToSystemJournal('Надо '+IntToStr(requiredAmount)+' ресурсов, но их нет :(');
Wait(30000);
End;
End;
End;
Procedure CheckTinkerTools;
Begin
AddToSystemJournal('Проверяю тинкер тулсы');
If (Count(tinkerToolsType) < 2) Then Begin
AddToSystemJournal('Тинкер тулсов меньше двух, надо сделать еще');
Repeat
CheckMaterials(ingotsType, ingotsColor, 50);
AddToSystemJournal('Делаю тинкер тулс');
If TargetPresent Then CancelTarget;
UseObject(FindType(tinkerToolsType, Backpack));
WaitTargetObject(FindType(ingotsType, Backpack));
WaitGump(tinkerToolsGump);
WaitJournalLine(Now, 'You create|destroy|turned your|must stand', 30000);
Until (Count(tinkerToolsType) >= 2);
AddToSystemJournal('Тинкер тулсов 2 или больше');
Wait(500);
End;
End;
Procedure CheckJointingPlanes;
Begin
AddToSystemJournal('Проверяю рубанки');
If (Count(jointingPlaneType) < 3) Then Begin
AddToSystemJournal('Рубанков меньше трех, надо сделать еще');
Repeat
CheckMaterials(logsType, logsColor, 50);
AddToSystemJournal('Делаю рубанки');
If TargetPresent Then CancelTarget;
UseObject(FindType(tinkerToolsType, Backpack));
WaitTargetObject(FindType(logsType, Backpack));
WaitGump(jointingPlaneGump);
WaitJournalLine(Now, 'You create|destroy|turned your|must stand', 30000);
Until (Count(jointingPlaneType) >= 3);
AddToSystemJournal('Рубанков 3 или больше');
Wait(500);
End;
End;
Procedure GetOut;
Begin
If (GetZ(self) = -2) Then Begin
AddToSystemJournal('Выхожу из лодки');
Repeat
UseObject(trapID);
Wait(500);
Raw_Move(0, true);
Raw_Move(0, true);
Wait(500);
Until (GetZ(self) <> -2);
AddToSystemJournal('Вышел, иду трудиться');
If sellItemsToVendor then Begin
AddToSystemJournal('Иду качаться и зарабатывать бабло');
NewMoveXY(vendorX, vendorY, true, 0, true);
End
Else
Begin
AddToSystemJournal('Иду качаться и выбрасывать деньги в мусорку');
NewMoveXY(trashX, trashY, true, 0, true);
End;
AddToSystemJournal('Пришел');
End;
End;
Procedure GoOnBoard;
Begin
If (GetZ(self) <> -2) Then Begin
AddToSystemJournal('Иду к лодке');
newMoveXY(boatX, boatY, true, 0, true);
AddToSystemJournal('Подошел к лодке');
Repeat
AddToSystemJournal('Захожу на лодку');
UseObject(trapID);
Wait(500);
Until (GetZ(self) = -2);
End;
AddToSystemJournal('На лодке');
Hungry(1, Ground);
FindType(GoldType, Backpack);
If (FindQuantity > 0) Then Begin
MoveItem(FindItem, 0, chestID, 0, 0, 0);
CheckLag(30000);
Wait(500);
End;
CheckTinkerTools;
CheckJointingPlanes;
CheckMaterials(logsType, logsColor, requiredLogsQuantity);
Hungry(1, Ground);
GetOut;
End;
Procedure ManageItems;
Begin
If sellItemsToVendor then Begin
FindType(makeItemType, Backpack);
If (FindCount > 0) then begin
WaitTargetObject(FindItem);
UOSay('sell');
WaitJournalLine(Now, 'total of', 10000);
End;
End
Else
Begin
Repeat
FindType(makeItemType, Backpack);
If (FindCount > 0) Then Begin
MoveItem(FindItem, 0, trashID, 0, 0, 0);
CheckLag(30000);
Wait(500);
End;
Until(Count(makeItemType) = 0)
End;
End;
Procedure Craft;
Begin
While CountEx(logsType, logsColor, Backpack) > minLogsQuantity Do Begin
CancelMenu;
AddToSystemJournal('Логов в бекпаке: '+IntToStr(Count(logsType)));
AddToSystemJournal('Стругаю');
If TargetPresent Then CancelTarget;
WaitTargetObject(FindType(logsType, Backpack));
WaitGump(makeItemGump);
UseObject(FindType(jointingPlaneType, Backpack));
WaitJournalLine(Now, 'You create the item|You destroyed', 30000);
ManageItems;
End;
End;
Begin
FindDistance := 2;
MoveThroughNPC := 0;
SetARStatus(true);
//UOSay('.sign 1');
//UOSay('.autoloop 1');
//UOSay('.deedcheck 2');
While true Do Begin
While not Dead and Connected Do Begin
GoOnBoard;
Craft;
End;
While Dead and Connected Do Begin
AddToSystemJournal('Чар мертв...');
Wait(30000);
End;
End;
End.
Revise this Paste