Yoko
http://forum.yoko.com.ua/

Ковка комплектов армора
http://forum.yoko.com.ua/viewtopic.php?f=20&t=17665
Page 1 of 1

Author:  kobol [ 2015-11-18 19:49:57 ]
Post subject:  Ковка комплектов армора

Code:
##################
# Black Smithing #
##################
# -------- из старого скрипта, который был взят за основу ^^ ------------------
# Ignots in the source. Smith hammer on the right hand.
# We're standing near a forge, which we'll target and
# near ingots. If you can't find ingots - ,set finddistance 10
# 21.12.06 .Tested on shard Dragon World
#------------------------------------------------------
# 2015.  переделан by Kobol
# инги лежат в мешке - клик на мешок - открылся - клик на инг
# берет инги в пак по весу и кует. Когда инги в паке кончаются - добирает по весу и снова кует до заполнения пака (255 итемов)
#
#
var clr=38, clo=2524, cly=53, clg=63, clb=3, cla=89, clda=83, clp=120 , clgr=1088, clw=1156, cldg=1162
###################################################
Sub PrintInColor(text,color)
   # см также функцию uo.charprint(color, text)
   #
   # PrintInColor("здесь текст",'цвет текста')
   # красный   - '38' или '0x0026'  # темно-бирюзовый - '83' или '0x0053'
   # оранжевый - '43' или '0x002B'  # голубой    - '89'  или '0x0059'
   # желтый    - '53' или '0x0035'  # синий      - '3'   или '0x0003'
   # зеленый   - '63' или '0x003F'  # фиолетовый - '120' или '0x0078'
   # '1088' - по умолчанию
   # 1152 - бирюзовый 1151 - черный 1155 - фиолетовый 1156 - белый  1158 - кр 1161 - синий 1162 - темно зел 1166 ткр 1169 свзел
   # 2500 2524 - оранж  2517 кр 2567 малин 2566=0x0A06 белый
   #  2998 - белый 3008  3600 и выше - контур   3221 - контрастный!!!
   UO.ConColor(color)
   ;UO.Exec('set quiet 0')   # Показывать сообщения Injection.
   UO.Print(text)
   ;UO.Exec('set quiet 1')   # Не показывать сообщения Injection.
   UO.ConColor('1088')
endsub
##########################################################
sub BSComplectMain()
   var IngType ;  Type of ignots to smith (0x1BEF)
   var IngColor;  Color of ingots to smith
   var IngName ; Name of ingot
   ;var Item=0x1410 ; Type of a produced item
   var  n, name ,KolvoPAckItems, KolvoItems
   ;var ingi='0x1BEF' ;тип ingi
   Var WeightLimit=uo.getMaxHP()*4 ; максимальный вес персонажа
   var KolvoIngi ; количество  ингов которые можно забрать в пак
   var InginPack ; количество ингов в паке
   
   UO.Print('Choose ingots container') ; мешок где лежат инги для ковки
   UO.Exec('addobject istok')
   while UO.Targeting()
      wait(200)
   wend
   UO.UseObject('istok')
   
   UO.Print('Choose ingot type') ; выбор ингов для ковки
   UO.Exec('addobject tovar')
   while UO.Targeting()
      wait(100)
   wend
   
   IngType = UO.GetGraphic('tovar')
   IngColor=uo.getcolor('tovar')
   IngName=getname('tovar')
   UO.Print('Ing color='+(IngColor))
   PrintInColor('Ing name='+IngName,IngColor) ; '!!!!!!
   
   ; расчет перекладываемого веса
   if IngColor=="0" and IngType=="0x1BEF" then
      KolvoIngi=Int((WeightLimit -uo.weight)/0.81) ; вес инга железа=0.6
   else
      KolvoIngi=Int((WeightLimit -uo.weight))/0.81 ; вес инга железа=0.6
   end if
   
   UO.FindType('-1','-1','-1') ; сколько вещей в паке изначально
   KolvoPAckItems=uo.GetQuantity('finditem')
   UO.Print('WeightLimit='+str(WeightLimit))
   UO.Print('Char weight='+str(uo.weight))
   UO.Print('Ing kolvo='+str(KolvoIngi))
   UO.Print('KolvoPAckItems='+str(KolvoPAckItems))
   ; перекладываем инги в пак с учетом веса
   UO.FindType(IngType,IngColor,'istok')
   If UO.FindCount() > 0 then ; если инги в мешке есть
      repeat ; цикл по всем ингам контенер <<<<<<<<<<<<<<<<<<<<<<
         UO.MoveItem('finditem',KolvoIngi , 'backpack') ; перемещаем заданное количество в пак
         wait(800)
         CheckLag()
         # начинаем ковать
         uo.FindType(IngType,IngColor,'backpack') ; ищем инги в паке
         InginPack=uo.GetQuantity('finditem')
         PrintInColor('InginPack='+str(InginPack),IngColor) ; '!!!!!!
         UO.Print('backPak FindCount='+str(uo.FindCount()))
         if  uo.FindCount() and (InginPack > 11) then
            repeat ; цикл по ингам в паке ==================
               uo.DeleteJournal()
               uo.print('Ing='+str(uo.GetQuantity('finditem')))
               
               PrintInColor('SkillVal='+str(uo.SkillVal('Blacksmithing',1)),2998) ; '!!!!!!
               
               if IngName=="Mytheril"  then
                  if uo.SkillVal('Blacksmithing',1) > 999 then
                     Complect(IngName)
