Yoko

All sides of Injection
It is currently 2025-11-23 19:17:47

All times are UTC+02:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Blacksmithing
PostPosted: 2009-11-15 20:50:56 
Offline

Joined: 2004-12-30 16:47:14
Posts: 24
Что в скрипте не так? когда остается 1-2 инга он не берёт из сндка новю партию ингов
Code:
sub Blacksmithing() 
var Exit=0, LastTimer, Container='0x4005b307', Forge='0x4023840c' ;Cундук в котором инги и форж.
var CountIng=700 ;Скока ингов поднимает чар
var MenuIron="'Blacksmithing' 'Weapons'"
var MenuOther="'Colored' 'Weapons'"
var MenuSwords="Weapons' 'Swords'"
var MenuDagger="'Swords' '(3'"
var i=0

dim ColorOfIng[6]
dim NameOre[6]

NameOre[0]="'"
NameOre[1]="'Rusty "
NameOre[2]="'Old Copper "
NameOre[3]="'Dull Copper "
NameOre[4]="'Bronze "

ColorOfIng[0]='0x0000' ; Iron
ColorOfIng[1]='0x0750' ; Rusty
ColorOfIng[2]='0x0590' ; Old Copper
ColorOfIng[3]='0x060A' ; Dull Copper
ColorOfIng[4]='0x0488' ; Bronze


uo.UseObject(Container)
while not uo.Dead()
for i=0 to 4
uo.FindType('0x1BEF',ColorOfIng[i],Container)
if uo.GetQuantity('finditem')>10 then
uo.Grab(STR(CountIng),'finditem')
wait(1000)
             
uo.Exec('automenu '+MenuDagger)
uo.Exec('automenu '+NameOre[i]+MenuSwords)
if i>0 Then
uo.Exec('automenu '+MenuOther)
end if
uo.Exec('automenu '+MenuIron)
             
While Exit<>1
uo.DeleteJournal()
LastTimer=uo.Timer()
               
uo.UseType(0x1BEF) 

while not uo.InJournal("You put") and not uo.InJournal("You have failed")
wait(100)
wend

if uo.InJournal("You have failed") then
repeat
wait(100)
until uo.Timer()>=LastTimer+100 ; Время создания дагера
end if
CheckLag()

uo.FindType('0x0F51',-1,'backpack')

if uo.GetQuantity('finditem') then
uo.WaitTargetObject('finditem')
uo.UseObject(Forge) 
wait(100)
end if

uo.FindType('0x1BEF',-1,'backpack')
if uo.GetQuantity('finditem')<10 then
uo.FindType('0x1BEF',ColorOfIng[i],Container)
if uo.GetQuantity('finditem')<10 then
uo.FindType('0x1BEF',ColorOfIng[i],'backpack')
uo.SetReceivingContainer(Container)
uo.Grab('all','finditem')
uo.UnSetReceivingContainer()
Exit=1
end if
else
wait(1000)
uo.Grab(STR(CountIng-10),'finditem')
end if
wend
Exit=0
uo.CancelMenu()
end if
next
wend   
end sub

sub CheckLag()
if uo.Waiting()>0 then
uo.Exec("canceltarget")
end if
uo.DeleteJournal()
uo.Click('backpack')
repeat
wait(50)
until uo.InJournal('backpack')
end sub


Top
   
 Post subject:
PostPosted: 2009-11-15 23:40:46 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
Code:
uo.FindType('0x1BEF',-1,'backpack')
if uo.GetQuantity('finditem')<10 then


на

Code:
if uo.count('0x1BEF')<10 then

замени

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


Top
   
 Post subject:
PostPosted: 2009-11-16 11:40:39 
Offline
Expert!
User avatar

Joined: 2004-04-04 11:13:54
Posts: 1205
Location: Балаково, Саратовская обл.
Коунт считает количество кучек а не количество в кучке.


Top
   
 Post subject:
PostPosted: 2009-11-16 13:37:48 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
Savage wrote:
Коунт считает количество кучек а не количество в кучке.


1)Возвращает суммарное количество во всех стопках обьекта указаного типа type (и цвета color если указано) в вашем бекпаке и подсумках. Учитываются только те подсумки которые хоть раз открывались, иначе их содержимое не известно.

2)работают оба варианта всегда. Скрипт тестировался 40 часов без выключения.

Code:
sub main() 
   GET(log, Container, 10, 300)
   GET(saw, Container, 1, 1)
end sub


Sub GET(item, cont, min, max)          ;    предмет, откуда, минимум, сколько брать
   If UO.Count( item ) < min Then
      #       UO.Print("Кончилось сырье в рукзаке")
      UO.FindType( item, '-1', cont )
      if UO.FindCount() > 0 Then
         #        UO.Print('Сырья в сундуке: ' + Str( UO.FindCount( item ) ) )
         uo.moveitem('finditem', max, 'backpack')
         checklag()
      else
         #           UO.Print( 'Полностью кончилось сырье' )
         UO.CancelMenu()
         return
      endif
   Endif
end sub

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited