Mining cart house guide

Share your guides, how-tos, FAQs, and so forth. This is not for support -- post questions in General Discussion.
User avatar
kentares
Posts: 673
Location: Houston

Re: Mining cart house guide

Post by kentares »

Code: Select all

//With the assistance of many people including: (in alphabetical order)
// * @Bama (yes Bama, does come before A)
// * @Alvin
// * @BCrowly
// * @DeathViper
// * @Gargl Kark
// * @Geaux
// * @Gredras
// * @kobra
// * @MB
// * @MMMartin
// * @mortoburger
// * @otimpyre
// * @preman
// * @The Silvertiger
// * @Spok
//
// If I left you off the list this was entirely by accident PM me and I will edit.
//
// This macro:
//   * Updated 05/15/2021 4:06 a.m. cst. (Version 2.4)
//   * Works with UOSteam
//   * Works anywhere and on any shard
//   * Does not require recording serial numbers of carts
//   * Requires something in the left hand when it begins
//   * Requires a counter for Tourmaline (sorry)
//   * Added additional commenting in code
//
// Documented because I always forget which way they go. :P
// <= less than symbol
// >= greater than symbol
//
// There are eight (8) spots per floor, the loop starts over twice (2) per spot and there are four floors (4)
// this is looped sixty-four (64) times to hit each spot on each floor
//
// First Floor Z-Axis information
// z 'self' == -83
// z 'cart' >= -83 and z 'cart' <= -68
//
// Second Floor Z-Axis information
// z 'self' == -63
// z 'cart' >= -63 and z 'cart' <= -48
//
// Third Floor Z-Axis information
// z 'self' == -43
// z 'cart' >= -43 and z 'cart' <= -28
//
// Fourth Floor Z-Axis information
// z 'self' == -23
// z 'cart' >= -23 and z 'cart' <= -8
//
for 64
  // Removing previous aliases and ignorelists (cleanup)
  unsetalias 'cart'
  unsetalias 'cart bag'
  unsetalias 'found'
  pause 500
  clearignorelist
  pause 5000
  // Completed removing previous aliases and ignorelists
  //
  // ==========================================================================
  // START OF STEP 01
  // ==========================================================================
  //
  // Start of While Loop looking for any mining carts on the ground in range
  while @findtype 0x1a88 'any' 'ground' 1 2
    // When a mining cart is found set name to 'cart' and serial to 'found'
    setalias 'cart' 'found'
    // Clear the journal
    @clearjournal
    //
    // ------------------------------------------------------------------------
    // Start of First Floor - Resource Mining Cart Gathering
    //
    // This is the z-axis of the player.
    if z 'self' == -83
      // This is the z-axis range to look for the cart(s).
      if z 'cart' >= -83 and z 'cart' <= -68
        // As long as the system message doesn't appear, keep doing the command.
        while not @injournal "There are no more resources available at this time." 'system'
          useobject 'cart'
          pause 500
        endwhile
        // ^If the system message appears, stop doing the command.
        //If the cart isn't within the z-axis range, ignore it.
      else
        ignoreobject 'cart'
        pause 500
        // End of the if-statement for the z-axis range listed above.
      endif
      // End of the if-statement for the z-axis of the player listed above.
    endif
    //
    // End of First Floor - Resource Mining Cart Gathering
    // ------------------------------------------------------------------------
    //
    //
    // ------------------------------------------------------------------------
    // Start of Second Floor - Resource Mining Cart Gathering
    //
    // This is the z-axis of the player.
    if z 'self' == -63
      // This is the z-axis range to look for the cart(s).
      if z 'cart' >= -63 and z 'cart' <= -48
        // As long as the system message doesn't appear, keep doing the command.
        while not @injournal "There are no more resources available at this time." 'system'
          useobject 'cart'
          pause 500
        endwhile
        // ^If the system message appears, stop doing the command.
        //If the cart isn't within the z-axis range, ignore it.
      else
        ignoreobject 'cart'
        pause 500
        // End of the if-statement for the z-axis range listed above.
      endif
      // End of the if-statement for the z-axis of the player listed above.
    endif
    //
    // End of Second Floor - Resource Mining Cart Gathering
    // ------------------------------------------------------------------------
    //
    //
    // ------------------------------------------------------------------------
    // Start of Third Floor - Resource Mining Cart Gathering
    //
    // This is the z-axis of the player.
    if z 'self' == -43
      // This is the z-axis range to look for the cart(s).
      if z 'cart' >= -43 and z 'cart' <= -28
        // As long as the system message doesn't appear, keep doing the command.
        while not @injournal "There are no more resources available at this time." 'system'
          useobject 'cart'
          pause 500
        endwhile
        // ^If the system message appears, stop doing the command.
        //If the cart isn't within the z-axis range, ignore it.
      else
        ignoreobject 'cart'
        pause 500
        // End of the if-statement for the z-axis range listed above.
      endif
      // End of the if-statement for the z-axis of the player listed above.
    endif
    //
    // End of Third Floor - Resource Mining Cart Gathering
    // ------------------------------------------------------------------------
    //
    //
    // ------------------------------------------------------------------------
    // Start of Fourth Floor - Resource Mining Cart Gathering
    //
    // This is the z-axis of the player.
    if z 'self' == -23
      // This is the z-axis range to look for the cart(s).
      if z 'cart' >= -23 and z 'cart' <= -8
        // As long as the system message doesn't appear, keep doing the command.
        while not @injournal "There are no more resources available at this time." 'system'
          useobject 'cart'
          pause 500
        endwhile
        // ^If the system message appears, stop doing the command.
        //If the cart isn't within the z-axis range, ignore it.
      else
        ignoreobject 'cart'
        pause 500
        // End of the if-statement for the z-axis range listed above.
      endif
      // End of the if-statement for the z-axis of the player listed above.
    endif
    //
    // End of Fourth Floor - Resource Mining Cart Gathering
    // ------------------------------------------------------------------------
    //
    ignoreobject 'cart'
    unsetalias 'cart'
  endwhile
  // ^End of While Loop looking for any mining carts on the ground in range
  //
  // ==========================================================================
  // END OF STEP 01
  // ==========================================================================
  //
  //
  // ==========================================================================
  // START OF STEP 02
  // ==========================================================================
  //
  // If an object is found in the lefthand do these commands
  if findobject 'lefthand'
    turn "East"
    for 2
      walk "East"
    endfor
    unsetalias 'cart bag'
    // Start of While Loop looking for any backpacks on the ground in range
    while @findtype 0xe75 'any' 'ground' 1 1
      // When a backpack is found set name to 'cart bag' and serial to 'found'
      setalias 'cart bag' 'found'
      // Clear the journal
      @clearjournal
      //
      // ----------------------------------------------------------------------
      // Start of First Floor - Putting Mining Cart Resources In Bag
      //
      // This is the z-axis of the player.
      if z 'self' == -83
        // This is the z-axis range to look for the backpacks(s).
        if z 'cart bag' >= -83 and z 'cart bag' <= -68
          // As long as the Tourmaline counter doesn't equal zero (0), keep doing the command.
          while not counter 'cntr-7' == 0
            //Amber
            @movetype 0xf25 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Amethyst
            @movetype 0xf16 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Citrine
            @movetype 0xf15 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Diamond
            @movetype 0xf26 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Emerald
            @movetype 0xf10 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Ruby
            @movetype 0xf13 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Sapphire
            @movetype 0xf19 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Star Sapphire
            @movetype 0xf21 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Tourmaline
            @movetype 0xf2d 'backpack' 'cart bag' 65535 65535 0
            pause 600
          endwhile
          // ^If the counter equals zero (0), stop doing the command.
          //If the backpack isn't within the z-axis range, ignore it.
        else
          ignoreobject 'cart bag'
          pause 500
        endif
      endif
      //
      // End of First Floor - Putting Mining Cart Resources In Bag
      // ----------------------------------------------------------------------
      //
      //
      // ----------------------------------------------------------------------
      // Start of Second Floor - Putting Mining Cart Resources In Bag
      //
      // This is the z-axis of the player.
      if z 'self' == -63
        // This is the z-axis range to look for the backpacks(s).
        if z 'cart bag' >= -63 and z 'cart bag' <= -48
          // As long as the Tourmaline counter doesn't equal zero (0), keep doing the command.
          while not counter 'cntr-7' == 0
            //Amber
            @movetype 0xf25 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Amethyst
            @movetype 0xf16 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Citrine
            @movetype 0xf15 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Diamond
            @movetype 0xf26 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Emerald
            @movetype 0xf10 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Ruby
            @movetype 0xf13 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Sapphire
            @movetype 0xf19 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Star Sapphire
            @movetype 0xf21 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Tourmaline
            @movetype 0xf2d 'backpack' 'cart bag' 65535 65535 0
            pause 600
          endwhile
          // ^If the counter equals zero (0), stop doing the command.
          //If the backpack isn't within the z-axis range, ignore it.
        else
          ignoreobject 'cart bag'
          pause 500
        endif
      endif
      //
      // End of Second Floor - Putting Mining Cart Resources In Bag
      // ----------------------------------------------------------------------
      //
      //
      // ----------------------------------------------------------------------
      // Start of Third Floor - Putting Mining Cart Resources In Bag
      //
      // This is the z-axis of the player.
      if z 'self' == -43
        // This is the z-axis range to look for the backpacks(s).
        if z 'cart bag' >= -43 and z 'cart bag' <= -28
          // As long as the Tourmaline counter doesn't equal zero (0), keep doing the command.
          while not counter 'cntr-7' == 0
            //Amber
            @movetype 0xf25 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Amethyst
            @movetype 0xf16 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Citrine
            @movetype 0xf15 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Diamond
            @movetype 0xf26 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Emerald
            @movetype 0xf10 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Ruby
            @movetype 0xf13 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Sapphire
            @movetype 0xf19 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Star Sapphire
            @movetype 0xf21 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Tourmaline
            @movetype 0xf2d 'backpack' 'cart bag' 65535 65535 0
            pause 600
          endwhile
          // ^If the counter equals zero (0), stop doing the command.
          //If the backpack isn't within the z-axis range, ignore it.
        else
          ignoreobject 'cart bag'
          pause 500
        endif
      endif
      //
      // End of Third Floor - Putting Mining Cart Resources In Bag
      // ----------------------------------------------------------------------
      //
      //
      // ----------------------------------------------------------------------
      // Start of Fourth Floor - Putting Mining Cart Resources In Bag
      //
      // This is the z-axis of the player.
      if z 'self' == -23
        // This is the z-axis range to look for the backpacks(s).
        if z 'cart bag' >= -23 and z 'cart bag' <= -8
          // As long as the Tourmaline counter doesn't equal zero (0), keep doing the command.
          while not counter 'cntr-7' == 0
            //Amber
            @movetype 0xf25 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Amethyst
            @movetype 0xf16 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Citrine
            @movetype 0xf15 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Diamond
            @movetype 0xf26 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Emerald
            @movetype 0xf10 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Ruby
            @movetype 0xf13 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Sapphire
            @movetype 0xf19 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Star Sapphire
            @movetype 0xf21 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Tourmaline
            @movetype 0xf2d 'backpack' 'cart bag' 65535 65535 0
            pause 600
          endwhile
          // ^If the counter equals zero (0), stop doing the command.
          //If the backpack isn't within the z-axis range, ignore it.
        else
          ignoreobject 'cart bag'
          pause 500
        endif
      endif
      //
      // End of Fourth Floor - Putting Mining Cart Resources In Bag
      // ----------------------------------------------------------------------
      //
      ignoreobject 'cart bag'
      unsetalias 'cart bag'
    endwhile
    // ^End of While Loop looking for any backpacks on the ground in range
    // Disarm
    togglehands 'left'
    // If an object is not found in the lefthand do these commands
  else
    turn "West"
    for 1
      walk "West"
    endfor
    // Rearm
    togglehands 'left'
  endif
  //
  // ==========================================================================
  // END OF STEP 02
  // ==========================================================================
  //
