This is a Bingo Game I made with assistance from Petertje. Thanks Petertje for teaching me some new things. Any questions feel free to ask me for assistance. Its pretty self explanatory though. Enjoy !!
;;;;;;;;;;;;;;;;;Bingo Game By Mail;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;Credits To Petertje For His Invaluable Assistance;;;;;;;;;;;;;;;;;
menu menubar {
 -
 Bingo
 .$iif($group(#bingo) == on,$style(2),$style(0)) On: .enable #bingo | /msg # S \rTahoma;0 Bingo On | /echo -a Bingo On
 .$iif($group(#bingo) == off,$style(2),$style(0)) Off: .disable #bingo | /msg # S \rTahoma;0 Bingo Off | /echo -a Bingo Off
 .Set Channel:hadd bingo bingochan $chan
 .Start Bingo:start.bingo | msg $hget(bingo,bingochan) The game will begin in 15 seconds.
 .Stop Bingo:bingo.end
}
on *:start: {
 hmake bingo 100
}
on *:JOIN:#: {
 if ($nick != $me) {
  ctcpreply $nick TIME To Play Bingo Type:
!bcard then !bstart.$&
   â€©Type !bcommands For List Of Commands$&
   â€©Right now you need 5 numbers one for each letter for winning.
 }
 if ($nick == $me) {
  hadd -m bingo bingochan $chan
  setallnum
 }
}
#bingo on
on *:text:*:#: {
 if ($1 == !bstart) {
  if (!$hget(bingo)) hmake bingo 100
  hadd bingo bingonick $nick
  msg $hget(bingo,bingochan) The game will begin in 15 seconds.
  start.bingo
 }
 if ($1 == !bcommands) bingo.commands
 if ($1 == !bpause) bingo.pause
 if ($1 == !bresume) bingo.resume
 if ($1 == !bstop) bingo.end
 if ($1 == !bingo) {
  msg $hget(bingo,bingochan) Hold Your Cards While We Check To Verify The Winning Numbers
  hadd -m bingo winnick $nick
  bingo.pause
  checkcard
 }
 if ($1 == !bcard) {
  hadd -m bingo bcard $+ $nick $fillcard
  hadd -m bingo bingochan $chan
  msg $nick Your Bingo Numbers are $hget(bingo,bcard $+ $nick)
 }
 if ($1 == !bobject) {
  msg $hget(bingo,bingochan) The Object Of This Game Is To Match 5 Numbers, One Number From Every Letter From Those The Script Supplies You To The Numbers The Script Calls. Match 5 Numbers, One From Each Letter And Type !bingo
 }
}
alias start.bingo {
 hadd -m bingo toguess $hget(bingo,allnum)
 hadd -m bingo cardinfo $null
 timer.call 0 15 call
}
alias bingo.end {
 msg $hget(bingo,bingochan) To Play Bingo Again Type !bcard Then Type !bstart
; Â hfree -s bingo
 hdel bingo bcard $+ $nick
 hdel bingo bingonick $nick
 hdel bingo cardinfo
 timer.call off
}
alias call {
 if ($hget(bingo,toguess)  == $null) { timer.call off | bingo.end }
 else {
  var %i = $gettok($hget(bingo,toguess),$r(1,$numtok($hget(bingo,toguess),32)),32)
  hadd -m bingo cardinfo $hget(bingo,cardinfo) %i
  hadd -m bingo toguess $remtok($hget(bingo,toguess),%i,1,32)
  msg $hget(bingo,bingochan) $bletter(%i)
 }
}
alias bingo.commands {
 ctcpreply $nick TIME Type:
!bobject ~ To See The Object Of The Game$&
  â€©!bcard ~ To Set The Numbers For Your Card
!bstart ~ To Start Bingo$&
  â€©!bingo ~ If You Think You Have Won
!bstop ~ To End Game$&
  â€©!bpause ~ To Pause The Game
!bresume ~ To Resume The Game$&
  â€©!blackout ~ If You Used All The Numbers On Your Card
}
alias bletter return $mid(bingo,$ceil($calc($1 / 15)),1) $+ $1
alias -l letter return $mid(bingo,$ceil($calc($1 / 15)),1)
alias setallnum {
 var %i = 1
 hadd -m bingo allnum
 while (%i <= 75 ) { hadd bingo allnum $hget(bingo,allnum) %i | inc %i }
}
alias fillcard {
 var %card, %i = 61, %j, %r, %all = $hget(bingo,allnum)
 while (%i > 0) {
  %j = 14
  while (%j > 9) {
   %r = $r(%i,$calc(%j + %i))
   %card = %card $gettok(%all,%r,32)
   %all = $deltok(%all,%r,32)
  dec %j }
 dec %i 15 }
 return $sorttok(%card,32,n)
}
alias bingo.pause {
 timer.call -p Â
 msg $hget(bingo,bingochan) Bingo Paused
}
alias bingo.resume {
 timer.call -r 0 16 call
 msg $hget(bingo,bingochan) Bingo Resumed
}
alias checkcard {
 var %i = 1, %card = $hget(bingo,bcard $+ $hget(bingo,winnick)), %bingo = bingo
 while (%i <= 25) {
  if ($istok($hget(bingo,cardinfo),$gettok(%card,%i,32),32)) {
   %bingo = $remove(%bingo,$letter($gettok(%card,%i,32)))
  }
  inc %i
 }
 $iif(%bingo,losemsg,winmsg)
}
alias winmsg {
 msg $hget(bingo,bingochan) $hget(bingo,winnick) Is The WINNER.
 hdel bingo winnick $nick
 bingo.end
}
alias losemsg {
 msg $hget(bingo,bingochan) Lets Continue Playing $hget(bingo,winnick) Didnt Have The Right Numbers.
 hdel bingo winnick $nick
 bingo.resume
}
#bingo end
Edited May 16, 2005 11:12 PM by Mail