Author Topic: Garbage Can Check  (Read 2855 times)

0 Members and 1 Guest are viewing this topic.

Offline KhameleonTopic starter

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Garbage Can Check
« on: December 31, 2008, 08:09:19 AM »
0
has anyone Written a snippet to check if a garbage can is nearly full?

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Garbage Can Check
« Reply #1 on: December 31, 2008, 11:02:11 AM »
0
My 3.0 IDOC looter should have a couple subs that can manage the item count and weight.  I can rip those out for ya.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline KhameleonTopic starter

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: Garbage Can Check
« Reply #2 on: December 31, 2008, 02:11:45 PM »
0
greatly appreciated, I haven't quiet yet learned how to pull apart strings that well yet.
actually very little I have in the past and its taken hours of testing before it was almost right :P

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Garbage Can Check
« Reply #3 on: December 31, 2008, 02:25:44 PM »
0
ok, here they are. These should work in both RunUO or OSI.

Code: [Select]
sub TM_GetItemCount
  namespace push
  namespace local GIC
  set !item %1
  finditem !item *
  set #RESULT -1
  if #FINDKIND <> -1
  {
    event property #FINDID
    set !string #PROPERTY
    str pos !string Contents: ; OSI
    if #STRRES <> 0
    {
      set !start #STRRES + 10
      str pos !string /
      set !len #STRRES - !start
      str mid !string !start !len
      set #RESULT #STRRES
    }
    else
    {
      str pos !string Items, ; RunUO 2.0
      if #STRRES <> 0
      {
        set !end #STRRES
        set !ptr !end - 1
        repeat
          set !ptr !ptr - 1
          str mid !string !ptr 1
        until #STRRES notin _0_1_2_3_4_5_6_7_8_9_
        set !ptr !ptr + 1
        set !len !end - !ptr - 1
        str mid !string !ptr !len
        set #RESULT #STRRES
      }
    }
  }
  namespace pop
return #RESULT

sub TM_GetItemWeight
  namespace push
  namespace local GIC
  set !item %1
  finditem !item *
  set #RESULT -1
  if #FINDKIND <> -1
  {
    event property #FINDID
    set !string #PROPERTY
    str pos !string Weight:
    if #STRRES <> 0
    {
      set !start #STRRES + 8
      str pos !string Stones$
      set !len #STRRES - !start - 1
      str mid !string !start !len
      set #RESULT #STRRES
    }
    else
    {
      str pos !string Stones$ ; RunUO 2.0
      if #STRRES <> 0
      {
        set !end #STRRES
        set !ptr !end - 1
        repeat
          set !ptr !ptr - 1
          str mid !string !ptr 1
        until #STRRES notin _0_1_2_3_4_5_6_7_8_9_
        set !ptr !ptr + 1
        set !len !end - !ptr - 1
        str mid !string !ptr !len
        set #RESULT #STRRES
      }
    }
  }
  namespace pop
return #RESULT

Usage is just:

Code: [Select]
gosub TM_GetItemWeight XXYYZZ
display ok The weight of the container is , #SPC , #RESULT
stop
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline KhameleonTopic starter

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: Garbage Can Check
« Reply #4 on: January 01, 2009, 05:05:18 AM »
0
awesome, just making a small update to one of your lost scripts anyways :P
so it will flow even better :)

Tags: