Zallafar's Extras

From Gwen Morse's Wiki
Jump to: navigation, search

;;
;; From Zallafar of Lusternia (Tim Fredenburg)
;;

###########################################################
#
# UTILITIES
#
###########################################################


/def min = /return (%1 < %2 ? %1 : %2 )
/def max = /return (%1 > %2 ? %1 : %2 )


###########################################################
# UniqueName
#
# Make up a unique name that can be used for macros and variables.
# Macro is invisible to make mecho output more understandable.

/set uniqueCount 100
/def -i uniqueName = \
       /set newName unique%uniqueCount %; \
       /set uniqueCount $[uniqueCount + 1] %; \
;       /echo -a %newName %; \
       /result newName


###########################################################
# Compare names

; Return whether two names are the same player, irrespective of case.
; Assumes neither name has a title.
/def sameName = /return  tolower( {1} ) =~ tolower( {2} )