#                    Gauntlets(IngName)
                  else
      PrintInColor('insufficient skill. Script terminated', clb)
                  end if
               end if
               if IngName=="Black Rock"  then
                  if uo.SkillVal('Blacksmithing',1) > 999 then
                     Complect(IngName)
                  else
      PrintInColor('insufficient skill. Script terminated', clb)
                  end if
               end if
               if  IngName=="Obsidian"  then
                  if uo.SkillVal('Blacksmithing',1) > 999 then
                     Complect(IngName)
                  else
      PrintInColor('insufficient skill. Script terminated', clb)
                  end if
               end if
               
             
               if  IngName=="Blood Rock"  then
                  if uo.SkillVal('Blacksmithing',1) > 979 then
                     Complect(IngName)
                     ;Gauntlets(IngName)
                  else
      PrintInColor('insufficient skill. Script terminated', clb)
                  end if
               end if
               if  IngName=="Verite"  then
                  if uo.SkillVal('Blacksmithing',1) > 984 then
                     Complect(IngName)
                  else
      PrintInColor('insufficient skill. Script terminated', clb)
                  end if
               end if

               if  IngName=="Valorite"  then
                  if uo.SkillVal('Blacksmithing',1) > 984 then
                     Complect(IngName)
                  else
      PrintInColor('insufficient skill. Script terminated', clb)
                  end if
               end if


               wait(100)
               UO.FindType('-1','-1','backpack') ; сколько всего вещей в паке
               wait(100)
               KolvoPAckItems=uo.GetQuantity('finditem')
               UO.Print('In pack items='+str(KolvoPAckItems))
               PrintInColor('>>> KolvoPAckItems='+str(uo.FindCount()),3221) ; '!!!!!!
               if uo.FindCount()>254 then
                  PrintInColor('!!! KolvoPAckItems='+str(uo.FindCount()),clr) ; '!!!!!!
                  return
               end if
               wait(200)
               uo.FindType(IngType,IngColor,'backpack') ; ищем инги в паке
            until not uo.FindCount() || uo.GetQuantity('finditem') < 12
            ; цикл по ингам в паке ==================
         else
         end if   
         UO.Print('Requare more ings. Take it from container')
         wait(100)
         KolvoIngi=Int((WeightLimit -uo.weight)/0.62) ; вес инга железа=0.6
         UO.Print('WeightLimit='+str(WeightLimit))
         UO.Print('Char weight='+str(uo.weight))
         UO.Print('KolvoIngi='+str(KolvoIngi))
         
         if KolvoIngi<20 then
           
            UO.Print('Ing quantity too small='+str(KolvoIngi))
            return
         end if
         
         UO.FindType('-1','-1','-1') ; сколько всего вещей в паке
         KolvoPAckItems=uo.GetQuantity('finditem')
         UO.Print('2: KolvoPAckItems='+str(KolvoPAckItems))
         PrintInColor('2: KolvoPAckItems='+str(uo.FindCount()),clo) ; '!!!!!!
         if KolvoPAckItems>254 then
            return
         end if
         KolvoItems=(255-KolvoPAckItems)
         UO.Print('Left place for Items='+str(KolvoItems))
         if KolvoIngi>KolvoItems*12 then
            KolvoIngi=KolvoItems*12
            UO.Print('2 -- KolvoIngi='+str(KolvoIngi))
           
         end if
         uo.ignorereset()
         UO.FindType(IngType,IngColor,'istok')
         UO.Print('Container Ing GetQuantity='+str(uo.GetQuantity('finditem')))
         UO.Print('Container Ing FindCount='+str(uo.FindCount()))
      until not uo.FindCount() ; || uo.GetQuantity('finditem') < 11 or
      ; цикл по всем ингам <<<<<<<<<<<<<<<<<<<<<<
   else
      PrintInColor('insufficient ingots in container. Script terminated', clb)
   end if
