mIRC Home    About    Download    Register    News    Help

Print Thread
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?

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
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) )

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.


Link Copied to Clipboard