Need Help Plzz Black Smithing

Ask for scripts here

Moderators: Murderator+, Murderator

Post Reply
kahe
Posts: 25
Joined: 2009-11-14 12:48:27

Need Help Plzz Black Smithing

Post by kahe »

Парни будьте добры помогите в скрипте исправить в место даггера шлем и только цветные не из аирона,сутки кавыряю и одни ошибки....скрипт интересный не риально путаюсь в постановке

##################
# Black Smithing #
##################
#
# Ignots on the ground. 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
# When a quantity of produced item more than 20 -smelthing
# for ingots.
# 21.12.06 .Tested on shard Dragon World
#
var kls=0
var Container='0x4015AEFA' ;Сундук с ингами
var Containerb='0x4015AEFA' ;Сундук с багами
var Unload='0x404D578E' ;Куда все кидать
var CountIng=100 ; Сколько ингов брать
var meshok='0x0E76' ;Тип бага)
var smeshok

sub main()
var Exit=0, LastTimer
uo.useobject(Container)
wait(500)
uo.useobject(Containerb)
wait(500)
uo.useobject(Unload)
wait(500)
var MenuIron="'Blacksmithing' 'Weapons'"
var MenuOther="'Colored' 'Weapons'"
var MenuSwords="Weapons' 'Swords'"
var MenuDagger="'Swords' 'Dagger'"
var MenuDagger1="'Swords' 'dagger'"

var i=0

dim ColorOfIng[10]
dim NameOre[10]
dim TypeOre[10]

NameOre[0]="'"
NameOre[1]="'Rusty "
NameOre[2]="'Old Copper "
NameOre[3]="'Dull Copper "
NameOre[4]="'Copper "
NameOre[5]="'Bronze "
NameOre[6]="'Silver "
NameOre[7]="'Shadow "
NameOre[8]="'Agapite "
NameOre[9]="'Rose "
NameOre[10]="'Blood Rock "

TypeOre[0]='0x1BEF' ; Iron
TypeOre[1]='0x1BEF' ; Rusty
TypeOre[2]='0x1BEF' ; Old Copper
TypeOre[3]='0x1BEF' ; Dull Copper
TypeOre[4]='0x1BE3' ; Copper
TypeOre[5]='0x1BEF' ; Bronze
TypeOre[6]='0x1BF5' ; Silver
TypeOre[7]='0x1BEF' ; Shadow
TypeOre[8]='0x1BEF' ; Agarite
TypeOre[9]='0x1BEF' ; Rose
TypeOre[10]='0x1BEF' ; Blood rock


ColorOfIng[0]='0x0000' ; Iron
ColorOfIng[1]='0x0750' ; Rusty
ColorOfIng[2]='0x0590' ; Old Copper
ColorOfIng[3]='0x060A' ; Dull Copper
ColorOfIng[4]='0x0000' ; Copper
ColorOfIng[5]='0x0488' ; Bronze
ColorOfIng[6]='0x0000' ; Silver
ColorOfIng[7]='0x096B' ; Shadow
ColorOfIng[8]='0x0193' ; Agarite
ColorOfIng[9]='0x0014' ; Rose
ColorOfIng[10]='0x04C2' ; Blood Rock

while not uo.dead()

for i=0 to 9
checklags()
uo.FindType(TypeOre[i],ColorOfIng[i],Container)
if uo.GetQuantity('finditem') > 10 then
uo.cancelmenu()
if i == 0 then
uo.Exec('automenu '+MenuDagger1)
else
uo.Exec('automenu '+MenuDagger)
endif
uo.Exec('automenu '+NameOre[i]+MenuSwords)
if i>0 Then
uo.Exec('automenu '+MenuOther)
end if
uo.Exec('automenu '+MenuIron)
bs(TypeOre[i],ColorOfIng[i],NameOre[i])
endif
next



wend
end sub


sub bs(IngType,IngColor,NameOre)
var ext=0,vs,c=0