end sub

############################################################
sub Complect(IngName)

PlateHelm(IngName)
   checklag()
PlatemailGorget(IngName)
   checklag()
Gauntlets(IngName)
   checklag()
PlatemailLegs(IngName)
   checklag()
PlatemailArms(IngName)
   checklag()
Platemail(IngName)
   checklag()
HeaterShield(IngName)

end sub

############################################################
sub PlateHelm(IngName)

repeat
   PrintInColor('PlateHelm ='+IngName,clr) ; '!!!!!!
   uo.cancelmenu()
   wait (50)
   uo.automenu('Blacksmithing','Colored Armor & Weapons')
   wait (50)
   uo.automenu('Colored Armor & Weapons',IngName+' Armor')
   wait (50)
   uo.automenu(IngName+' Armor',IngName+' Plate Armor & Shields')
   wait (50)
   uo.automenu(IngName+' Plate Armor',IngName+' '+'Plate Helm')
   wait (150)
               uo.UseObject('finditem')
               wait (100)
               repeat
                  wait(400)
               until uo.InJournal('put') || uo.InJournal('fail')

if uo.InJournal('fail') then
wait(8500)
end if

wait(1500)

until uo.InJournal('put')

end sub

############################################################
sub PlatemailGorget(IngName)

      repeat

   PrintInColor('PlatemailGorget Ing name='+IngName,clr) ; '!!!!!!
   uo.cancelmenu()
   wait (50)
   uo.automenu('Blacksmithing','Colored Armor & Weapons')
   wait (50)
   uo.automenu('Colored Armor & Weapons',IngName+' Armor')
   wait (50)
   uo.automenu(IngName+' Armor',IngName+' Plate Armor & Shields')
   wait (50)
   uo.automenu(IngName+' Plate Armor',IngName+' '+'Platemail Gorget')
   wait (50)
#   checklag()
               uo.UseObject('finditem')
               wait (100)
               repeat
                  wait(400)
               until uo.InJournal('put') || uo.InJournal('fail')
if uo.InJournal('fail') then
wait(8500)
end if

wait(1500)
until uo.InJournal('put')

end sub

############################################################
sub Gauntlets(IngName)

  repeat

   PrintInColor('Gauntlets Ing name='+IngName,clr) ; '!!!!!!
   uo.cancelmenu()
   wait (50)
   uo.automenu('Blacksmithing','Colored Armor & Weapons')
   wait (50)
   uo.automenu('Colored Armor & Weapons',IngName+' Armor')
   wait (50)
   uo.automenu(IngName+' Armor',IngName+' Plate Armor & Shields')
   wait (50)
   uo.automenu(IngName+' Plate Armor',IngName+' '+'Platemail Gauntlets')
   wait (50)
