Yoko

All sides of Injection
It is currently 2025-12-20 10:18:02

All times are UTC+02:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 2008-02-27 15:23:39 
Offline

Joined: 2007-11-17 12:39:26
Posts: 24
Hello,

Can anyone give me a script that moves some bandages from bank to my backpack if theres only a few left in my backpack?

Thanks!


Top
   
 Post subject:
PostPosted: 2008-02-27 16:16:04 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
Code:
sub getBandagesFromBank()
   var bandages = "0x0000" ; graphical type of bandages
   if uo.count( bandages ) > 100 then
      uo.print( "I already have more than 100 bandages." )
      return false
   endif
   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", "100" )
   uo.print( "Bandages was be moved." )
endsub

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2008-02-27 17:48:21 
Offline

Joined: 2007-11-17 12:39:26
Posts: 24
Thank you very much!!! This worked! :D


Top
   
 Post subject:
PostPosted: 2008-02-27 18:49:04 
Offline

Joined: 2007-11-17 12:39:26
Posts: 24
hmmm how do i make this script loop forever, atm it stops if i have more than 500 bandages, i currently have it like this:

Code:
sub getBandagesFromBank()
repeat
   if uo.count('bandage') > 500 then
      uo.print( "I already have more than 500 bandages." )
      return false
   endif
   uo.findtype('bandage', "-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 has been moved." )
   wait(300000)
until UO.life<2
end sub


i just want it to loop forever, and check if i have enough bandages every 5mins. i thought if i add repeat..until it will loop forever, but it doesnt :S


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