while ext <> 1
if kls == 0 then
checklags()
UO.UnSetCatchBag()
UO.SetCatchBag(Unload)
wait(1000)
UO.FindType( meshok, -1, Containerb )
if uo.FindCount() > 0 then
UO.Grab('1','finditem')
wait(1000)
smeshok=UO.GetSerial('finditem')
UO.UnSetCatchBag()
wait(1000)
UO.SetCatchBag(smeshok)
else
uo.print("Закончились мешки конец")
uo.exec("terminate all")
endif
kls=kls+1
wait(500)
end if

uo.FindType(IngType,IngColor,'backpack')
if uo.GetQuantity('finditem') < 10 then
checklags()
UO.UnSetCatchBag()
wait(1000)
GetItem(IngType,IngColor,CountIng,Container,'backpack')
uo.FindType(IngType,IngColor,'backpack')
if uo.GetQuantity('finditem') < 10 then
ext=1
wait(500)
uo.print('Закончились '+NameOre+' инги берем другие')
GetItem(IngType,IngColor,'all','backpack',Container)
else
uo.print('Взяли ' + Str( UO.Count( IngType ) ) + ' ингов')
end if
UO.SetCatchBag(smeshok)
wait(1000)
end if

uo.DeleteJournal()
if ext <> 1 then
checklags()
uo.UseType(IngType)
repeat
wait(500)
until uo.InJournal('put') OR uo.InJournal('fail')
endif

if uo.InJournal('put') then
checklags()
kls=kls+1
wait(500)
if kls == 256 then
kls=0
end if
end if
UO.Print('Осталось: ' + Str( UO.Count( IngType ) ) + ' ингов, сделано '+str(kls-1)+' дагеров' )



c=c+1
if c==3 then
c=0
repeat
wait(100)
end if


wend
end sub

###########
# GetItem #
###########

sub GetItem(type, color, quantity, where , to)
uo.FindType(type,color,where)
if uo.FindCount() then
uo.moveitem('finditem',quantity,to)
wait(750)
else
return false
endif
end sub

sub checklags()
UO.DeleteJournal()
UO.Click('backpack')

Repeat
wait(500)
Until UO.InJournal('backpack')


end sub


Буду От Всей Души БЛАГОДАРЕН
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Need Help Plzz Black Smithing

Post by Mirage »

1)var Menu... прописываешь как до шлема
2)for i=0 to 9 заменить на for i=1 to 10
3)расставить отступы и заключить в код
4) чеж тут интересного? :lol:
kahe
Posts: 25
Joined: 2009-11-14 12:48:27

Re: Need Help Plzz Black Smithing

Post by kahe »

