UOS - Bag of Sending (Snippet)

Share your guides, how-tos, FAQs, and so forth. This is not for support -- post questions in General Discussion.
Post Reply
Haswell
Posts: 44

UOS - Bag of Sending (Snippet)

Post by Haswell »

This is a useful piece of macro I made for stocking resources using a Bag of Sending (BoS), it searches for a heavy resource stack and also recharges an empty BoS with powder if possible/necessary.

Important:
- Configure desired resources at the beginning of this macro by adding a new pushlist for each graphic you want to stock;
- If you have edited the resources list and already played the macro you must go to the Macros tab, click the "Active Objects" -> "Clear All" button before playing this macro again.

Tips:
- You can find an object's graphic by going to the Macros tab, clicking the "Object Inspector" button and selecting the item in-game;
- You can completely attach to other macros, call it via hotkey or by adding a playmacro command somewhere in a different macro.

Code: Select all

// Author: Di
// Description: send resources to bank via bag of sending
// Resources
if not listexists 'resources'
  createlist 'resources'
  // Gold
  pushlist! 'resources' 0xeed
  // Dragon Scale
  pushlist! 'resources' 0x26b4
  // Cut Leather
  pushlist! 'resources' 0x1081
endif
// Bag of sending
if diffweight < 10
  // Define bag with charges
  @unsetalias 'bag of sending'
  @unsetalias 'empty bag of sending'
  clearignorelist
  while @findtype 0xe76 'any' 'backpack'
    waitforproperties 'found' 1000
    if @property 'bag of sending' 'found'
      if @property 'charges' 'found' > 0
        @setalias 'bag of sending' 'found'
        break
      elseif not @findalias 'empty bag of sending'
        @setalias 'empty bag of sending' 'found'
      endif
    endif
    ignoreobject 'found'
  endwhile
  // Powder of translocation if necessary
  if not @findalias 'bag of sending' and @findalias 'empty bag of sending'
    if @usetype! 0x26b8 0 'backpack'
      waitfortarget 1000
      target! 'empty bag of sending'
      waitforproperties 'empty bag of sending' 1000
      // Ensure it is charged
      if @property 'charges' 'empty bag of sending' > 0
        @setalias 'bag of sending' 'empty bag of sending'
      endif
    endif
  endif
  // Send resources
  if @findalias 'bag of sending'
    @unsetalias 'resource'
    // Define heavy resource stack
    for 0 to 'resources'
      while @findtype 'resources[]' 'any' 'backpack'
        waitforproperties 'found' 500
        if not @findalias 'resource' or @property 'weight' 'found' >= 130
          @setalias 'resource' 'found'
        endif
        ignoreobject 'found'
      endwhile
    endfor
    if @findalias 'resource'
      @useobject! 'bag of sending'
      waitfortarget 1000
      target! 'resource'
    endif
  endif
endif
Tagima likes this.
Top
Post Reply