Code: Select all
//Made by Shinma 2013
//Blacksmithing
//Test on RunUO
//Stealth version 4.3.6
//Информацию по прокачке брал с uoguide.com
//40.0 - 45.0 Mace
//45.0 - 50.0 Maul
//50.0 - 55.0 Cutlass
//55.0 - 59.5 Katana
//59.5 - 70.5 Spear
//70.5 - 106.4 Platemail Gorget
//106.4 - 108.9 Platemail Gloves
//108.9 - 116.3 Platemail Arms
//116.3 - 118.8 Platemail Legs
//118.8 - 120.0 Platemail Tunics
//Общий принцип работы скрипта:
//скрипт работает с Iron Ingots
//скрипт качает БС только при наличии БС 40 и более и тинкеринг 30 и более
//скрипт находит в сумке тинкер тулс и инготы.
//Если нету тонгов делает тонки. Если тинкер тулсов 1 делает второй
//когда инготы кончаются берет новые из сундука.
//переплавляет скрафченное обратно в инготы.
//вы можете указать в переменную IDBoxIngot идентификатор сундука с инготами.
//Узнать ID сундука можно с помощью команды ,info в игре.
//Если в IDBoxIngot указать 0. Скрипт не будет брать инготы из сундука.
//скрипту не важно какое у вас максимальное значение БС, он сам остановится при достижении предела прокачки.
program bs_shinma;
const
IDBoxIngot=0;
//IDBoxIngot=$400F9C58 ;
ingot=$1BF2 ;
TinkerTool=$1EB8;
tong=$0FBB ;
Mace=$0F5C ;
Maul=$143B ;
Cutlass=$1441 ;
Katana=$13FF ;
Spear=$0F62 ;
PmGorget=$1413 ;
PmGloves=$1414 ;
PmArms=$1410;
PmLegs=$1411;
PmTunics=$1415;
var
SkillNow: Double;
agump:Word;
checkW,i:integer;
procedure Init;
begin
SetPauseScriptOnDisconnectStatus(True);
SetARStatus(True);
if not Connected then Connect;
wait(5000);
end;
procedure create(BtRz,BtIt:integer;TpItem:word);
var
aa : TClilocRec;
bb : TClilocItemRec;
OldSkill : Double;
begin
OldSkill := GetSkillValue('Blacksmithing');
aa := GetToolTipRec(backpack);
bb := aa.Items[1];
while (count(tong)>0) and (strtoint(bb.Params[0])<124) and (GetSkillValue('Blacksmithing') = OldSkill) and not dead and (count(ingot)>50) do
begin
for i:=0 to GetGumpsCount do
begin
wait(500);
CloseSimpleGump(i);
end;
agump := GetGumpsCount;
checklag(50000);
UseObject(FindType(tong,Backpack));
wait(1000);
while agump = GetGumpsCount do
Wait(60);
NumGumpButton(GetGumpsCount-1,BtRz);
wait(600);
NumGumpButton(GetGumpsCount-1,BtIt);
AddToSystemJournal('Создаю предмет');
wait(1000);
checkW:=0;
while not dead and connected and (strtoint(bb.Params[0])<124) and (GetSkillValue('Blacksmithing') = OldSkill) and IsObjectExists(FindItem) and (count(ingot)>50) do
begin
checklag(50000);
WaitGump('1999');
Wait(700);
aa := GetToolTipRec(backpack);
bb := aa.Items[1];
checkW:=checkW+1;
if checkW = 20 then
begin
UseObject(FindType(tong,Backpack));
checkW:=0;
end;
end;
if (GetSkillValue('Blacksmithing') <> OldSkill) then AddToSystemJournal('BS='+FloatToStr(SkillNow));
for i:=0 to GetGumpsCount do
begin
wait(500);
CloseSimpleGump(i);
end;
aa := GetToolTipRec(backpack);
bb := aa.Items[1];
end
end;
Procedure Smelth(SmIt:word); //Переплавка
begin
while (count(SmIt)>0)and not dead and (count(tong)>0) do
begin
for i:=0 to GetGumpsCount do
begin
wait(500);
CloseSimpleGump(i);
end;
If TargetPresent Then CancelTarget;
UseObject(FindType(tong,Backpack));
wait(1000);
while agump = GetGumpsCount do
Wait(50);
NumGumpButton(GetGumpsCount-1,7000);
wait(1000);
WaitTargetObject(FindType(SmIt,BackPack));
AddToSystemJournal('Переплавка');
wait(1000);
checkW:=0;
while not dead and connected and (count(tong)>0) and (count(SmIt)>0)and IsObjectExists(FindItem) do
begin
checklag(50000);
WaitGump('7000');
wait(500);
WaitTargetObject(FindType(SmIt,BackPack));
Wait(500);
checkW:=checkW+1;
if checkW = 20 then
begin
UseObject(FindType(tong,Backpack));
checkW:=0;
end;
end;
for i:=0 to GetGumpsCount do
begin
wait(500);
CloseSimpleGump(i);
end;
end;
end;
Procedure CheckItem; //Проверка инготов, тинкер тулс,тонгс.
begin
///////////////
// Check Ingot
///////////////
checklag(50000);
FindType(ingot,backpack);
while FindFullQuantity <50 do
begin
If IDBoxIngot = 0 then
begin
AddToSystemJournal('Инги кончились');
repeat
wait(1000);
FindType(ingot,backpack);
until (FindFullQuantity > 50) or dead;
end
else
begin
checklag(50000);
UseObject(IDBoxIngot);
wait(2000);
FindType(ingot,IDBoxIngot);
if FindFullQuantity > 50 then
begin
checklag(50000);
AddToSystemJournal('кол-во ингов= '+Inttostr(FindFullQuantity));
MoveItem(Finditem,FindQuantity,backpack,0,0,0);
end
else
begin
AddToSystemJournal('Инги кончились');
repeat
wait(10000);
checklag(50000);
UseObject(IDBoxIngot);
wait(2000);
FindType(ingot,IDBoxIngot);
until dead or (FindFullQuantity > 50);
end;
end;
end;
//////////////////
// Check TinkerTools
/////////////////
checklag(50000);
while (count(TinkerTool) <2) and (count(ingot) >2) do
begin
for i:=0 to GetGumpsCount do
begin
wait(500);
CloseSimpleGump(i);
end;
agump := GetGumpsCount;
checklag(50000);
UseObject(FindType(TinkerTool,Backpack));
wait(1000);
while agump = GetGumpsCount do
Wait(60);
NumGumpButton(GetGumpsCount-1,9002);
wait(600);
NumGumpButton(GetGumpsCount-1,11);
AddToSystemJournal('Скрафтил тинкер тул');
wait(5000);
end;
//////////////////
// Check Tongs
/////////////////
checklag(50000);
while count(tong) <2 do
begin
for i:=0 to GetGumpsCount do
begin
wait(500);
CloseSimpleGump(i);
end;
agump := GetGumpsCount;
checklag(50000);
UseObject(FindType(TinkerTool,Backpack));
wait(1000);
while agump = GetGumpsCount do
Wait(60);
NumGumpButton(GetGumpsCount-1,9002);
wait(600);
NumGumpButton(GetGumpsCount-1,20);
AddToSystemJournal('Скрафтил Тонг');
wait(5000);
end;
for i:=0 to GetGumpsCount do
begin
wait(500);
CloseSimpleGump(i);
end;
end;
begin
Init;
if (GetSkillValue('Blacksmithing')>=30) and (GetSkillValue('Tinkering')>=30) and not dead then
begin
CheckItem;
//////////////
//Check Material Type in BS menu
//////////////
for i:=0 to GetGumpsCount do
begin
wait(500);
CloseSimpleGump(i);
end;
agump := GetGumpsCount;
checklag(50000);
UseObject(FindType(TinkerTool,Backpack));
wait(1000);
while agump = GetGumpsCount do
Wait(60);
NumGumpButton(GetGumpsCount-1,5000);
AddToSystemJournal('Выставил крафт из Iron Ore');
for i:=0 to GetGumpsCount do
begin
wait(500);
CloseSimpleGump(i);
end;
wait(5000);
/////////////
while not dead and (GetSkillValue('Blacksmithing')<GetSkillCap('Blacksmithing'))do
begin
SkillNow:=GetSkillValue('Blacksmithing');
case SkillNow of
40.0 ..45.0:
begin
AddToSystemJournal('BS='+FloatToStr(SkillNow));
CheckItem;
create(9007,77,Mace);
Smelth(Mace);
end;
45.1 ..50.0:
begin
AddToSystemJournal('BS='+FloatToStr(SkillNow));
CheckItem;
create(9007,78,Maul);
Smelth(Maul);
end;
50.1 ..55.0:
begin
AddToSystemJournal('BS='+FloatToStr(SkillNow));
CheckItem;
create(9004,44,Cutlass);
Smelth(Cutlass);
end;
55.1 ..59.5:
begin
AddToSystemJournal('BS='+FloatToStr(SkillNow));
CheckItem;
create(9004,46,Katana);
Smelth(Katana);
end;
59.6 ..70.5:
begin
AddToSystemJournal('BS='+FloatToStr(SkillNow));
CheckItem;
create(9006,74,Spear);
Smelth(Spear);
end;
70.6 ..106.4:
begin
AddToSystemJournal('BS='+FloatToStr(SkillNow));
CheckItem;
create(9001,10,PmGorget);
Smelth(PmGorget);
end;
106.5 ..108.9:
begin
AddToSystemJournal('BS='+FloatToStr(SkillNow));
CheckItem;
create(9001,9,PmGloves);
Smelth(PmGloves);
end;
109.0 ..116.3:
begin
AddToSystemJournal('BS='+FloatToStr(SkillNow));
CheckItem;
create(9001,8,PmArms);
Smelth(PmArms);
end;
116.4 ..118.8:
begin
AddToSystemJournal('BS='+FloatToStr(SkillNow));
CheckItem;
create(9001,11,PmLegs);
Smelth(PmLegs);
end;
118.9 ..120.0:
begin
AddToSystemJournal('BS='+FloatToStr(SkillNow));
CheckItem;
create(9001,12,PmTunics);
Smelth(PmTunics);
end
else AddToSystemJournal('Твои скилы за гранью возможного.');
end;
end;
end
else
AddToSystemJournal('Ваши возможности не удовлетворяют условиям скрипта. Читай комментарии в начале скрипта!!!');
if (GetSkillValue('Blacksmithing') = GetSkillCap('Blacksmithing')) then
Begin
AddToSystemJournal('BS='+FloatToStr(GetSkillCap('Blacksmithing'))) ;
AddToSystemJournal('Вы прокачали БС до вашего максимального значения этого скила.');
AddToSystemJournal('Скрипт разработал Раскин Игорь, при поддержке http://stealth.od.ua');
end;
end.