[quote="Mirage"]1)var Menu... прописываешь как до шлема
2)for i=0 to 9 заменить на for i=1 to 10
3)расставить отступы и заключить в код
4) чеж тут интересного? :lol:[/qu
теперь он делать делает но продолжать нехочит т.е. взял 100 ингов перекувал и остановился

var MenuIron="'Blacksmithing' 'Colored Armor'"
var MenuOther="'Colored Armor' 'Armor'"
var MenuWeapons="Armor' 'Plate Armor'"
var MenuDagger="'Plate Armor' 'Plate Helm'"
var MenuDagger1="'Plate Armor' 'Plate Helm'"

var i=0

dim ColorOfIng[10]
dim NameOre[10]
dim TypeOre[10]

NameOre[0]="'"
NameOre[1]="'Rusty "
NameOre[2]="'Old Copper "
NameOre[3]="'Dull Copper "
NameOre[4]="'Copper "
NameOre[5]="'Bronze "
NameOre[6]="'Silver "
NameOre[7]="'Shadow "
NameOre[8]="'Agapite "
NameOre[9]="'Rose "
NameOre[10]="'Blood Rock "

TypeOre[0]='0x1BEF' ; Iron
TypeOre[1]='0x1BEF' ; Rusty
TypeOre[2]='0x1BEF' ; Old Copper
TypeOre[3]='0x1BEF' ; Dull Copper
TypeOre[4]='0x1BE3' ; Copper
TypeOre[5]='0x1BEF' ; Bronze
TypeOre[6]='0x1BF5' ; Silver
TypeOre[7]='0x1BEF' ; Shadow
TypeOre[8]='0x1BEF' ; Agarite
TypeOre[9]='0x1BEF' ; Rose
TypeOre[10]='0x1BE9' ; Gold


ColorOfIng[0]='0x0000' ; Iron
ColorOfIng[1]='0x0750' ; Rusty
ColorOfIng[2]='0x0590' ; Old Copper
ColorOfIng[3]='0x060A' ; Dull Copper
ColorOfIng[4]='0x0000' ; Copper
ColorOfIng[5]='0x0488' ; Bronze
ColorOfIng[6]='0x0000' ; Silver
ColorOfIng[7]='0x096B' ; Shadow
ColorOfIng[8]='0x0193' ; Agarite
ColorOfIng[9]='0x0014' ; Rose
ColorOfIng[10]='0x04C2' ; Blood Rock

while not uo.dead()

for i=1 to 10
checklags()
uo.FindType(TypeOre[i],ColorOfIng[i],Container)
if uo.GetQuantity('finditem') > 10 then
uo.cancelmenu()
if i == 1 then
uo.Exec('automenu '+MenuDagger1)
else
uo.Exec('automenu '+MenuDagger)
endif
uo.Exec('automenu '+NameOre[i]+MenuWeapons)
if i>0 Then
uo.Exec('automenu '+MenuOther)
end if
uo.Exec('automenu '+MenuIron)
bs(TypeOre[i],ColorOfIng[i],NameOre[i])
endif
next



wend
end sub
kahe
Posts: 25
Joined: 2009-11-14 12:48:27

Re: Need Help Plzz Black Smithing

Post by kahe »

Кое как но работает)

##################
# Black Smithing #
##################
#
# Ignots on the ground. 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
# When a quantity of produced item more than 20 -smelthing
# for ingots.
# 21.12.06 .Tested on shard Dragon World
#
var kls=0
var Container='0x4015AEFA' ;Сундук с ингами
var Containerb='0x4015AEFA' ;Сундук с багами
var Unload='0x404D578E' ;Куда все кидать
var CountIng=500 ; Сколько ингов брать
var meshok='0x0E76' ;Тип бага)
var smeshok

sub main()
var Exit=0, LastTimer
uo.useobject(Container)
wait(500)
uo.useobject(Containerb)
wait(500)
uo.useobject(Unload)
wait(500)
var Menuing="'Blacksmithing' 'Colored Armor'"
var MenuOther="'Colored Armor' 'Armor'"
var MenuArmor="Armor' 'Plate Armor'"
var MenuHelm="'Plate Armor' 'Plate Helm'"
var MenuHelm1="'Plate Armor' 'Plate Helm'"

var i=1

dim ColorOfIng[10]
dim NameOre[10]
dim TypeOre[10]

NameOre[0]="'"
NameOre[1]="'Rusty "
NameOre[2]="'Old Copper "
NameOre[3]="'Dull Copper "
NameOre[4]="'Copper "
NameOre[5]="'Bronze "
NameOre[6]="'Silver "
NameOre[7]="'Shadow "
NameOre[8]="'Agapite "
NameOre[9]="'Rose "
NameOre[10]="'Blood Rock "

TypeOre[0]='0x1BEF' ; Iron
TypeOre[1]='0x1BEF' ; Rusty
TypeOre[2]='0x1BEF' ; Old Copper
TypeOre[3]='0x1BEF' ; Dull Copper
TypeOre[4]='0x1BE3' ; Copper
TypeOre[5]='0x1BEF' ; Bronze
TypeOre[6]='0x1BF5' ; Silver
TypeOre[7]='0x1BEF' ; Shadow
TypeOre[8]='0x1BEF' ; Agarite
TypeOre[9]='0x1BEF' ; Rose
TypeOre[10]='0x1BE9' ; Gold


