Useful Macro Snippets

bane

Master
Figured I would start posting some pieces of macros that I use all the time. Essentially these are utility snippets.

I Will update this post with new ones I run across or create. I am only going to include snippets that I haven't seen in anyone else's macros to make sure this isn't a boring post.

Prompt user to specify as many containers as they want
This is useful for large production runs of things where a single container's item limit is simply not enough. So a user could specify as many containers as they need to store the items being produced. Only thing you need to be careful with is hitting the house item count at that point.
Code:
//////////////////////////////////////////////////////////////////////////////

// Author: Bane

// Server: UO Forever

//

// Description: This snippet allows a user to select as many containers as they

// need. This is useful for large crafting runs where a single

// container's item limit is not enough

///////////////////////////////////////////////////////////////////////////////

//

// Container graphics ids

// TODO: This list is not complete. Have been adding different container types

// as I go.

if not listexists 'ContainerGraphicIds'

createlist 'ContainerGraphicIds'

endif

clearlist 'ContainerGraphicIds'

@pushlist 0xe43

@pushlist 0xe3f

@pushlist 0xe3e

@pushlist 0xe3c

@pushlist 0xe3d

@pushlist 0xe75

//

// Intitialize our containers.

if not listexists 'Containers'

createlist 'Containers'

headmsg 'You can select multiple containers. When you are done selecting containers...'

pause 6000

headmsg '... select your self to end the selection phase'

pause 2000

while not dead

promptalias 'storageCont'

// Make sure we aren't getting a duplicate container.

if @inlist 'Containers' storageCont

headmsg 'Duplicate container please select again'

pause 1000

continue

endif

for 0 to ContainerGraphicIds

if graphic storageCont == ContainerGraphicIds[]

pushlist 'Containers' storageCont

break

endif

endfor

if not @inlist 'Containers' storageCont

headmsg 'Ending multiselection of containers. Please stand by...'

break

endif

endwhile

headmsg 'Container selection complete.

endif

EDIT 1: Can't seem to get the formatting right. Sorry will update when I have a bit more time.
@amonseti
 
Last edited by a moderator:
Top