#   checklag()
               uo.UseObject('finditem')
               wait (100)
               repeat
                  wait(400)
               until uo.InJournal('put') || uo.InJournal('fail')
if uo.InJournal('fail') then
wait(8500)
end if

wait(1500)
until uo.InJournal('put')

end sub

############################################################
sub PlatemailArms(IngName)

repeat
   PrintInColor('PlatemailArms Ing name='+IngName,clr) ; '!!!!!!
   uo.cancelmenu()
   wait (50)
   uo.automenu('Blacksmithing','Colored Armor & Weapons')
   wait (50)
   uo.automenu('Colored Armor & Weapons',IngName+' Armor')
   wait (50)
   uo.automenu(IngName+' Armor',IngName+' Plate Armor & Shields')
   wait (50)
   uo.automenu(IngName+' Plate Armor',IngName+' '+'Platemail Arms')
   wait (50)
#   checklag()
               uo.UseObject('finditem')
               wait (100)
               repeat
                  wait(400)
               until uo.InJournal('put') || uo.InJournal('fail')

if uo.InJournal('fail') then
wait(8500)
end if

wait(1500)
until uo.InJournal('put')
wait(500)

end sub

############################################################
sub PlatemailLegs(IngName)

               repeat

   PrintInColor('PlatemailLegs Ing name='+IngName,clr) ; '!!!!!!
   uo.cancelmenu()
   wait (50)
   uo.automenu('Blacksmithing','Colored Armor & Weapons')
   wait (50)
   uo.automenu('Colored Armor & Weapons',IngName+' Armor')
   wait (50)
   uo.automenu(IngName+' Armor',IngName+' Plate Armor & Shields')
   wait (50)
   uo.automenu(IngName+' Plate Armor',IngName+' '+'Platemail Legs')
   wait (50)
#   checklag()
               uo.UseObject('finditem')
               wait (100)
               repeat
                  wait(400)
               until uo.InJournal('put') || uo.InJournal('fail')
if uo.InJournal('fail') then
wait(8500)
end if

wait(1500)
until uo.InJournal('put')

end sub

############################################################
sub Platemail(IngName)
               repeat
   PrintInColor('Platemail Ing name='+IngName,clr) ; '!!!!!!
   uo.cancelmenu()
   wait (50)
   uo.automenu('Blacksmithing','Colored Armor & Weapons')
   wait (50)
   uo.automenu('Colored Armor & Weapons',IngName+' Armor')
   wait (50)
   uo.automenu(IngName+' Armor',IngName+' Plate Armor & Shields')
   wait (50)
   uo.automenu(IngName+' Plate Armor',IngName+' '+'Platemail (')
   wait (50)
#   checklag()
               uo.UseObject('finditem')
               wait (100)
               repeat
                  wait(400)
               until uo.InJournal('put') || uo.InJournal('fail')
if uo.InJournal('fail') then
wait(8500)
end if

wait(1500)
until uo.InJournal('put')

end sub

############################################################
sub HeaterShield(IngName)
repeat

   PrintInColor('HeaterShield Ing name='+IngName,2567) ; '!!!!!!
   uo.cancelmenu()
   wait (150)
   uo.automenu('Blacksmithing','Colored Armor & Weapons')
   wait (150)
   uo.automenu('Colored Armor & Weapons',IngName+' Armor')
   wait (150)
   uo.automenu(IngName+' Armor',IngName+' Plate Armor & Shields')
   wait (250)
   uo.automenu(IngName+' Plate Armor',IngName+' '+'Heater Shield (')
#   uo.automenu(IngName+' Plate Armor', 3)
# 1 -helm
# 2 -рукавицы
# 4 -metal shield
# 5 -helm
# 8 -arms
# 10 -gorget
# 14 -metal shield
# 18 -arms
# 20 -legs
# 12 -рукавицы

   wait (50)
