mIRC Homepage

HELP Display how many times user have used command

Posted By: miiza

HELP Display how many times user have used command - 24/09/21 05:38 PM

Hi guys, I'm trying to make a script that answer how many times the user have used the command.

Here is the script:
Code
on *:TEXT:!count:#: { 
  inc $+(%,count.,$nick)
  msg # $nick you used the count command $(%count.$nick) times!
} 


The thing is, I don't know how to display the variable that has the user in it. Does anyone know how to do it?
Posted By: maroon

Re: HELP Display how many times user have used command - 25/09/21 02:37 AM

Code
//inc -su $+(%,count.,$me) | echo -a $eval( $+(%,count.,$me) ,2) or %count. [ $+ [ $me ] ]


see also https://en.wikichip.org/wiki/mirc/variables#Dynamic_Variable_Names

FYI, if you switch to using a hashtable instead of global variables, you can access the item the same way you created it, without all the [ dynamic ] stuff.

//hinc -smu tablename $+(count.,$me) | echo -a $hget(tablename, $+(count.,$me) )
Posted By: miiza

Re: HELP Display how many times user have used command - 25/09/21 01:31 PM

shocked

Thanks, didn't know about that.
© 2021 mIRC Discussion Forums