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

How to loop this script forever?
http://forum.yoko.com.ua/viewtopic.php?f=3&t=13307
Page 1 of 1

Author:  utternoob [ 2008-02-27 19:49:11 ]
Post subject:  How to loop this script forever?

hello,

i want to loop this script forever-> viewtopic.php?p=71971#71971
script forever but it stops if i have more than 500 bandages. i just want it to loop and check if i have more 500 bandages, if i have less it should take 500 bandages from my bank and continue. help please :)[/url]

Author:  Nmy [ 2008-02-27 20:13:32 ]
Post subject:  Re: How to loop this script forever?

utternoob wrote:
hello,

i want to loop this script forever-> viewtopic.php?p=71971#71971
script forever but it stops if i have more than 500 bandages. i just want it to loop and check if i have more 500 bandages, if i have less it should take 500 bandages from my bank and continue. help please :)[/url]


Code:
sub getBandagesFromBank()
while 1
   var bandages = "0x0000" ; graphical type of bandages
   if uo.count( bandages ) < 500 then
   uo.findtype( bandages, "-1", uo.objAtLayer( "Bank" ) )
   if not uo.findcount() then
      uo.print( "Bandages was not found in bankbox." )
      return false
   endif
   uo.moveitem( "finditem", "500" )
   uo.print( "Bandages was be moved." )
   endif
 wait(5000)
wend
endsub

Author:  utternoob [ 2008-02-27 20:17:38 ]
Post subject: 

nothing changes, it will stop if i have more than 500 bandages.

what does "return false" command mean?

Author:  Edred [ 2008-02-27 21:40:56 ]
Post subject: 

Code:
while  
   var bandages = "0x0000" ; graphical type of bandages


Mr Nmy, а перед sub начало цикла втыкать не пробовал?

utternoob
Try it:

Code:
sub getBandagesFromBank() 
   var bandages = "0x0000" ; graphical type of bandages
   while NOT UO.Dead()
      if uo.count( bandages ) < 500 then
           uo.findtype( bandages, "-1", uo.objAtLayer( "Bank" ) )
           if not uo.findcount() then
              uo.print( "Bandages was not found in bankbox." )
              return
           endif
           uo.moveitem( "finditem", "500" )
           uo.print( "Bandages was be moved." )
      endif
      wait(5000)
   wend
endsub

Author:  Destruction [ 2008-02-27 21:59:10 ]
Post subject: 

Эээ, шо за бред пишем?

учимсо закрывать ифы.. Дать сцылку на урок? :roll:

Author:  Nmy [ 2008-02-27 22:13:14 ]
Post subject: 

Я тут писал, ошыбся :))

Author:  utternoob [ 2008-02-27 22:13:57 ]
Post subject: 

thanks all, now its working how i wanted it to work :D

thats all i needed

Code:
sub getBandagesFromBank2()
   while NOT UO.Dead()
      if uo.count('bandage') < 100 then
           uo.findtype('bandage', "-1", uo.objAtLayer( "Bank" ) )
      endif
      uo.moveitem( "finditem", "100")
      wait(5000)
   wend
endsub

Author:  Edred [ 2008-02-27 23:32:52 ]
Post subject: 

Destruction
Потерял при копировании, спасибо. Поправил код...

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