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
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