Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

Blacksmithing RunUO

Only working scripts
Post Reply
shinma
Expert
Expert
Posts: 505
Joined: 28.04.2011 12:05

Blacksmithing RunUO

Post by shinma »

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.
--->>>ПОИСК ПО ФОРУМУ, НАЧНИ С НЕГО!!!<<<---
--->>>Search the forum, start with him!!!<<<---
95% Ваших вопросов уже кем-то написаны и решены.
buran
Posts: 6
Joined: 06.12.2015 0:04

Re: Blacksmithing RunUO

Post by buran »

Подскажите как узнать гамп переплавки, все поменял только что ставить вместо "7000" не знаю, и как посмотреть тоже не знаю( Подскажите пожалуйста.
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: Blacksmithing RunUO

Post by Vizit0r »

buran wrote:Подскажите как узнать гамп переплавки, все поменял только что ставить вместо "7000" не знаю, и как посмотреть тоже не знаю( Подскажите пожалуйста.
самый простой путь - через клиент использовать команду infogump - она показывает все о текущем гампе и айди нажатой кнопки с предыдущего гампа.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
buran
Posts: 6
Joined: 06.12.2015 0:04

Re: Blacksmithing RunUO

Post by buran »

Code: Select all

Serial: 3812797
GumpID: F22EE4C6
X: 0000
Y: 0000
Pages: 2
Gump Options: NoDispose NoClose NoResize

ResizePics: X   Y   ID   Width   Height   Page   ElemNum
0   ResizePic: 0  28  9200  636  28  1  4
1   ResizePic: 0  28  9200  30  27  2  19

GumpTexts: X   Y   Color   Text_ID   Page   ElemNum
0   GumpText: 48  32  569  0  1  12
1   GumpText: 156  32  684  1  1  13
2   GumpText: 258  32  684  2  1  14
3   GumpText: 380  32  684  3  1  15
4   GumpText: 482  32  684  4  1  16
5   GumpText: 584  32  684  5  1  17

Text Lines:
Make Donate
My Character
Server Status
Web Site
Statistics
MSG

GumpButtons: X   Y   Released_ID  Pressed_ID   Quit   Page_ID   Return_value   Page   ElemNum
0   GumpButton: 5  31  5540  5541  0  2  0  1  5
1   GumpButton: 30  31  2445  2445  1  0  1  1  6
2   GumpButton: 138  31  2445  2445  1  0  2  1  7
3   GumpButton: 246  31  2445  2445  1  0  3  1  8
4   GumpButton: 354  31  2445  2445  1  0  4  1  9
5   GumpButton: 462  31  2445  2445  1  0  5  1  10
6   GumpButton: 570  31  2443  2443  1  0  6  1  11
7   GumpButton: 5  31  5537  5537  0  1  0  2  20

Previous gump reply:
  Button id: 14
неужели 14 надо поставить вместо 7000
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: Blacksmithing RunUO

Post by Vizit0r »

ну если ты в прошлом гампе нажал на нужную кнопку, а потом написал инфогамп - то да, 14.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
buran
Posts: 6
Joined: 06.12.2015 0:04

Re: Blacksmithing RunUO

Post by buran »

эх, а я думал это не правильно гамп считывает( спасибо )
Post Reply