mIRC Homepage
Posted By: LaCN Variable variables :D - 16/05/05 11:21 PM
Hi, I'm making a counting script, which counts words...

so, here's what I did:

- make variable or add 1 to it
set %temp $1
inc $+(%,%temp) 1

but I also could just do: inc $+(%,$1) 1

That's fine, and it works....

now I want it to show to peeps...
so, if they type !show word

it should do something like /msg $chan $2 has been used: %word times

So... I have this:
/msg $chan $2 has been used: $+(%,$2) times

but it outputs %word, in stead of a number frown


In php, I would use: $$word

what can I do ?
Posted By: MikeChat Re: Variable variables :D - 16/05/05 11:33 PM
I'm not going to write any samples for this, but you will want to use a hash table
type /help hash table in mIRC
Posted By: Riamus2 Re: Variable variables :D - 17/05/05 01:43 AM
Try formatting it like:

% [ $+ [ $2 ] ]

That said, a hash table would make more sense.
Posted By: LaCN Re: Variable variables :D - 17/05/05 07:44 AM
Thank you both very much, it works now, and when I have time, I'll check abt those hashtables smile
Posted By: Mpdreamz Re: Variable variables :D - 17/05/05 12:09 PM
$($+(%,$2),2) should work too have it be evaluated a 2nd time
© mIRC Discussion Forums