Code: Select all
Program bowcraft;
//Made by Shinma
//Iron Ingot должны лежать в сумке у персонажа, хотябы 1 тинкер тулс должен лежать в сумке.Доски лежат в сундуке. чар должен стоять рядом с этим сундуком. прописываем сундук с досками. возле чара должна стоять мусорка, куда он будет выбрасывать весь скрафченный материал.
const
fletching=$1022 ;
TinkerTool=$1EB8 ;
ingot=$1BF2 ;
boards=$1BD7 ;
IDbox=$400FA130 ;
trashbarrel=$401D526A;
Bows=$13B2; // 35 - 55
FukiyaDarts=$2806 ; // 55 - 60
Crossbows=$0F50; //60 - 70
CompositeBows=$26C2 ; //70 - 80
HeavyCrossbows=$13FD ; //80 - 90
RepeatingCrossbows=$26C3; //90 - 100
var
i:integer;
SkillNow: Double;
agump:Word;
procedure Init;
begin
SetPauseScriptOnDisconnectStatus(True);
SetARStatus(True);
if not Connected then Connect;
wait(5000);
end;
Procedure CheckTinkerTools;
begin
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;
end;
Procedure Checkfletching;
begin
checklag(50000);
while (count(fletching) <5) and (count(ingot) >3) do
begin
for i:=0 to GetGumpsCount do
begin
wait(500);
CloseSimpleGump(i);
end;
agump := GetGumpsCount;
checklag(50000);
CheckTinkerTools;
UseObject(FindType(TinkerTool,Backpack));
wait(1000);
while agump = GetGumpsCount do
Wait(60);
NumGumpButton(GetGumpsCount-1,9002);
wait(600);
NumGumpButton(GetGumpsCount-1,28);
AddToSystemJournal('Скрафтил fletching');
wait(5000);
end;
end;
Procedure Trash(Musor:word;kolvo:integer);
begin
findtype(Musor,backpack);
if findcount >= kolvo then
begin
while findcount > 0 do
begin
checklag(60000);
moveitem(findtype(Musor,backpack),1,trashbarrel,0,0,0);
findtype(Musor,backpack);
wait(400);
end
end;
end;
procedure checkboards(kolvoboards:integer);
begin
if (Count(boards) < kolvoboards) then
begin
repeat
checklag(60000);
UseObject(IDbox);
wait(1000);
MoveItem(FindTypeEx(boards,$FFFF,IDbox,False),kolvoboards,Backpack,0,0,0);
Wait(1000);
until (Count(boards) >= kolvoboards);
FindTypeEx(boards,$FFFF,IDbox,False);
Addtosystemjournal('Досок в сундуке осталось - '+intToStr(findfullquantity));
end;
end;
procedure create(BtRz,BtIt,kolvoboards:integer;TpItem:word);
var
aa : TClilocRec;
bb : TClilocItemRec;
OldSkill : Double;
checkW:integer;
begin
OldSkill := GetSkillValue('Bowcraft');
aa := GetToolTipRec(backpack);
bb := aa.Items[1];
while (count(fletching)>0) and (strtoint(bb.Params[0])<123) and (GetSkillValue('Bowcraft') = OldSkill) and not dead and (count(boards)>=kolvoboards) do
begin
for i:=0 to GetGumpsCount do
begin
wait(500);
CloseSimpleGump(i);
end;
agump := GetGumpsCount;
checklag(50000);
CheckTinkerTools;
Checkfletching;
UseObject(FindType(fletching,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])<123) and (GetSkillValue('Bowcraft') = OldSkill) and IsObjectExists(FindItem) and (count(boards)>=kolvoboards) do
begin
checklag(50000);
WaitGump('1999');
Wait(700);
aa := GetToolTipRec(backpack);
bb := aa.Items[1];
checkW:=checkW+1;
if checkW = 20 then
begin
CheckTinkerTools;
Checkfletching;
UseObject(FindType(fletching,Backpack));
checkW:=0;
end;
end;
if (GetSkillValue('Bowcraft') <> OldSkill) then AddToSystemJournal('Bowcraft='+FloatToStr(GetSkillValue('Bowcraft')));
for i:=0 to GetGumpsCount do
begin
wait(500);
CloseSimpleGump(i);
end;
aa := GetToolTipRec(backpack);
bb := aa.Items[1];
end
end;
begin
Init;
CheckTinkerTools;
Checkfletching;
AddToSystemJournal('Bowcraft='+FloatToStr(GetSkillValue('Bowcraft')));
if (GetSkillValue('Bowcraft')>=30) and (GetSkillValue('Tinkering')>=30) and not dead then
begin
while not dead and (GetSkillValue('Bowcraft')<GetSkillCap('Bowcraft'))do
begin
SkillNow:=GetSkillValue('Bowcraft');
case SkillNow of
35,0 ..60,0:
begin
checkboards(70);
Trash(FukiyaDarts,1);
Trash(Bows,40);
create(9003,6,7,Bows);
Trash(Bows,40);
end;
{55,1 ..60,0:
begin
checkboards(1);
Trash(Bows,1);
Trash(FukiyaDarts,50);
create(9002,5,1,FukiyaDarts);
Trash(FukiyaDarts,50);
end;}
60,1 ..70,0:
begin
checkboards(700);
Trash(Bows,1);
Trash(Crossbows,40);
create(9003,7,7,Crossbows);
Trash(Crossbows,40);
end;
70,1 ..80,0:
begin
checkboards(700);
Trash(Crossbows,1);
Trash(CompositeBows,40);
create(9003,9,7,CompositeBows);
Trash(CompositeBows,40);
end;
80,1 ..90,0:
begin
checkboards(1000);
Trash(CompositeBows,1);
Trash(HeavyCrossbows,40);
create(9003,8,10,HeavyCrossbows);
Trash(HeavyCrossbows,40);
end;
90,1 ..100,0:
begin
checkboards(1000);
Trash(HeavyCrossbows,1);
Trash(RepeatingCrossbows,40);
create(9003,10,10,RepeatingCrossbows);
Trash(RepeatingCrossbows,40);
end
else AddToSystemJournal('Твои скилы за гранью возможного.');
end;
end;
end
else
AddToSystemJournal('Ваши возможности не удовлетворяют условиям скрипта. Читай комментарии в начале скрипта!!!');
Trash(RepeatingCrossbows,1);
end.