endfor
Good morning,

I haven't completely vetted the code; but wanted to get it posted as a backup. I've added all four floors to the code and I've added a lot of commenting to hopefully make this easier to understand. I would like to thank @The Silvertiger for his large contribution of mining carts; now on floor 3; almost done! Would also like to thank @Gargl Kark; motivated me to clean up the code and add comments to it. Hopefully it makes a bit more sense.

I feel like there has to be a more efficient way to write this code but I haven't figured it out yet. I feel like this could be written in two really small loops.

Please enjoy and critique,




kentares
Gargl Kark likes this.
Top
User avatar
kentares
Posts: 673
Location: Houston

Re: Mining cart house guide

Post by kentares »

Code: Select all

//With the assistance of many people including: (in alphabetical order)
// * @Bama (yes Bama, does come before A)
// * @Alvin
// * @BCrowly
// * @DeathViper
// * @Gargl Kark
// * @Geaux
// * @Gredras
// * @kobra
// * @MB
// * @MMMartin
// * @mortoburger
// * @otimpyre
// * @preman
// * @The Silvertiger
// * @Spok
//
// If I left you off the list this was entirely by accident PM me and I will edit.
//
// This macro:
//   * Updated 05/17/2021 9:37 p.m. cst. (Version 2.5)
//   * Works with UOSteam
//   * Works anywhere and on any shard
//   * Does not require recording serial numbers of carts
//   * Requires something in the left hand when it begins
//   * Requires a counter for Tourmaline (sorry)
//   * Added additional commenting in code
//   * CAUTION - This macro will set the permissions on the mining cart to "Friends"
//   * Trying to keep the macro as silent as possible.
//
// Documented because I always forget which way they go. :P
// <= less than symbol
// >= greater than symbol
//
// There are eight (8) spots per floor, the loop starts over twice (2) per spot and there are four floors (4)
// this is looped sixty-four (64) times to hit each spot on each floor
//
// First Floor Z-Axis information
// z 'self' == -83
// z 'cart' >= -83 and z 'cart' <= -68
//
// Second Floor Z-Axis information
// z 'self' == -63
// z 'cart' >= -63 and z 'cart' <= -48
//
// Third Floor Z-Axis information
// z 'self' == -43
// z 'cart' >= -43 and z 'cart' <= -28
//
// Fourth Floor Z-Axis information
// z 'self' == -23
// z 'cart' >= -23 and z 'cart' <= -8
//
for 64
  // Removing previous aliases and ignorelists (cleanup)
  unsetalias 'cart'
  unsetalias 'cart bag'
  unsetalias 'found'
  pause 500
  clearignorelist
  pause 5000
  // Completed removing previous aliases and ignorelists
  //
  // ==========================================================================
  // START OF STEP 01
  // ==========================================================================
  //
  // Start of While Loop looking for any mining carts on the ground in range
  while @findtype 0x1a88 'any' 'ground' 1 2
    // When a mining cart is found set name to 'cart' and serial to 'found'
    setalias 'cart' 'found'
    // Clear the journal
    clearjournal
    //
    // ------------------------------------------------------------------------
    // Start of First Floor - Resource Mining Cart Gathering
    //
    // This is the z-axis of the player.
    if z 'self' == -83
      // This is the z-axis range to look for the cart(s).
      if z 'cart' >= -83 and z 'cart' <= -68
        // As long as the system message doesn't appear, keep doing the command.
        while not @injournal "There are no more resources available at this time." 'system'
          // CAUTION - This is changing the default permission for the mining cart
          // CAUTION - The permission is being set for "Friends" access
          // Click the Mining Cart
          waitforcontext 'cart' 0 15000
          // Click Set Security
          waitforgump 0x29b6c49 15000
          // Friends
          // END OF CAUTION
          replygump 0x29b6c49 3
          useobject 'cart'
          pause 500
        endwhile
        // ^If the system message appears, stop doing the command.
        //If the cart isn't within the z-axis range, ignore it.
      else
        ignoreobject 'cart'
        pause 500
        // End of the if-statement for the z-axis range listed above.
      endif
      // End of the if-statement for the z-axis of the player listed above.
    endif
    //
    // End of First Floor - Resource Mining Cart Gathering
    // ------------------------------------------------------------------------
    //
    //
    // ------------------------------------------------------------------------
    // Start of Second Floor - Resource Mining Cart Gathering
    //
    // This is the z-axis of the player.
    if z 'self' == -63
      // This is the z-axis range to look for the cart(s).
      if z 'cart' >= -63 and z 'cart' <= -48
        // As long as the system message doesn't appear, keep doing the command.
        while not @injournal "There are no more resources available at this time." 'system'
          // CAUTION - This is changing the default permission for the mining cart
          // CAUTION - The permission is being set for "Friends" access
          // Click the Mining Cart
          waitforcontext 'cart' 0 15000
          // Click Set Security
          waitforgump 0x29b6c49 15000
          // Friends
          // END OF CAUTION
          replygump 0x29b6c49 3
          useobject 'cart'
          pause 500
        endwhile
        // ^If the system message appears, stop doing the command.
        //If the cart isn't within the z-axis range, ignore it.
      else
        ignoreobject 'cart'
        pause 500
        // End of the if-statement for the z-axis range listed above.
      endif
      // End of the if-statement for the z-axis of the player listed above.
    endif
    //
    // End of Second Floor - Resource Mining Cart Gathering
    // ------------------------------------------------------------------------
    //
    //
    // ------------------------------------------------------------------------
    // Start of Third Floor - Resource Mining Cart Gathering
    //
    // This is the z-axis of the player.
    if z 'self' == -43
      // This is the z-axis range to look for the cart(s).
      if z 'cart' >= -43 and z 'cart' <= -28
        // As long as the system message doesn't appear, keep doing the command.
        while not @injournal "There are no more resources available at this time." 'system'
          // CAUTION - This is changing the default permission for the mining cart
          // CAUTION - The permission is being set for "Friends" access
          // Click the Mining Cart
          waitforcontext 'cart' 0 15000
          // Click Set Security
          waitforgump 0x29b6c49 15000
          // Friends
          // END OF CAUTION
          replygump 0x29b6c49 3
          useobject 'cart'
          pause 500
        endwhile
        // ^If the system message appears, stop doing the command.
        //If the cart isn't within the z-axis range, ignore it.
      else
        ignoreobject 'cart'
        pause 500
        // End of the if-statement for the z-axis range listed above.
      endif
      // End of the if-statement for the z-axis of the player listed above.
    endif
    //
    // End of Third Floor - Resource Mining Cart Gathering
    // ------------------------------------------------------------------------
    //
    //
    // ------------------------------------------------------------------------
    // Start of Fourth Floor - Resource Mining Cart Gathering
    //
    // This is the z-axis of the player.
    if z 'self' == -23
      // This is the z-axis range to look for the cart(s).
      if z 'cart' >= -23 and z 'cart' <= -8
        // As long as the system message doesn't appear, keep doing the command.
        while not @injournal "There are no more resources available at this time." 'system'
          // CAUTION - This is changing the default permission for the mining cart
          // CAUTION - The permission is being set for "Friends" access
          // Click the Mining Cart
          waitforcontext 'cart' 0 15000
          // Click Set Security
          waitforgump 0x29b6c49 15000
          // Friends
          // END OF CAUTION
          replygump 0x29b6c49 3
          useobject 'cart'
          pause 500
        endwhile
        // ^If the system message appears, stop doing the command.
        //If the cart isn't within the z-axis range, ignore it.
      else
        ignoreobject 'cart'
        pause 500
        // End of the if-statement for the z-axis range listed above.
      endif
      // End of the if-statement for the z-axis of the player listed above.
    endif
    //
    // End of Fourth Floor - Resource Mining Cart Gathering
    // ------------------------------------------------------------------------
    //
    ignoreobject 'cart'
    unsetalias 'cart'
  endwhile
  // ^End of While Loop looking for any mining carts on the ground in range
  //
  // ==========================================================================
  // END OF STEP 01
  // ==========================================================================
  //
  //
  // ==========================================================================
  // START OF STEP 02
  // ==========================================================================
  //
  // If an object is found in the lefthand do these commands
  if findobject 'lefthand'
    turn "East"
    for 2
      walk "East"
    endfor
    unsetalias 'cart bag'
    // Start of While Loop looking for any backpacks on the ground in range
    while @findtype 0xe75 'any' 'ground' 1 1
      // When a backpack is found set name to 'cart bag' and serial to 'found'
      setalias 'cart bag' 'found'
      // Clear the journal
      @clearjournal
      //
      // ----------------------------------------------------------------------
      // Start of First Floor - Putting Mining Cart Resources In Bag
      //
      // This is the z-axis of the player.
      if z 'self' == -83
        // This is the z-axis range to look for the backpacks(s).
        if z 'cart bag' >= -83 and z 'cart bag' <= -68
          // As long as the Tourmaline counter doesn't equal zero (0), keep doing the command.
          while not counter 'cntr-7' == 0
            //Amber
            @movetype 0xf25 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Amethyst
            @movetype 0xf16 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Citrine
            @movetype 0xf15 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Diamond
            @movetype 0xf26 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Emerald
            @movetype 0xf10 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Ruby
            @movetype 0xf13 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Sapphire
            @movetype 0xf19 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Star Sapphire
            @movetype 0xf21 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Tourmaline
            @movetype 0xf2d 'backpack' 'cart bag' 65535 65535 0
            pause 600
          endwhile
          // ^If the counter equals zero (0), stop doing the command.
          //If the backpack isn't within the z-axis range, ignore it.
        else
          ignoreobject 'cart bag'
          pause 500
        endif
      endif
      //
      // End of First Floor - Putting Mining Cart Resources In Bag
      // ----------------------------------------------------------------------
      //
      //
      // ----------------------------------------------------------------------
      // Start of Second Floor - Putting Mining Cart Resources In Bag
      //
      // This is the z-axis of the player.
      if z 'self' == -63
        // This is the z-axis range to look for the backpacks(s).
        if z 'cart bag' >= -63 and z 'cart bag' <= -48
          // As long as the Tourmaline counter doesn't equal zero (0), keep doing the command.
          while not counter 'cntr-7' == 0
            //Amber
            @movetype 0xf25 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Amethyst
            @movetype 0xf16 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Citrine
            @movetype 0xf15 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Diamond
            @movetype 0xf26 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Emerald
            @movetype 0xf10 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Ruby
            @movetype 0xf13 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Sapphire
            @movetype 0xf19 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Star Sapphire
            @movetype 0xf21 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Tourmaline
            @movetype 0xf2d 'backpack' 'cart bag' 65535 65535 0
            pause 600
          endwhile
          // ^If the counter equals zero (0), stop doing the command.
          //If the backpack isn't within the z-axis range, ignore it.
        else
          ignoreobject 'cart bag'
          pause 500
        endif
      endif
      //
      // End of Second Floor - Putting Mining Cart Resources In Bag
      // ----------------------------------------------------------------------
      //
      //
      // ----------------------------------------------------------------------
      // Start of Third Floor - Putting Mining Cart Resources In Bag
      //
      // This is the z-axis of the player.
      if z 'self' == -43
        // This is the z-axis range to look for the backpacks(s).
        if z 'cart bag' >= -43 and z 'cart bag' <= -28
          // As long as the Tourmaline counter doesn't equal zero (0), keep doing the command.
          while not counter 'cntr-7' == 0
            //Amber
            @movetype 0xf25 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Amethyst
            @movetype 0xf16 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Citrine
            @movetype 0xf15 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Diamond
            @movetype 0xf26 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Emerald
            @movetype 0xf10 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Ruby
            @movetype 0xf13 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Sapphire
            @movetype 0xf19 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Star Sapphire
            @movetype 0xf21 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Tourmaline
            @movetype 0xf2d 'backpack' 'cart bag' 65535 65535 0
            pause 600
          endwhile
          // ^If the counter equals zero (0), stop doing the command.
          //If the backpack isn't within the z-axis range, ignore it.
        else
          ignoreobject 'cart bag'
          pause 500
        endif
      endif
      //
      // End of Third Floor - Putting Mining Cart Resources In Bag
      // ----------------------------------------------------------------------
      //
      //
      // ----------------------------------------------------------------------
      // Start of Fourth Floor - Putting Mining Cart Resources In Bag
      //
      // This is the z-axis of the player.
      if z 'self' == -23
        // This is the z-axis range to look for the backpacks(s).
        if z 'cart bag' >= -23 and z 'cart bag' <= -8
          // As long as the Tourmaline counter doesn't equal zero (0), keep doing the command.
          while not counter 'cntr-7' == 0
            //Amber
            @movetype 0xf25 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Amethyst
            @movetype 0xf16 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Citrine
            @movetype 0xf15 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Diamond
            @movetype 0xf26 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Emerald
            @movetype 0xf10 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Ruby
            @movetype 0xf13 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Sapphire
            @movetype 0xf19 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Star Sapphire
            @movetype 0xf21 'backpack' 'cart bag' 65535 65535 0
            pause 600
            //Tourmaline
            @movetype 0xf2d 'backpack' 'cart bag' 65535 65535 0
            pause 600
          endwhile
          // ^If the counter equals zero (0), stop doing the command.
          //If the backpack isn't within the z-axis range, ignore it.
        else
          ignoreobject 'cart bag'
          pause 500
        endif
      endif
      //
      // End of Fourth Floor - Putting Mining Cart Resources In Bag
      // ----------------------------------------------------------------------
      //
      ignoreobject 'cart bag'
      unsetalias 'cart bag'
    endwhile
    // ^End of While Loop looking for any backpacks on the ground in range
    // Disarm
    togglehands 'left'
    // If an object is not found in the lefthand do these commands
  else
    turn "West"
    for 1
      walk "West"
    endfor
    // Rearm
    togglehands 'left'
  endif
  //
  // ==========================================================================
  // END OF STEP 02
  // ==========================================================================
  //
