TimeBomb.

Platform:  mIRC
Published  Aug 12, 2011
Updated  Aug 12, 2011
Timebomb is a game which is very popular on IRC.
So i decided to make one too.
You have random colours (not standard colours)

triggers
!timebomb <nick>
!cutwire <nick>


on *:text:!timebomb *:#:{
if ($2 !ison #) {
msg $chan Who is $2- ?
}
else {
set %timebomb.nick $2
set %timebomb.wire $rand(1,3)
set %timebomb.play 1
describe $chan Gives %timebomb.nick the bomb.
set %timebomb.color.1 $rtbomb
set %timebomb.color.2 $rtbomb
set %timebomb.color.3 $rtbomb
if (%timebomb.color.1 == %timebomb.color2) { set %timebomb.color1 $rtbomb }
if (%timebomb.color.1 == %timebomb.color1) { set %timebomb.color3 $rtbomb }
if (%timebomb.color.3 == %timebomb.color1) { set %timebomb.color3 $rtbomb }


set %timebomb.win %timebomb.color. [ $+ [ $rand(1,3) ] ]
msg $chan %timebomb.nick $+ : There are 3 wires. %timebomb.color.1 , %timebomb.color.2 and %timebomb.color.3
msg $chan %timebomb.nick $+ : Use !cutwire <color> to defuse the bomb. (You have 15 seconds)
echo -at [TimeBomb Debug] nick= $+ %timebomb.nick wire= $+ $timebomb.wire color= $+ %timebomb.win
timerbomb 1 15 kick $chan %timebomb.nick 4BOOM!

}
}
on *:text:!cutwire *:#:{
if ($nick == %timebomb.nick) {
if (%timebomb.play != 1) {
msg $chan There is no bomb in the channel! }
else {
if ($2 == %timebomb.win) { msg $chan $nick has defused the bomb! | unset %timebomb.* | timerbomb off }
else { msg $chan 4BOOM! | kick $chan %timebomb.nick 4BOOM! | unset %timebomb.* | timerbomb off }
else { msg $chan You don't have a bomb YET! }
}
}
}

alias -l rtbomb {
var %tcc red blue yellow orange pink purple cyan brown black gray white green
return $gettok(%tcc,$rand(1,10),32)
}

Comments

Sign in to comment.
Savage_CL   -  Aug 18, 2011
Aha2y, I would use a while loop for the colors... something like this:

Code

 

The premise being it will only the set color if it doesn't exist in %list. When it sets a color, it adds it to %list. Make sense?
 Respond  
Aha2Y   -  Aug 15, 2011
@Veritas

I tried a way to make it not return Color1: Red color2: blue Color3: Red
So it doesn't return two same colors.
 Respond  
PyThOn   -  Aug 12, 2011
Nice thought dude i like this.
By the time all updates r done this will be kool
 Respond  
Veritas   -  Aug 12, 2011
I don't really get this part, can you explain what it does Aha2Y?

Code

 
 Respond  
Jethro   -  Aug 12, 2011
Wow this is the bomb. :p
 Respond  
Aha2Y   -  Aug 12, 2011
Thanks, but do anyone know how to make it not set same colors in like.

"Colors are blue , yellow and blue"
 Respond  
Savage_CL   -  Aug 12, 2011
This looks to me like it would only do one bomb at a time, as the variable names are static. If I may make a few suggestions:

Use hash tables to store information: they are exceptionally faster than variables or ini files and can store tons of data.
I wold have a table per server (use $network for the name). (if you want multi-server that is).

for your alias, you could shorten it using token identifiers like so:

Code

 

(note green is on the same line as "var %tcc")
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.