Author Topic: IRC Mafia...  (Read 2937 times)

HackBenjamin

  • Newbie
  • *
  • Posts: 35
IRC Mafia...
« on: July 05, 2008, 11:55:28 PM »
If you know how to play IRC mafia the way I do, then the voiced(+v) users are the alive/playing ones.
This script will give all the voiced users a role that you choose, all you have to do is type /mafiaroles, or /roles.

Code: [Select]
Sub MafiaRoles()
voiced = 0
players = ""
channel = getidentifier("$currentwindow")
servernumber = getidentifier("$csn")
allnicks = nicks(channel,servernumber)
temp = split(allnicks," ")
 for i = 0 to ubound(temp)
  nick = temp(i)
  if isvoice(nick,channel,servernumber) then
   voiced = voiced + 1
   players = players + " " + nick
  end if
 next
  if voiced > 0 then
   temp = split(players," ")
    for x = 1 to ubound(temp)
     nick = temp(x)
     role = inpbox("Chose a role.","Chose a role.")
      sendcommand "/msg " & nick & " Your role is " & role & ".",servernumber
    next
  else
   sendcommand "/echo There aren't any players.",servernumber
  end if
End Sub

Alias:
Code: [Select]
/roles /! MafiaRoles