It's a game that allows to people to play in a russian roulette face off. People can type !rroulette to start a game, and wait for someone else to type it to join them in the game, the first person who typed it goes first, the second goes second. Type !trigger to progress throught the game.
alias rrover {
unset %rroul | unset %rroul1 | unset %rroul2 | unset %rroulturn | unset %chamber
}
on *:TEXT:!rroulette*:#: {
if (( %rroul1 == $null )) {
set %rroul1 $nick
set %rroulturn $nick
msg # $nick is ready to face another person in a russian roulette face off, type !rroulette to join them.
timerrroulette 1 20 /msg # I'm afraid no-one wanted to face $nick $+ .
timerrroulette2 1 20 /2prover
}
elseif (( %rroul2 == $null )) && (( $nick != %rroul1 )) {
set %rroul2 $nick
set %rroul on
msg # $nick joins %rroul1 in a russian roulette face off! %rroul1 will go first!
msg # %rroul1 loads 1 bullet, and puts the cylinder inside the revolver, and spins it around
set %chamber $rand(1,6)
timerrroulette off
timerrroulette2 off
}
}
on *:TEXT:!trigger*:#: {
if (( %rroul == on )) {
if (( %rroulturn == $nick )) && (( %2proul1 == $nick )) {
if (( %chamber == 1 )) {
msg # BANG!!!
msg # $nick dies so %rroul2 wins!!
rrover
}
else {
msg # CLICK!!!
msg # $nick lives! They pass the revolver to %rroul2
dec %chamber
set %rroulturn %rroul2
}
}
if (( %rroulturn == $nick )) && (( %rroul2 == $nick )) {
if (( %chamber == 1 )) {
msg # BANG!!!
msg # $nick dies so %rroul1 wins!!
rrover
}
else {
msg # CLICK!!!
msg # $nick lives! They pass the revolver to %rroul1
dec %chamber
set %rroulturn %rroul1
}
}
}
elseif (( $nick == %2proul1 )) && (( %2proul != on )) {
msg # Sorry, there is no second player for you to face $nick $+ .
}
}
I added in a message that reads \"Sorry, there is no second player for you to face $nick $+ .\" If the person is set as player 1 but there is no player 2. Also I put two 20 second timers that are activated when player 1 is set. One messages the channel to say that nobody wanted to face this person and the other unsets the variables. These timers are halted if a second player joins. It works fine for me.
Yeah i think having the elseif condition on nick2 joining to turn it on is interfering with the process. I don\'t see it as an elseif condition.... basically it can\'t work unless two nicks join... granted, but on trigger if there are not two nicks it should msg nick1 something like \"sorry, nobody else is playing\" or an option to play against yourself, which means that nick1 can turn the game on. A timer and message stating \"Waiting 15 seconds for other to join\" could be useful, and then otherwise \" You\'re playing agaisnt yourself\" ... something like that. Setting a roulturn for nick2 might also be necessary to get it going? On !rroulette the chamber might also need to be set.