mIRC Homepage
Posted By: Iljan variables - 20/01/06 07:47 PM
why does it not function? i'm confused...

Code:
 ON 1:join:#:{ 
set %welcomemsg. $+ $chan $rand(1,99) test $rand(1,99)
/notice $nick %welcomemsg. $+ $chan
} 


When i join the channel a variable is set on %welcomemsg.#test with a number between 1 and 99 the word test then a random number again. but it doen't work to let it say that variabele crazy

It looks logical to me...
Posted By: bwr30060 Re: variables - 20/01/06 07:55 PM
Code:
ON 1:join:#:{ 
set %welcomemsg. [ $+ [ $chan ] ] $rand(1,99) 
test $rand(1,99)
notice $nick %welcomemsg. [ $+ [ $chan ] ]
}

Not sure what you wanted that "test" in there for. The way it is now, it'll send you a notice with a random number, the word test, and another random number. You can call back that first variable by referring to it as %welcomemsg. [ $+ [ $chan ] ]
-Correction- I had the test thing on the same line as the welcome message variable. The test line won't do anything now. If that's not what you want to do, just let me know.
Posted By: FiberOPtics Re: variables - 20/01/06 08:03 PM
notice $nick $($+(%,welcomemsg.,$chan),2)

or

notice $nick %welcomemsg. [ $+ [ $chan ] ]


The setting of the variable was fine, you don't need evaluation brackes/eval there.
Posted By: MikeChat Re: variables - 20/01/06 08:07 PM
Code:
 ON 1:join:#:{ 
set %welcomemsg. $+ $chan $rand(1,99) test $rand(1,99)
/notice $nick %welcomemsg. $+ $chan
} 


you need to use $eval
Code:
ON 1:join:#:{ 
  set %welcomemsg. $+ $chan $rand(1,99) test $rand(1,99)
  /notice $nick $eval($+(%,welcomemsg.,$chan),2)
} 


/help $eval and /help $+ (other identifiers)

Edit:
Too slow I guess haha
Posted By: Iljan Re: variables - 20/01/06 08:15 PM
PERFECT! It works, finaly...
© mIRC Discussion Forums