endfor
CAUTION - This is changing the default permission for the mining cart; the permission is being set for "Friends" access. :geek:




kentares
User avatar
Gargl Kark
Posts: 484

Re: Mining cart house guide

Post by Gargl Kark »

ok, I modded this up some more, but I'm not copypasting the code this time. Ultimately it's a little riddle to be solved by anyone who wants to get this to work efficiently.

The challenge to be tackled is:
how to avoid endless cycles without any gems harvested, and how to turn in the gems without any manual ado?

Happy coding :)
Whammy | Timezone: GMT+2

2020-09-17: SALE | Jewels List
kentares likes this.
Top
karik
Posts: 131

Re: Mining cart house guide

Post by karik »

is ther any update for puting the cart? i had a problem tryng to put . they dont go was supose to do. put 1 cart and then wont put the rest
User avatar
kentares
Posts: 673
Location: Houston

Re: Mining cart house guide

Post by kentares »

Good evening, karik,

I haven't made any updates to the cart script in a while. I'll try to get it tested sometime to see if it still works correctly.

Thank you for your patience,



kentares
User avatar
El Kabong
Posts: 29

Re: Mining cart house guide

Post by El Kabong »

kentares wrote: February 2nd, 2022, 10:54 pm Good evening, karik,

I haven't made any updates to the cart script in a while. I'll try to get it tested sometime to see if it still works correctly.