ColorOfIng[0]='0x0000' ; Iron
ColorOfIng[1]='0x0750' ; Rusty
ColorOfIng[2]='0x0590' ; Old Copper
ColorOfIng[3]='0x060A' ; Dull Copper
ColorOfIng[4]='0x0000' ; Copper
ColorOfIng[5]='0x0488' ; Bronze
ColorOfIng[6]='0x0000' ; Silver
ColorOfIng[7]='0x096B' ; Shadow
ColorOfIng[8]='0x0193' ; Agarite
ColorOfIng[9]='0x0014' ; Rose
ColorOfIng[10]='0x04C2' ; Blood Rock

while not uo.dead()

for i=0 to 9
checklags()
uo.FindType(TypeOre[i],ColorOfIng[i],Container)
if uo.GetQuantity('finditem') > 10 then
uo.cancelmenu()
if i == 1 then
uo.Exec('automenu '+MenuHelm1)
else
uo.Exec('automenu '+MenuHelm)
endif
uo.Exec('automenu '+NameOre[i]+MenuArmor)
if i>0 Then
uo.Exec('automenu '+MenuOther)
end if
uo.Exec('automenu '+Menuing)
bs(TypeOre[i],ColorOfIng[i],NameOre[i])
endif
next



wend
end sub


sub bs(IngType,IngColor,NameOre)
var ext=0,vs,c=0

while ext <> 1
if kls == 0 then
checklags()
UO.UnSetCatchBag()
UO.SetCatchBag(Unload)
wait(1000)
UO.FindType( meshok, -1, Containerb )
if uo.FindCount() > 0 then
UO.Grab('1','finditem')
wait(1000)
smeshok=UO.GetSerial('finditem')
UO.UnSetCatchBag()
wait(1000)
UO.SetCatchBag(smeshok)
else
uo.print("Bags have ended")
uo.exec("terminate all")
endif
kls=kls+1
wait(500)
end if

uo.FindType(IngType,IngColor,'backpack')
if uo.GetQuantity('finditem') < 10 then
checklags()
UO.UnSetCatchBag()
wait(1000)
GetItem(IngType,IngColor,CountIng,Container,'backpack')
uo.FindType(IngType,IngColor,'backpack')
if uo.GetQuantity('finditem') < 10 then
ext=1
wait(500)
uo.print('Ended '+NameOre+' We take others ingots')
GetItem(IngType,IngColor,'all','backpack',Container)
else
uo.print('Take ' + Str( UO.Count( IngType ) ) + ' ingots')
end if
UO.SetCatchBag(smeshok)
wait(1000)
end if

uo.DeleteJournal()
if ext <> 1 then
checklags()
uo.UseType(IngType)
repeat
wait(500)
until uo.InJournal('put') OR uo.InJournal('fail')
endif

if uo.InJournal('put') then
checklags()
kls=kls+1
wait(500)
if kls == 256 then
kls=0
end if
end if
UO.Print('There were: ' + Str( UO.Count( IngType ) ) + ' ingots, make '+str(kls-1)+' helmets' )



c=c+1
if c==3 then
c=0
repeat
wait(10)
end if


wend
end sub

###########
# GetItem #
###########

sub GetItem(type, color, quantity, where , to)
uo.FindType(type,color,where)
if uo.FindCount() then
uo.moveitem('finditem',quantity,to)
wait(750)
else
return false
endif
end sub

sub checklags()
UO.DeleteJournal()
UO.Click('backpack')

Repeat
wait(500)
Until UO.InJournal('backpack')


end sub

sub hide()
while not UO.Hidden()
UO.Warmode("0")
UO.UseSkill("Hiding")
wait(4000)
wend
end sub
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Need Help Plzz Black Smithing

Post by Mirage »

в скрипте найди строку if uo.GetQuantity('finditem') знак 10
и замени на
if uo.GetQuantity('finditem') знак 25
для шлема надо минимум 25 ингов. надо чтобы срабатывала бралка при менее 25 ингов
kahe
Posts: 25
Joined: 2009-11-14 12:48:27

Re: Need Help Plzz Black Smithing

Post by kahe »