#   checklag()
               uo.UseObject('finditem')
               wait (100)
               repeat
                  wait(400)
               until uo.InJournal('put') || uo.InJournal('fail')
if uo.InJournal('fail') then
wait(8500)
end if

wait(1500)
until uo.InJournal('put')
   uo.cancelmenu()

end sub


############################################
sub CheckLag()
   repeat
      UO.DeleteJournal()
      UO.Click('backpack')
   until backpack()==1
endsub
############################################
sub backpack()
   var n
   for n=0 to 200
      if uo.injournal('a backpack') then
         return 1
      endif
      wait(200)
   next
endsub
############################################
sub pereklad()
   #****ДРВ*****#
   # (C) Cooper
   #****v1.0****#
   VAR IngType
   UO.Print('Выбери мешок с ингами')
   UO.Exec('addobject istok')
   while UO.Targeting()
      wait(100)
   wend
   UO.UseObject('istok')
   UO.Print('Выбери ПРИЕМНИК')
   UO.Exec('addobject priem')
   while UO.Targeting()
      wait(100)
   wend
   UO.Print('Выбери ТОВАР')
   UO.Exec('addobject tovar')
   while UO.Targeting()
      wait(100)
   wend
   IngType = UO.GetGraphic('tovar')
   UO.FindType(IngType,'-1','istok')
   If UO.FindCount() > 0 then
     
      repeat
         UO.MoveItem('finditem', '0', 'priem')
         wait(800)
         CheckLag()
         UO.FindType(IngType,'-1','istok')
      until not UO.FindCount()
     
      UO.Print('Закончили...')
   else
      UO.Print('А кидать то нечего...')
   endif
end sub
####################################
sub getname(ingi)
   var n, c, t
   Dim name[27]
   name[1]=''
   name[2]='Rusty'
   name[3]='Old Copper'
   name[4]='Dull Copper'
   name[5]='Bronze'
   name[6]='Shadow'
   name[7]='Rose'
   name[8]='Agapite'
   name[9]='Blood Rock'
   name[10]='Verite'
   name[11]='Valorite'
   name[12]='Mytheril'
   name[13]='Black Rock'
   name[14]='Obsidian'
   name[15]='Plutonium'
   name[16]='Vulcan'
   name[17]='Aqua'
   name[18]='Eldar'
   name[19]='Elvin'
   name[20]='Acid'
   name[21]='Steel'
   name[22]='Sand Rock'
   name[23]='Blood Crest'
   name[24]='Gorgan'
   name[25]='Krynite'
   name[26]='Crystaline'
   name[27]='Dragon'
   
Dim col[27] ; список цветов
   col[1]='0x0000'
   col[2]='0x0750'
   col[3]='0x0590'
   col[4]='0x060A'
   col[5]='0x0488'
   col[6]='0x096B'
   col[7]='0x0014'
   col[8]='0x0193'
   col[9]='0x04C2'
   col[10]='0x07D5'
   col[11]='0x00CE'
   col[12]='0x052D'
   col[13]='0x0455'
   col[14]='0x0028'
   col[15]='0x08AF'
   col[16]='0x09DA'
   col[17]='0x0060'
   col[18]='0x0BA7'
   col[19]='0x09E6'
   col[20]='0x09B9'
   col[21]='0x09D3'
   col[22]='0x008F'
   col[23]='0x09EC'
   col[24]='0x09F0'
   col[25]='0x010F'
   col[26]='0x09A4'
   col[27]='0x0085'
   Dim typ[3]
   typ[1]='0x1BE3'
   typ[2]='0x1BF5'
   typ[3]='0x1BE9'
   Dim nam[3]
   nam[1]='Copper'
   nam[2]='Silver'
   nam[3]='Golden'
   t=uo.getgraphic(ingi)
   c=uo.getcolor(ingi)
   for n=1 to 3
      if typ[n]==t then
         return nam[n]
      endif
   next
   for n=2 to 27
      if col[n]==c then
         return name[n]
      endif
   next
endsub


Page 1 of 1 All times are UTC+02:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/