ScriptUO

Ultima Online Fan Board => General UO Chat => Topic started by: _C2_ on March 10, 2009, 07:01:19 PM

Title: Getting the correct item count in backpack w/o opening all containers inside?
Post by: _C2_ on March 10, 2009, 07:01:19 PM
Can this be done?  if u hover over paperdoll pack it says ... say 19 items

the problem is that 2 of the items are in a bag in your pack so when you finditem * c_ , #backpackid it say #findcnt 17.  Is there a way to read the backpack like you can on the paperdoll w/o opening and searching all little packs too?

I guess i could just ignore all items in pack too but i was interested in doing it the other way.
Title: Re: Getting the correct item count in backpack w/o opening all containers inside?
Post by: TrailMyx on March 10, 2009, 07:06:32 PM
One thing you can to is perform an "event property #BACKPACK".  Then just look at the second line.  There's a small problem with this because there are times when you don't get proper returned value from event property.  But when it does work, then you do get a true count of what's in your pack.
Title: Re: Getting the correct item count in backpack w/o opening all containers inside?
Post by: OMGBurgers on March 10, 2009, 07:40:20 PM
Yeah I would use event property.  When you use event property create a failsafe to count the number of "$"'s in property.  Sometimes it will return "Backback$" but not the rest.  If you do a "str count #property" then "if #strres < 2... (redo)" that should work since it should return three "lines of data" (In the #property case, one line but 2 "$"s).
Title: Re: Getting the correct item count in backpack w/o opening all containers inside?
Post by: _C2_ on March 10, 2009, 08:16:19 PM
nice.. i knew you all would throw some ideas out there.  never thought about event propertying it due to it being on the paperdoll.  cool
Title: Re: Getting the correct item count in backpack w/o opening all containers inside?
Post by: TrailMyx on March 10, 2009, 08:41:14 PM
The main hitch is to be sure your paperdoll is open.  ;)
Title: Re: Getting the correct item count in backpack w/o opening all containers inside?
Post by: _C2_ on March 11, 2009, 06:41:16 AM
Is there a trick to get the property to show again if it is blank?  I had two characters loaded last night and i open and closed back packs and closed reopened paperdolls and it stayed blank.  hrmm.  I see where it could be tricky. Maybe i could make the script halt until you had the backpack property showing.
Title: Re: Getting the correct item count in backpack w/o opening all containers inside?
Post by: TrailMyx on March 11, 2009, 09:24:00 AM
Sometimes selecting something else, then selecting the backpack works.  Unfortunately that's not reliable either.  I haven't figured out a good way yet.
Title: Re: Getting the correct item count in backpack w/o opening all containers inside?
Post by: OMGBurgers on March 11, 2009, 11:47:19 AM
Using/Equiping an item can fix it.  Maybe opening the backpack would work?
Title: Re: Getting the correct item count in backpack w/o opening all containers inside?
Post by: _C2_ on March 11, 2009, 11:58:53 AM
i will toy with taking an item from the bag and dropping it back in the bag.  just opening the bag does not work.  I remember placing a new item in the bag has worked in the past now that you mention it.  Thx everyone for brainstorming this!
Title: Re: Getting the correct item count in backpack w/o opening all containers inside?
Post by: _C2_ on March 11, 2009, 03:51:27 PM
okay event property works well and here is what i am doing!

event property #backpackid
if /125 notin #property
   {
   gosub QuickDrop
   goto retry
   }
if 125/125 in #property
   set %shutdown #true

/125 does not show up when the backpack comes up blank so when i event property and it comes up blank (#backpack) i take an assigned item in the back pack and pick it up and redrop it in the pack.  that instantly resets the backpack for good.

then when the backpack gets to 125/125 in #property i halt the script!!!
Title: Re: Getting the correct item count in backpack w/o opening all containers inside?
Post by: Endless Night on March 12, 2009, 05:25:20 AM
good solution c2.