Here;s a few examples of ZMUD triggers for those of you tired of your sad, simple line matching trigs.
^You must use your instrument to sing songs.
#CLASS AutoBot
#CLASS %char
#IF (@song & @target) {
#IF (@singing_loop < 2) {
wie @instrument
singing @song @target
wie @weapon
#ADD singing_loop 1
} {
#ECHO %char, you may not be able to see invis or have outdated instrument or weapon vars!
#VAR singing_loop 0
}
}
This trig wields an instrument and re-casts your bardic spell should you forget to switch out your weapon for an instrument before a cast.
Here's a trigger that calculates how many remorts you have to go before your char is stat perf:
#CLASS %char
#IF @debug {#ECHO %1/%2 STR %4 INT %6 WIS %8 DEX %10 CON %12 CHA}
#VAR charSTR {%1/%2}
#VAR charINT %4
#VAR charWIS %6
#VAR charDEX %8
#VAR charCON %10
#VAR charCHA %12
#MATH stat_count ((18 - %if( %1>18, 18, %1)) + (%if( %2=100, 0, 10 - %number( %left( %2, 1)))) + (18 - %if( %4>18, 18, %4)) + (18 - %if( %6>18, 18, %6)) + (18 - %if( %8>18, 18, %8)) + (18 - %if( %10>18, 18, %10)) + (18 - %if( %12>18, 18, %12)))
#VAR rem_divisor %if( (@class = R) | (@class = B), 4, 3)
#MATH rem2perf ((@stat_count + (@rem_divisor-1) / @rem_divisor))
Here's a trigger that deposits excess coins and ensures you have at least 25000 coins on hand:
^You have (%d) coins
#CLASS {%char}
#VAR carryCash 25000
#VAR coins {%1}
#ECHO carryCash amt: @carryCash
#ECHO current coins: @coins
#ECHO banking flag: @banking
#IF (@banking == 1) {
#IF (%eval( @coins > @carryCash)) {
#ECHO status: coins gt carryCash
#VAR sum %eval( @coins - @carryCash)
deposit @sum
} {
#ECHO status: coins lt carryCash
#VAR sum %eval( @carryCash - @coins)
#IF (@sum < @entire_balance) {#IF (@sum != 0) {withdraw @sum}} {#ECHO insufficient funds\!}
}
}
#ECHO sum was: @sum
