mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2014
Posts: 1
N
Null_ Offline OP
Mostly harmless
OP Offline
Mostly harmless
N
Joined: Mar 2014
Posts: 1
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

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Hmmm, its been a while since I've done anything like this..

What about using:
msg # test: $eval($+(%,%a),2)

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard