Author Topic: Bag of Sending subs  (Read 18385 times)

0 Members and 1 Guest are viewing this topic.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • 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
Bag of Sending subs
« on: April 16, 2009, 12:02:08 PM »
+1
What these do:
1) Hunts for a BOS with charges in your main pack (you may have more than one)
2) Sends whatever items you have in your send list (may have more than one ITEM type)

Now that the bag of sending is back, here's a sub to manipulate it:

Code: easyuo
  1. gosub SendItems POF_UJG
  2. stop
  3. ;-----------------------------------
  4. ; %1 - items to send
  5. ; uses %weightwarn = #TRUE to indicate an overweight warning has been issued.
  6. ;                    set to #FALSE to enable another warning.
  7. ; Works on OSI & RunUO
  8. ;
  9. ; TrailMyx, Cerveza
  10. sub SendItems
  11.   namespace push
  12.   namespace local SI
  13.   set !bos_items %1
  14.   SendItems_loop1:
  15.     finditem CKF C_ , #BACKPACKID
  16.     if #FINDKIND <> -1
  17.     {
  18.       event property #FINDID
  19.       if sending notin #PROPERTY
  20.       {
  21.         ignoreitem #FINDID
  22.         goto SendItems_loop1
  23.       }
  24.       set !bagofsending #FINDID
  25.       SendItems_loop2:
  26.         finditem !bos_items C_ , #BACKPACKID
  27.         if #FINDKIND <> -1
  28.         {
  29.           event property !bagofsending
  30.           str pos #PROPERTY Charges:
  31.           set #STRRES #STRRES + 9
  32.           str mid #PROPERTY #STRRES 1
  33.           if #STRRES = 0   ; as in zero charges
  34.           {
  35.             ignoreitem !bagofsending
  36.             goto SendItems_loop1
  37.           }
  38.           set #LOBJECTID !bagofsending
  39.           set #LTARGETID #FINDID
  40.           set #LTARGETKIND 1
  41.           event macro 17
  42.           wait 10
  43.           target 5s
  44.           event macro 22
  45.           wait 10
  46.           ignoreitem #FINDID
  47.           set %weightwarn #FALSE
  48.           goto SendItems_loop2
  49.         }
  50.         else
  51.         {
  52.           if ( #WEIGHT > ( #MAXWEIGHT - 10 ) ) || ( #WEIGHT > 425 )
  53.           {
  54.             display ok You are nearly overweight, but you have no selected$items to send.  Please unload manually.
  55.             set %weightwarn #TRUE
  56.             namespace pop
  57.             return
  58.           }
  59.         }
  60.     }
  61.     else
  62.     {
  63.       display ok No valid bags of sending in your main pack.$Please unload manually.
  64.       set %weightwarn #TRUE
  65.       namespace pop
  66.       return
  67.     }
  68.   set %weightwarn #FALSE
  69.   namespace pop
  70. return
  71.  

Also, note you can adjust the target weight (currently set to 425)

These aren't the best, I may have some better ones lurking somewhere else.  But for now these should get you going.
« Last Edit: May 05, 2017, 04:54:17 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline craigtothed

  • Jr. Member
  • **
  • Posts: 18
  • Activity:
    0%
  • Reputation Power: 0
  • craigtothed has no influence.
  • Respect: +3
  • Referrals: 2
    • View Profile
Re: Bag of Sending subs
« Reply #1 on: February 05, 2010, 10:06:12 PM »
+1
I would like to modify it to send from a sub pack but have been having trouble getting that to happen. This is what Ive added.

Code: [Select]
set %lootbagid whaeva

Gosub Sendtems POF LOOTBAG  ; added a second parameter

;  Trailmyx Bag of Sending SUB
;
sub SendItems
  namespace push
  namespace local SI
  set !bos_items %1
  SendItems_loop1:
  finditem CKF C_ , #BACKPACKID
  if #FINDKIND <> -1
  {
    event property #FINDID
    if sending notin #PROPERTY
    {
      ignoreitem #FINDID
      goto SendItems_loop1
    }
    set !bagofsending #FINDID
SendItems_loop2:
    if %2 = LOOTBAG  ; sends from the lootbag instead of the main bag
    [
    finditem !bos_items C_ , %lootbagid     
    ]
    else
    [
    finditem !bos_items C_ , #BACKPACKID
    ]
 bla bla bla more code follows.   

Is this close to correct or am I going about it all wrong?

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • 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: Bag of Sending subs
« Reply #2 on: February 05, 2010, 10:36:50 PM »
+1
Mostly right.  Be sure to change your [] to {}.  Also remember that you must open the loot bag first.  You won't get anything from finditem from a closed bag.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Tana

  • Jr. Member
  • **
  • Posts: 67
  • Activity:
    0%
  • Reputation Power: 1
  • Tana has no influence.
  • Respect: +6
  • Referrals: 1
    • View Profile
Re: Bag of Sending subs
« Reply #3 on: April 05, 2016, 06:21:43 PM »
+1
Hey TM i know this is an old thread but i found this and wanted to use it myself. i modified it a bit im bug testing it now but what do you think?

Code: [Select]

sub weightcheck
  if %useBOS = #true
  {
    GOSUB senditems %senditem
  }
  finditem * c_ , %mapbag
  IF #findcnt > 110
  {
    gosub gohome
  }
return
;-----------------------------------------------------------------------------

sub SendItems
  namespace push
  namespace local SI
  set !bos_items %1
  SendItems_loop1:
    finditem CKF C_ , #BACKPACKID
    if #FINDKIND <> -1
    {
      event property #FINDID
      if sending notin #PROPERTY
      {
        ignoreitem #FINDID
        goto SendItems_loop1
      }
      set !bagofsending #FINDID
      SendItems_loop2:
        finditem !bos_items C_ , #BACKPACKID
        if #FINDKIND <> -1
        {
          event property !bagofsending
          str pos #PROPERTY Charges:
          set #STRRES #STRRES + 9
          str mid #PROPERTY #STRRES 1
          if #STRRES = 0   ; as in zero charges
          {
            ignoreitem !bagofsending
            goto SendItems_loop1
          }
        if #weight > ( #maxweight - 10 )
          {
          set #LOBJECTID !bagofsending
          set #LTARGETID #FINDID
          set #LTARGETKIND 1
          event macro 17
          wait 10
          target 5s
          event macro 22
          wait 10
          goto SendItems_loop2
          }
        }
    }
    ELSE
      {
      namespace pop
      set %useBOS #false
      return
      }
  }
return
« Last Edit: April 06, 2016, 12:56:36 AM by Tana »