Понял!но что-то как я понял...из разной руды поразному идёт путь до шлема и он кует только с теми которая совпадает...и как я понял что походу надо делать к каждой руде свой скрипт потому как я не могу их вместе сложить
rus_lan
Posts: 24
Joined: 2010-06-07 07:54:20

Re: Need Help Plzz Black Smithing

Post by rus_lan »

а как сделать чтоб он все инги брал а не заданное кол-во?
var CountIng=500 ##-1?
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Need Help Plzz Black Smithing

Post by Mirage »

rus_lan wrote:а как сделать чтоб он все инги брал а не заданное кол-во?
var CountIng=500 ##-1?

либо -1 либо 0 либо 9999999999999999

Но обычно грузоподъемности чара хватает на пару сотен слитков. Зачем брать ВСЕ?
rus_lan
Posts: 24
Joined: 2010-06-07 07:54:20

Re: Need Help Plzz Black Smithing

Post by rus_lan »

я для общего развития спросил)
user-drw
Posts: 5
Joined: 2011-03-22 09:06:03

Re: Need Help Plzz Black Smithing

Post by user-drw »

Сделайте что бы Legs делал
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Need Help Plzz Black Smithing

Post by Mirage »

меню и тип поменяй. Руки то есть.
user-drw
Posts: 5
Joined: 2011-03-22 09:06:03

Re: Need Help Plzz Black Smithing

Post by user-drw »

Mirage wrote:меню и тип поменяй. Руки то есть.


Меню менял, но ничего не делает.

Где в скрипте тип менять?
Тип шлема не упоминаеться в скрипте.
помогите пож, делать ноги армора.
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Need Help Plzz Black Smithing

Post by Mirage »

первоначальный скрипт был неправильно кастрирован. В оригинале чар ел и качал спирит спик. После редактирования остался не закрытым цыкл => частые краши скирпта.

БОЛЕЕ рабочая версия ПЕРВОГО скрипта выглядит вот так:

Code: Select all

var kls=0
var Container='0x4015AEFA' ;Сундук с ингами
var Containerb='0x4015AEFA' ;Сундук с багами
var Unload='0x404D578E' ;Куда все кидать
var Quantity = 10 ; минимальное количество слитков.
var CountIng=200 ; Сколько ингов брать
var meshok='0x0E76' ; Тип сумки
var smeshok
sub main()
   var Exit=0, LastTimer
   uo.useobject(Container)
   wait(500)
   uo.useobject(Containerb)
   wait(500)
   uo.useobject(Unload)
   wait(500)
   #####################
   var MenuIron="'Blacksmithing' 'Weapons'"
   var MenuOther="'Colored' 'Weapons'"
   var MenuSwords="Weapons' 'Swords'"
   var MenuDagger="'Swords' 'Dagger'"
   var MenuDagger1="'Swords' 'dagger'"
   #####################
   var i=0
   dim ColorOfIng[11]
   dim NameOre[11]
   dim TypeOre[11]

   NameOre[0]="Iron"
   NameOre[1]="Rusty "
   NameOre[2]="Old Copper "
   NameOre[3]="Dull Copper "
   NameOre[4]="Copper "
   NameOre[5]="Bronze "
   NameOre[6]="Silver "
   NameOre[7]="Shadow "
   NameOre[8]="Agapite "
   NameOre[9]="Rose "
   NameOre[10]="Blood Rock "

   TypeOre[0]='0x1BEF' ; Iron
   TypeOre[1]='0x1BEF' ; Rusty
   TypeOre[2]='0x1BEF' ; Old Copper
   TypeOre[3]='0x1BEF' ; Dull Copper
   TypeOre[4]='0x1BE3' ; Copper
   TypeOre[5]='0x1BEF' ; Bronze
   TypeOre[6]='0x1BF5' ; Silver
   TypeOre[7]='0x1BEF' ; Shadow
   TypeOre[8]='0x1BEF' ; Agarite
   TypeOre[9]='0x1BEF' ; Rose
   TypeOre[10]='0x1BEF' ; Blood rock

   ColorOfIng[0]='0x0000' ; Iron
   ColorOfIng[1]='0x0750' ; Rusty
   ColorOfIng[2]='0x0590' ; Old Copper
   ColorOfIng[3]='0x060A' ; Dull Copper
   ColorOfIng[4]='0x0000' ; Copper
   ColorOfIng[5]='0x0488' ; Bronze
   ColorOfIng[6]='0x0000' ; Silver
   ColorOfIng[7]='0x096B' ; Shadow
   ColorOfIng[8]='0x0193' ; Agarite
   ColorOfIng[9]='0x0014' ; Rose
   ColorOfIng[10]='0x04C2' ; Blood Rock

   while not uo.dead()
      for i=0 to 11
         checklags()
         uo.FindType(TypeOre[i],ColorOfIng[i],Container)
         if uo.GetQuantity('finditem') > 10 then
            uo.cancelmenu()
            if i == 0 then
               uo.Exec('automenu '+MenuDagger1)
            else
               uo.Exec('automenu '+MenuDagger)
            endif
            uo.Exec('automenu '+NameOre[i]+MenuSwords)
            if i>0 Then
               uo.Exec('automenu '+MenuOther)
            end if
            uo.Exec('automenu '+MenuIron)
            bs(TypeOre[i],ColorOfIng[i],NameOre[i])
         endif
      next
   wend