Thank you for your patience,



kentares
I’m not 100% sure but I think your Felucca Keep fell and your Malas house in the desert fell
User avatar
kentares
Posts: 673
Location: Houston

Re: Mining cart house guide

Post by kentares »

Good evening, El Kabong,

Yeah, I found out about the Fel Keep last night. :x I am still mad. Bama is not going to be happy about it either... :oops:

The mining cart house in Malas is fine. I did manage to snag the 18x18 plot in front of it and get all of the characters walked from the Fel Keep to the new Malas 18x18 plot. The new plot will become a tree stump house as soon as the mining house has been completed.

Thank you for the update,



kentares
User avatar
kentares
Posts: 673
Location: Houston

Re: Mining cart house guide

Post by kentares »

karik wrote: February 2nd, 2022, 9:03 pm is ther any update for puting the cart? i had a problem tryng to put . they dont go was supose to do. put 1 cart and then wont put the rest

Code: Select all

promptalias 'north goza'
promptalias 'middle goza'
promptalias 'south goza'
for 6
  // Double-Click Mining Cart Deed
  usetype '0x14f0' 0 'backpack'
  waitforgump 0xdfd9785a 15000
  // Select the South Facing Gem Cart
  //replygump 0xdfd9785a 102
  //Select the East Facing Gem Cart
  replygump 0xdfd9785a 103
  waitfortarget 15000
  // Place the Cart on the 'middle goza'
  target! 'middle goza'
  pause 500
  // Open the Interior Decorator
  usetype! '0xfc1' 0 'backpack'
  waitforgump 0xd47b8107 15000
  // Select the Raise / Up option
  replygump 0xd47b8107 2
  waitforgump 0xd47b8107 15000
  for 3
    waitfortarget 15000
    target! 'north goza'
    waitfortarget 15000
    target! 'middle goza'
    waitfortarget 15000
    target! 'south goza'
  endfor
  pause 250
  canceltarget
