on *:TEXT:*Thanks, dude*:#test:{
;Store the username into a variable using $2 and $3 word tokens separated by spaces
var %name $2-3
;Find the token with the "$" character, separate the digit to the left of the first dot, remove the "$" character and store the value in a variable
var %money $remove($gettok($wildtok($1-,*$*,1,32),1,46),$)
if (%name && %money) {
;Add the total amount of money with the received amount of money
%tips_total = $calc(%tips_total + %money)
;Outputting the result to the channel
msg $chan Username: %name , Added money: $+($,%money)
msg $chan Total amount of money: $+($,%tips_total)
}
}