mIRC Home    About    Download    Register    News    Help

Print Thread
#232917 29/06/11 08:00 PM
Joined: Jun 2011
Posts: 5
C
Cheezey Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Jun 2011
Posts: 5
So, this is what I tried to name an array with the users nick.

Code:
set % $+ $nick. [ $+ [ $nick ] ] user
msg $nick % $+ $nick. [ $+ [ $nick ] ]


It should say "user", but it just outputs a percent sign.

How would I do this?

P.S. There are going to be other things in the array once this is figured out. I need an array for each $nick that triggers the remote.


---CHEEZEY---
Cheezey #232918 29/06/11 08:09 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Setting dynamic variables:

Code:
set %nick. $+ $nick user


There's no need for []'s or any kind of evaluation when setting the variable.

* Note that you had $nick twice in the variable name and I don't think you meant to have a variable with the person's nick twice, so I made one of them just part of the variable name. This will have a variable similar to %nick.Cheezey . Yours, if set up right would look like %Cheezey.Cheezey ... most likely not what you wanted.

Reading/Accessing dynamic variables:

Code:
msg $nick $($+(%,nick.,$nick),2)


Breaking that down...
$+() combines items. When used with dynamic variables, the first % should be separated and then each piece of the variable is included with comma separators. Don't put a . or other information directly on an identifier ( $nick. is wrong).

$(,2) evaluates the variable once you create the variable name. The $+() puts together all of the pieces into a variable name and then $(,2) evaluates it so you're able to see what is in the variable.

* You can use []'s instead, but []'s are meant to show order of operation, not for evaluation. They will work in most cases, but it's usually better to use the method shown above so you don't run into problems later.

Last edited by Riamus2; 29/06/11 08:14 PM.

Invision Support
#Invision on irc.irchighway.net
Riamus2 #232919 29/06/11 08:28 PM
Joined: Jun 2011
Posts: 5
C
Cheezey Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Jun 2011
Posts: 5
laugh
It worked. I am happy now.
I wish this forum had a reputation feature, 'cause I would +rep you.


---CHEEZEY---

Link Copied to Clipboard