endfor
// Open the Interior Decorator
usetype! '0xfc1' 0 'backpack'
waitforgump 0xd47b8107 15000
// Select the Lower / Down option
replygump 0xd47b8107 3
waitforgump 0xd47b8107 15000
for 9
  waitfortarget 15000
  target! 'north goza'
  waitfortarget 15000
  target! 'middle goza'
  waitfortarget 15000
  target! 'south goza'
endfor
// Destroy each goza mat
useobject 'lefthand'
pause 550
target! 'north goza'
pause 550
useobject 'lefthand'
pause 550
target! 'middle goza'
pause 550
useobject 'lefthand'
pause 550
target! 'south goza'
Good evening, karik,

I just tested the code above; and everything is working correctly. The code above only does one row.

Make certain that you:
  • have a hatchet in your left hand
  • that the interior designer is in the backpack but not open (the menu for the interior designer isn't visible / open on the screen)
I hope that this is helpful and thank you for your time,




kentares
karik
Posts: 131

Re: Mining cart house guide

Post by karik »

1 roll you mean the 6 onthe place? or just one? didnt went well here =/
User avatar
Bama
Bug Hunter
Posts: 4617

Re: Mining cart house guide

Post by Bama »

kentares wrote: February 3rd, 2022, 1:33 am Bama is going to


Pull my chin, stroke my hair, scratch my nose, hug my knees
Try drink, food, cigarette, tension will not ease
I tap my fingers, fold my arms, breathe in deep, cross my legs
Shrug my shoulders, stretch my back - but nothing seems to please
Gabba Gabba Hey!!!

哈哈哈
User avatar
kentares
Posts: 673
Location: Houston

Re: Mining cart house guide

Post by kentares »

karik wrote: February 3rd, 2022, 9:41 pm 1 roll you mean the 6 onthe place? or just one? didnt went well here =/
Setting up Mining Carts in Ultima Online - kentares

The script I used in the recording:

Code: Select all

promptalias 'north goza'
promptalias 'middle goza'
promptalias 'south goza'
for 6
  // Double-Click Mining Cart Deed
  usetype '0x14f0' 0 'backpack'
  waitforgump 0xdfd9785a 15000
  // Select the South Facing Gem Cart
  //replygump 0xdfd9785a 102
  //Select the East Facing Gem Cart
  replygump 0xdfd9785a 103
  waitfortarget 15000
  // Place the Cart on the 'middle goza'
  target! 'middle goza'
  pause 500
  // Open the Interior Decorator
  usetype! '0xfc1' 0 'backpack'
  waitforgump 0xd47b8107 15000
  // Select the Raise / Up option
  replygump 0xd47b8107 2
  waitforgump 0xd47b8107 15000
  for 3
    waitfortarget 15000
    target! 'north goza'
    waitfortarget 15000
    target! 'middle goza'
    waitfortarget 15000
    target! 'south goza'
  endfor
  pause 250
  canceltarget
endfor
// Open the Interior Decorator
usetype! '0xfc1' 0 'backpack'
waitforgump 0xd47b8107 15000
// Select the Lower / Down option
replygump 0xd47b8107 3
waitforgump 0xd47b8107 15000
for 9
  waitfortarget 15000
  target! 'north goza'
  waitfortarget 15000
  target! 'middle goza'
  waitfortarget 15000
  target! 'south goza'
endfor
// Destroy each goza mat
useobject 'lefthand'
pause 550
target! 'north goza'
pause 550
useobject 'lefthand'
pause 550
target! 'middle goza'
pause 550
useobject 'lefthand'
pause 550
target! 'south goza'
User avatar
kentares
Posts: 673
Location: Houston

Re: Mining cart house guide

Post by kentares »

Gargl Kark wrote: November 23rd, 2021, 9:06 pm ok, I modded this up some more, but I'm not copypasting the code this time. Ultimately it's a little riddle to be solved by anyone who wants to get this to work efficiently.

The challenge to be tackled is:
how to avoid endless cycles without any gems harvested, and how to turn in the gems without any manual ado?

Happy coding :)
Good afternoon, Gargl Kark,

