mIRC Home    About    Download    Register    News    Help

Print Thread
#167829 31/12/06 11:04 AM
Joined: Mar 2006
Posts: 25
T
tekano Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
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:

Code:
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:
Code:
set $($+(%,$2),1) $addtok($($+(%,$2),1),$address($nick,2),32)


doesn't work.

if I change that line to
Code:
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.
tekano #167830 31/12/06 11:25 AM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
The problem is rather simple smile
$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 smile


$maybe
Joined: Mar 2006
Posts: 25
T
tekano Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Mar 2006
Posts: 25
thanks a lot laugh

is there a list or something where I can find all those standard names etc.?

tekano #167834 31/12/06 01:26 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
What exactly do you mean by standard names ? smile


$maybe
Joined: Mar 2006
Posts: 25
T
tekano Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Mar 2006
Posts: 25
like the $2 is %hah etc.

or why the 2 should be a 1 in this situation.

tekano #167838 31/12/06 01:38 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
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
T
tekano Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Mar 2006
Posts: 25
ah, that makes a lot more sense laugh

thanks smile


Link Copied to Clipboard