mIRC Home    About    Download    Register    News    Help

Topic Options
#139962 - 20/01/06 07:47 PM variables
Iljan Offline
Ameglian cow

Registered: 29/03/05
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...

Top
#139963 - 20/01/06 07:55 PM Re: variables
bwr30060 Offline
Fjord artisan

Registered: 23/05/05
Posts: 449
Loc: Georgia USA
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.


Edited by bwr30060 (20/01/06 08:02 PM)
_________________________
Bears on Patrol Chat

Top
#139964 - 20/01/06 08:03 PM Re: variables
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
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.

Top
#139965 - 20/01/06 08:07 PM Re: variables
MikeChat Offline
Hoopy frood

Registered: 12/12/02
Posts: 1245
Loc: California, doooood
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


Edited by MikeChat (20/01/06 08:08 PM)

Top
#139966 - 20/01/06 08:15 PM Re: variables
Iljan Offline
Ameglian cow

Registered: 29/03/05
Posts: 21
PERFECT! It works, finaly...

Top