The challenge to be tackled is:
  1. Avoid endless cycles without any gems harvested
  2. Turn in the gems without any manual ado
Turn in the gems where?

Thank you,




kentares
User avatar
Gargl Kark
Posts: 484

Re: Mining cart house guide

Post by Gargl Kark »

kentares wrote: February 26th, 2022, 7:57 pm Turn in the gems where?
in my case:
sell them and send the gold to the bank
Whammy | Timezone: GMT+2

2020-09-17: SALE | Jewels List
User avatar
kentares
Posts: 673
Location: Houston

Re: Mining cart house guide

Post by kentares »

Gargl Kark wrote: February 27th, 2022, 9:44 am
in my case:
sell them and send the gold to the bank
Thank you, Gargl Kark.

My needs are a bit different; but I am moving away from placing the common gems into individual backpacks.

Consolidating all of the common gems is turning into a steady test of patience.

I am re-working the code; I have added a weight / maxweight check. If the weight is greater than the maxweight it triggers a recall to the front of the mining house. After recalled to the front of the house; I dump the gems using an organizer into a predefined Commodity Deed Box.

The code is pretty ugly to look at; it could be prettier, but it works. Will post when I am done. This was a nice break from work yesterday. Thank you for the challenge. Feel free to make fun of the code after I've posted it.




