Rümßäär's Place of Whatever Visit Phreik Chat Network Techgear 007


 

 Bingo Game
Eloise
Posted: Sep 12 2009, 23:16


Member


Group: Members
Posts: 23
Member No.: 233
Joined: 20-January 06



Hiya wink.gif
Someone I know is trying to get this game to work but it doesn't seem to .. when they type !bcard they get a whisper from the bot but no numbers... I wondered if you could give me some advice plz.
I will let them know about your site and maybe they could follow any advice you give too.
Thanx very much.. in advance

CODE
;;;;;;;;;;;;;;;;;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
 if ($exists(bingo.txt) hload bingo bingo.txt
}
#bingo on
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
   hsave -o bingo bingo.txt
 }
}
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) {
   if ($hget(bingo,bcard $+ $nick)) { halt }
   else 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 bingo
 timer.call off
 hmake bingo 100
 hload bingo bingo.txt
}
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 msgroom if ($nick == $me) raw -q PRIVMSG $1 : $+ $2
alias setallnum {
 var %i = 1
 hadd -m bingo allnum
 while (%i <75> 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.
 stx_addpoints $hget(bingo,winnick) 50
 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
Pete®tje
Posted: Sep 14 2009, 15:13


Forum Owner
Group Icon

Group: Executive
Posts: 576
Member No.: 1
Joined: 12-May 04



I don't really remember that I helped Mail with this script. I think best is to ask Mail about how it is designed to work. I know he hangs out on Phreik every now and then.
Mail
Posted: Nov 4 2009, 10:01


Newbie


Group: Members
Posts: 9
Member No.: 159
Joined: 12-April 05



If you type !bcard and get no numbers in the whisper from the bot, then type /setallnum in the bot window and it should work after that. By the way, Petertje is a modest man. He did supply some of his vast knowledge to get this game working right, I give credit where credit is due. See you around Petertje, you know where to find me.
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | Trivia | Next Newest »


Topic Options



Hosted for free by InvisionFree (Terms of Use: Updated 7/7/05) | Powered by Invision Power Board v1.3 Final © 2003 IPS, Inc.
Archive