I found out that I could not use a dynamic variable as the search text in ON (from what I understand), but it is fine to compare things to it in if statements, so I managed to make a workaround:
; OP can change currency name for this channel or clear it without using an argument
ON *:TEXT:!currency*:#:{
if ( $nick !isop $chan ) halt
if ( $2 == $null ) {
unset %currency_name. [ $+ [ $chan ] ]
echo -a currency reset to default
}
else {
set %currency_name. [ $+ [ $chan ] ] $2
echo -a currency set to $2
}
}
;just so you can get the currency name with $curr at any time
alias -l curr return %currency_name. [ $+ [ $chan ] ]
ON *:text:*:#:{
;get the point name for this channel, if $null then use the default "points"
var %curr $curr
if ( %curr == %null ) %curr = points
if ( $( ! $+ %curr ) == $1 ) {
if ( $2 == $null ) {
msg $chan $nick got $lookUpPoints %curr
}
elseif ( ($2 == add) || ($2 == remove) ) {
;command <add|remove> user value
$pointsValue( $2 , $3 , $4 )
}
}
}
Just posting the code in case someone else want to do something like this (if there is some better way to do this then please tell)