kentares
Gargl Kark likes this.
Top
User avatar
kentares
Posts: 673
Location: Houston

Re: Mining cart house guide

Post by kentares »

Code: Select all

//With the assistance of many people including: (in alphabetical order)
// * @Bama (yes Bama, does come before A)
// * @Alvin
// * @BCrowly
// * @DeathViper
// * @Gargl Kark
// * @Geaux
// * @Gredras
// * @kobra
// * @MB
// * @MMMartin
// * @mortoburger
// * @otimpyre
// * @preman
// * @The Silvertiger
// * @Spok
//
// If I left you off the list this was entirely by accident PM me and I will edit.
//
// This macro:
//   * Updated 05/15/2021 4:06 a.m. cst. (Version 2.4)
//   * Works with UOSteam
//   * Works anywhere and on any shard
//   * Does not require recording serial numbers of carts
//   * Requires something in the left hand when it begins
//   * Requires a counter for Tourmaline (sorry)
//   * Added additional commenting in code
//
// Documented because I always forget which way they go. :P
// <= less than symbol
// >= greater than symbol
//
// There are eight (8) spots per floor, the loop starts over twice (2) per spot and there are four floors (4)
// this is looped sixty-four (64) times to hit each spot on each floor
//
// First Floor Z-Axis information
// z 'self' == -83
// z 'cart' >= -83 and z 'cart' <= -68
//
// Second Floor Z-Axis information
// z 'self' == -63
// z 'cart' >= -63 and z 'cart' <= -48
//
// Third Floor Z-Axis information
// z 'self' == -43
// z 'cart' >= -43 and z 'cart' <= -28
//
// Fourth Floor Z-Axis information
// z 'self' == -23
// z 'cart' >= -23 and z 'cart' <= -8
//
// Removing previous aliases and ignorelists (cleanup)
@unsetalias 'cart'
@unsetalias 'cart bag'
@unsetalias 'found'
pause 500
clearignorelist
pause 5000
// Completed removing previous aliases and ignorelists
//
// ==========================================================================
// START OF STEP 01
// ==========================================================================
//
// Start of While Loop looking for any mining carts on the ground in range
while @findtype 0x1a88 'any' 'ground' 1 2
  if weight < maxweight
    // When a mining cart is found set name to 'cart' and serial to 'found'
    @setalias 'cart' 'found'
    // Clear the journal
    @clearjournal
    //
    // ------------------------------------------------------------------------
    // Start of First Floor - Resource Mining Cart Gathering
    //
    // This is the z-axis of the player.
    if z 'self' == -83
      // This is the z-axis range to look for the cart(s).
      if z 'cart' >= -83 and z 'cart' <= -68
        // As long as the system message doesn't appear, keep doing the command.
        while not @injournal "There are no more resources available at this time." 'system'
          useobject 'cart'
          pause 500
        endwhile
        // ^If the system message appears, stop doing the command.
        //If the cart isn't within the z-axis range, ignore it.
      else
        ignoreobject 'cart'
        pause 500
        // End of the if-statement for the z-axis range listed above.
      endif
      // End of the if-statement for the z-axis of the player listed above.
    endif
    //
    // End of First Floor - Resource Mining Cart Gathering
    // ------------------------------------------------------------------------
    //
    //
    // ------------------------------------------------------------------------
    // Start of Second Floor - Resource Mining Cart Gathering
    //
    // This is the z-axis of the player.
    if z 'self' == -63
      // This is the z-axis range to look for the cart(s).
      if z 'cart' >= -63 and z 'cart' <= -48
        // As long as the system message doesn't appear, keep doing the command.
        while not @injournal "There are no more resources available at this time." 'system'
          useobject 'cart'
          pause 500
        endwhile
        // ^If the system message appears, stop doing the command.
        //If the cart isn't within the z-axis range, ignore it.
      else
        ignoreobject 'cart'
        pause 500
        // End of the if-statement for the z-axis range listed above.
      endif
      // End of the if-statement for the z-axis of the player listed above.
    endif
    //
    // End of Second Floor - Resource Mining Cart Gathering
    // ------------------------------------------------------------------------
    //
    //
    // ------------------------------------------------------------------------
    // Start of Third Floor - Resource Mining Cart Gathering
    //
    // This is the z-axis of the player.
    if z 'self' == -43
      // This is the z-axis range to look for the cart(s).
      if z 'cart' >= -43 and z 'cart' <= -28
        // As long as the system message doesn't appear, keep doing the command.
        while not @injournal "There are no more resources available at this time." 'system'
          useobject 'cart'
          pause 500
        endwhile
        // ^If the system message appears, stop doing the command.
        //If the cart isn't within the z-axis range, ignore it.
      else
        ignoreobject 'cart'
        pause 500
        // End of the if-statement for the z-axis range listed above.
      endif
      // End of the if-statement for the z-axis of the player listed above.
    endif
    //
    // End of Third Floor - Resource Mining Cart Gathering
    // ------------------------------------------------------------------------
    //
    //
    // ------------------------------------------------------------------------
    // Start of Fourth Floor - Resource Mining Cart Gathering
    //
    // This is the z-axis of the player.
    if z 'self' == -23
      // This is the z-axis range to look for the cart(s).
      if z 'cart' >= -23 and z 'cart' <= -8
        // As long as the system message doesn't appear, keep doing the command.
        while not @injournal "There are no more resources available at this time." 'system'
          useobject 'cart'
          pause 500
        endwhile
        // ^If the system message appears, stop doing the command.
        //If the cart isn't within the z-axis range, ignore it.
      else
        ignoreobject 'cart'
        pause 500
        // End of the if-statement for the z-axis range listed above.
      endif
      // End of the if-statement for the z-axis of the player listed above.
    endif
    //
    // End of Fourth Floor - Resource Mining Cart Gathering
    // ------------------------------------------------------------------------
    //
    //ignoreobject 'cart' <--- this may need to be un-commented. 
    //@unsetalias 'cart' <--- this may need to be un-commented.
  else
    cast "Recall"
    if @injournal "The spell fizzles" 'system'
      @clearjournal
      replay
    endif
    waitfortarget 15000
    target! 0x41083290
    @organizer 'Dumping Gems'
    pause 15000
    //You'll have to customize this to get back into your mining home.
    //It's ugly I know. :(
    turn "East"
    walk "East"
    walk "East"
    walk "East"
    turn "North"
    walk "North"
    walk "North"
    turn "West"
    walk "West"
  endif
endwhile
// ^End of While Loop looking for any mining carts on the ground in range
//
// ==========================================================================
// END OF STEP 01
// ==========================================================================
if @findobject 'lefthand'
  turn "East"
  for 2
    walk "East"
  endfor
  // Disarm
  togglehands 'left'
  // If an object is not found in the lefthand do these commands
else
  turn "West"
  for 1
    walk "West"
  endfor
  // Rearm
  togglehands 'left'
endif
As stated earlier to walking code is really ugly. This script requires the use of recall, a rune, and an organizer to dump the common gems. Mark the rune inside the house; the recall always happens to the same area outside of the house. The walk code then walks you back into your house. In my case it walks me back to my house and onto a House Teleporter so that the code can continue executing. Is this something you're using Gargl Kark? :geek:




kentares
Gargl Kark likes this.
Top
Post Reply