mIRC Home    About    Download    Register    News    Help

Print Thread
HELP Display how many times user have used command #269382 24/09/21 05:38 PM
Joined: Jan 2021
Posts: 5
M
miiza Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Jan 2021
Posts: 5
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?

Re: HELP Display how many times user have used command [Re: miiza] #269384 25/09/21 02:37 AM
Joined: Jan 2004
Posts: 1,620
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,620
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) )

Re: HELP Display how many times user have used command [Re: maroon] #269387 25/09/21 01:31 PM
Joined: Jan 2021
Posts: 5
M
miiza Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Jan 2021
Posts: 5
shocked

Thanks, didn't know about that.