end sub
Sub bs(IngType,IngColor,NameOre)
   var ext=0,vs,c=0
   while ext <> 1
      if kls == 0 then
         checklags()
         UO.UnSetCatchBag()
         UO.SetCatchBag(Unload)
         wait(1000)
         UO.FindType( meshok, -1, Containerb )
         if uo.FindCount() > 0 then
            UO.Grab('1','finditem')
            wait(1000)
            smeshok=UO.GetSerial('finditem')
            UO.UnSetCatchBag()
            wait(1000)
            UO.SetCatchBag(smeshok)
         else
            uo.print("Закончились мешки конец")
            uo.exec("terminate all")
         endif
         kls=kls+1
         wait(500)
      end if
      uo.FindType(IngType,IngColor,'backpack')
      if uo.GetQuantity('finditem') < Quantity then
         checklags()
         UO.UnSetCatchBag()
         wait(1000)
         GetItem(IngType,IngColor,CountIng,Container,'backpack')
         uo.FindType(IngType,IngColor,'backpack')
         if uo.GetQuantity('finditem') < Quantity then
            ext=1
            wait(500)
            uo.print('Закончились '+NameOre+' инги берем другие')
            GetItem(IngType,IngColor,'all','backpack',Container)
         else
            uo.print('Взяли ' + Str( UO.Count( IngType ) ) + ' ингов')
         end if
         UO.SetCatchBag(smeshok)
         wait(1000)
      end if
      uo.DeleteJournal()
      if ext <> 1 then
         checklags()
         uo.UseType(IngType)
         repeat
            wait(500)
         until uo.InJournal('put') OR uo.InJournal('fail')
      endif
      if uo.InJournal('put') then
         checklags()
         kls=kls+1
         wait(500)
         if kls == 256 then
            kls=0
         end if
      end if
      UO.Print('Осталось: ' + Str( UO.Count( IngType ) ) + ' ингов, сделано '+str(kls-1)+' дагеров' )
      c=c+1
      if c==3 then
         c=0
         uo.usetype('0x097B')
         wait(700)
         uo.usetype('0x097B')
         
      end if
   wend
end sub
###########
# GetItem #
###########
Sub GetItem(type, color, quantity, where , to)
   uo.FindType(type,color,where)
   if uo.FindCount() then
      uo.moveitem('finditem',quantity,to)
      wait(750)
   else
      return false
   endif
end sub
Sub checklags()
   UO.DeleteJournal()
   UO.Click('backpack')
   Repeat
      wait(500)
   Until UO.InJournal('ackpack')
end sub

меню я отчеркнул ###. Если после его смены чтото не работает значит не правильно сменил.
ИМХО все таки лучше брать не универсальные а простые скрипты на крафт из одного типа металла.
Post Reply