Moving bandages from bank to backpack

Ask for scripts here

Moderators: Murderator+, Murderator

Post Reply
utternoob
Posts: 24
Joined: 2007-11-17 12:39:26

Moving bandages from bank to backpack

Post by utternoob »

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!
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

Code: Select all

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.
Telegram: @tatikom
utternoob
Posts: 24
Joined: 2007-11-17 12:39:26

Post by utternoob »

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

Post by utternoob »

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: Select all

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
Post Reply