split players, a gather alias

Paste Your small code(s) here, ex. small aliases, identifiers

split players, a gather alias

Postby Cristian » Thu Oct 16, 2008 6:01 pm

Edited 16/10-08 21.10


Code: Select all
$setplayers(nickname1 nickname2) 

will return

nickname1 / nickname2 / X / X / X / X / X / X / X / X

alias setplayers {
  var %numbers = $numtok($1-,32)
  var %players = $1-
  var %inc = 1

  while (%inc <= %numbers) {
    if (%inc < 10) { var %z = $addtok(%z,$+($gettok(%players,%inc,32),$chr(32),/,$chr(32)),32) }
    else { var %z = $addtok(%z,$+($gettok(%players,%inc,32),$chr(32)),32) }
    inc %inc
  }

  while (%inc <= 10) {
    if (%inc < 10) { var %z = $addtok(%z,$+(X,$chr(32),/,$chr(32)),32) }
    else { var %z = $addtok(%z,$+(X,$chr(32)),32) }
    inc %inc
  }

  return %z
}




Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Return to Mirc Scripting Snippets

Who is online

Users browsing this forum: No registered users and 1 guest

cron