Yoko

All sides of Injection
It is currently 2025-12-29 22:10:57

All times are UTC+02:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2009-05-27 21:59:46 
Offline
User avatar

Joined: 2006-10-24 01:51:41
Posts: 23
Location: Middle Earth
смысл скрипта такой: пересчитываем овец в заданном радиусе, записываем их айдишники в массив. выдаем количество овец.
Code:
sub main()
        dim sheep[256]
        var sheepcnt = 0
        var nos=0
       
        UO.IgnoreReset()
        uo.set( 'finddistance', 2 )
 
        UO.FindType(0x00CF,'0x0000','ground')
        while (UO.FindCount())
                sheep[sheepcnt] = UO.GetSerial('finditem')
                UO.Ignore(sheep[sheepcnt])
#                UO.Print("Found sheep: "+str(sheep[sheepcnt]))
                sheepcnt = sheepcnt + 1
                UO.FindType(0x00CF,'0x0000','ground')
        wend
      nos=uo.findcount()
      uo.print(str(nos))
        UO.IgnoreReset()
        uo.set( 'finddistance', 32 )
end sub


неважно сколько овец рядом, всегда пишет 0 :( помогите пжалуйсто :)


Top
   
PostPosted: 2009-05-28 10:24:01 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
Попробуй так:

Code:
sub main()
        dim sheep[256]
        var sheepcnt = 0
        var nos=0
       
        UO.IgnoreReset()
        uo.set( 'finddistance', 2 )
        UO.FindType(0x00CF,'0x0000','ground')
        while (UO.FindCount())
                sheep[sheepcnt] = UO.GetSerial('finditem')
                UO.Ignore(sheep[sheepcnt])
#                UO.Print("Found sheep: "+str(sheep[sheepcnt]))
                sheepcnt = sheepcnt + 1
                UO.FindType(0x00CF,'0x0000','ground')
        wend
      uo.print('Найдено вец: ' +str(sheepcnt))
        UO.IgnoreReset()
        uo.set( 'finddistance', 32 )
end sub


Top
   
 Post subject:
PostPosted: 2009-05-28 16:22:19 
Offline
User avatar

Joined: 2006-10-24 01:51:41
Posts: 23
Location: Middle Earth
Спасибо :)


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 3 guests


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:  
Powered by phpBB® Forum Software © phpBB Limited