Equiping desired amount of regs, from any last container.

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
pr0totype
Posts: 1
Joined: 2004-04-14 20:15:13
Location: Washington, USA
Contact:

Equiping desired amount of regs, from any last container.

Post by pr0totype »

Code: Select all

########################
####  Equip v1.0b   ####
####                ####
#### By: pr0totype  ####
########################

sub grabregs()

# If you use healing put a 1 if not put a 0
   var H
   H = 0

# If you use healing edit this to the amount of aids you want to have in your pack.
   var A
   A = 51

# Edit N to how many of each reg you want to have in your pack.
   var N
   N = 51
   
# D = Delay, Edit this to fit the server you play, I prefer 600ms on RunUO servers.
   var D
   D = 600

# Editing beyond this point is not required.

var AD
var BM
var BP
var GA
var GS
var MR
var NS
var SA
var SS
AD = A-UO.B
BM = N-UO.BM
BP = N-UO.BP
GA = N-UO.GA
GS = N-UO.GS
MR = N-UO.MR
NS = N-UO.NS
SA = N-UO.SA
SS = N-UO.SS
UO.Print("GrabRegs initialized.")

start:
   UO.DeleteJournal()
   
      if UO.B<A and H>0 then
         UO.FindType("0x0E21","-1","lastcontainer") #Bandages
         UO.Grab(str(AD),"finditem")
         wait(D)
      end if

regs:   

   if UO.BM<N then
      UO.FindType("0x0F7B","-1","lastcontainer") #Blood Moss
      UO.Grab(str(BM),"finditem")
      wait(D)
   end if
      
   if UO.BP<N then
      UO.FindType("0x0F7A","-1","lastcontainer") #Black Pearl
      UO.Grab(str(BP),"finditem")
      wait(D)
   end if
      
   if UO.GA<N then
      UO.FindType("0x0F84","-1","lastcontainer") #Garlic
      UO.Grab(str(GA),"finditem")
      wait(D)
   end if
      
   if UO.GS<N then
      UO.FindType("0x0F85","-1","lastcontainer") #Ginseng
      UO.Grab(str(GS),"finditem")
      wait(D)
   end if
      
   if UO.MR<N then
      UO.FindType("0x0F86","-1","lastcontainer") #Mandrake Root
      UO.Grab(str(MR),"finditem")
      wait(D)
   end if
      
   if UO.NS<N then
      UO.FindType("0x0F88","-1","lastcontainer") #Nightshade
      UO.Grab(str(NS),"finditem")
      wait(D)
   end if
      
   if UO.SA<N then
      UO.FindType("0x0F8C","-1","lastcontainer") #Sulfurous Ash
      UO.Grab(str(SA),"finditem")
      wait(D)
   end if
         
   if UO.SS<N then
      UO.FindType("0x0F8D","-1","lastcontainer") #Spiders' Silk
      UO.Grab(str(SS),"finditem")
      wait(D)
   end if
      
   goto check
   
check:
   if UO.InJournal("cliloc# 0xA197") then
      wait(D)
      goto start
      else
      goto end
   end if
end:
   UO.Print("Finished..")
end sub


I tried putting them all in an array but could never get it to work right. ;/
But yeah, it works good and smooth, for the lazy uo player. :P Have fun.
AGRS
Expert!
Posts: 1007
Joined: 2004-04-04 21:40:09
Contact:

Post by AGRS »

Try to change:
BM = N-UO.BM --> BM = N-UO.Count("0x0F7B")
and others.
Post Reply