mIRC Homepage
Posted By: Null_ Need help with msg'ing variable - 29/03/14 09:17 AM
Code:
alias test { 
  set %1 4,15| ♦ |
  set %2 4,15| ♥ |
  set %3 1,15| ♠ |
  set %4 1,15| ♣ |
  set %i 0
  :go
  while (%i <= 3) {
    set %a $rand(1,4) | set %b $rand(1,4) | set %c $rand(1,4) | set %d $rand(1,4)
    msg # test: $+(%,%a)
    inc %i
    goto go
  }
}


Im trying to get this code to display a random symbol thats color coded.... Any ideas?

It just displays the variable instead of using it.
ex: test: %2
Posted By: SladeKraven Re: Need help with msg'ing variable - 29/03/14 02:57 PM
Hmmm, its been a while since I've done anything like this..

What about using:
msg # test: $eval($+(%,%a),2)
Posted By: Wims Re: Need help with msg'ing variable - 29/03/14 03:25 PM
You don't need goto and loops to do that confused

Code:
alias getrandchar {
  var %list 9830 9829 9824 9827,%r $r(1,$numtok(%list,32)),%chr $chr($gettok(%list,%r,32))
echo -a no color: %chr -- color index 4: $+($chr(3),04,%chr,$chr(15))
}
$r is the same thing as $rand.
© mIRC Discussion Forums