|
Joined: Mar 2006
Posts: 25
Ameglian cow
|
OP
Ameglian cow
Joined: Mar 2006
Posts: 25 |
I am trying to add $address($nick,2) to a variable ($nick) everytime someone uses !vop $2 what I have here: on *:text:!vop *:#spelops: {
if ($numtok($($+(%,$2),2),32) == 1) {
set $($+(%,$2),1) $addtok($($+(%,$2),1),$address($nick,2),32)
msg $chan Je stem voor $2 is toegevoegd.
}
if ($($+(%,$2),2) == NULL) {
set $($+(%,$2),1) $address($nick,2)
msg $chan Je stem voor $2 is toegevoegd.
}
} the $($+(%,$2),2) part is the variable in let's say !vop Tekano the $($+(%,$2),2) line is Tekano the set $($+(%,$2),2) $address($nick,2) part works, but here is my problem: this part: set $($+(%,$2),1) $addtok($($+(%,$2),1),$address($nick,2),32) doesn't work. if I change that line to set $($+(%,$2),1) $addtok(%whatever,$address($nick,2),32) this does work, but I need the first one to work.
Last edited by tekano; 31/12/06 11:05 AM.
|
|
|
|
Joined: Apr 2004
Posts: 759
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 759 |
The problem is rather simple $2 is hah set $($+(%,$2),1) $addtok($($+(%,$2),1),$address($nick,2),32) means set %hah $addtok(%hah, *!*@Eggs-49732F81.nott.cable.ntl.com,32) though this does look right by the time mIRC evaluated to this %hah is the literal "%hah" and not a variable. set $($+(%,$2),1) $addtok($($+(%,$2), 2),$address($nick,2),32) Should fix it
$maybe
|
|
|
|
Joined: Mar 2006
Posts: 25
Ameglian cow
|
OP
Ameglian cow
Joined: Mar 2006
Posts: 25 |
thanks a lot is there a list or something where I can find all those standard names etc.?
|
|
|
|
Joined: Apr 2004
Posts: 759
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 759 |
What exactly do you mean by standard names ?
$maybe
|
|
|
|
Joined: Mar 2006
Posts: 25
Ameglian cow
|
OP
Ameglian cow
Joined: Mar 2006
Posts: 25 |
like the $2 is %hah etc.
or why the 2 should be a 1 in this situation.
|
|
|
|
Joined: Apr 2004
Posts: 759
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 759 |
$2 is not %hah per se it was merely an example :P
$() is short for $eval() which allows you to evaluate something 1 or more times
a standard line in the remote is evaluated once with the exeption of a couple of commands that evaluate twice (timer scon and scid)
sometimes however you want something to evaluate more then once the most common situation being dynamic variables.
$+(%,$2) builts a dynamic variable based on whatever $2 holds for example $2 = hah
mirc will evaluate this to %hah however we want the contents of %hah so we need to tell mIRC to evaluate one more time we can do this by using $eval().
$eval($+(%,$2),2) since 1 is the standard evaluation depth we need to use 2
$maybe
|
|
|
|
Joined: Mar 2006
Posts: 25
Ameglian cow
|
OP
Ameglian cow
Joined: Mar 2006
Posts: 25 |
ah, that makes a lot more sense thanks
|
|
|
|
|