I keep seeing people make add-ons that are room or channel specific. People use several different methods to track channel specific add-ons whether it be tokens, hashes, ini files, or some other crazy method. In my quest to minimalize code spam i use an alias to handle all of that for me. Are there any downfalls in using something like this? (It sure makes code a lot cleaner).
alias isflag { return $iif($istok($hget(HASHNAME,$$1),$$2,4),1,0) }
alias togflag { var %t $hget(HASHNAME,$$1) | hadd HASHNAME $$1 $iif($istok(%t,$$2,4),$remtok(%t,$$2,4),$addtok(%t,$$2,4)) }
Using this, each channel add-on becomes
.$style($isflag(logclone,#)) Log Clones: { togflag logclone # }
which is much prettier than the alternative.