mIRC Home    About    Download    Register    News    Help

Print Thread
#139962 20/01/06 07:47 PM
Joined: Mar 2005
Posts: 21
I
Iljan Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Mar 2005
Posts: 21
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...

#139963 20/01/06 07:55 PM
Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
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.

Last edited by bwr30060; 20/01/06 08:02 PM.
#139964 20/01/06 08:03 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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.


Gone.
#139965 20/01/06 08:07 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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

Last edited by MikeChat; 20/01/06 08:08 PM.
#139966 20/01/06 08:15 PM
Joined: Mar 2005
Posts: 21
I
Iljan Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Mar 2005
Posts: 21
PERFECT! It works, finaly...


Link Copied to Clipboard