This is just a simple coin game I made, since I'm still working on other snippets, plus this was sort of easy to make. The point is to find the hidden coin underneath a space on the puzzle board.
It looks like this:
[1][2][3]
[4][5][6]
So yeah, that's pretty much it, each game goes through 10 boards, so if it seems like forever, it'll end soon. Also, the reason the first space was set to 1-4, instead of 1-2, is because it usually was space 1, and I didn't want that to happen ☼_☼
alias bordize {
set %s1 $r(1,4)
set %s2 $r(1,2)
set %s3 $r(1,2)
set %s4 $r(1,2)
set %s5 $r(1,2)
set %s6 $r(1,2)
set %coinchance on
if (%s1 == 1 ) { set %s1 1 | unset %coinchance | set %coin 1 }
else { set %s1 1 }
if (%s2 == 1) {
if (%coinchance) { set %s2 2 | set %coin 2 | unset %coinchance }
else { set %s2 2 }
}
if (%s2 == 2) { set %s2 2 }
if (%s3 == 1) {
if (%coinchance) {
set %s3 3 | set %coin 3 | unset %coinchance
}
else { set %s3 2 }
}
if (%s3 == 2) { set %s3 3 }
if (%s4 == 1) {
if (%coinchance) {
set %s4 4 | set %coin 4 | unset %coinchance
}
else { set %s4 2 }
}
if (%s4 == 2) { set %s4 4 }
if (%s5 == 1) {
if (%coinchance) {
set %s5 5 | set %coin 5 | unset %coinchance
}
else { set %s5 2 }
}
if (%s5 == 2) { set %s5 5 }
if (%s6 == 1 || %s6 == 2) {
if (%coinchance) {
set %s6 6 | set %coin 6 | unset %coinchance
}
if (!%coinchance) { set %s6 6 }
}
msg %channn [ $+ %s1 $+ ] $+ [ $+ %s2 $+ ] $+ [ $+ %s3 $+ ]
msg %channn [ $+ %s4 $+ ] $+ [ $+ %s5 $+ ] $+ [ $+ %s6 $+ ]
}
on *:text:*:#:{
if ($1 == !target) {
if (!%p1) { set %p1 $nick | msg # $nick has started a game of Target, if you wish to play type !Target }
else {
set %p2 $nick
msg # It's now %p1 vs %p2 $+ , lets see who wins...
msg # In order please type !s <number of the space>, the s stands for 'space', the first person to find where the coin is hidden, gets the point
msg # When both players are ready, please type !ready
}
}
if ($1 == !ready) {
if (!%p1) { msg # There isn't a game going on $Nick $+ . | halt }
elseif ($nick != %p1) && ($nick != %p2) { msg # You aren't in this game $nick $+ ... | halt }
elseif (!%p2) { msg # There needs to be a second player.... | halt }
elseif ($nick == %p1) && (!%2r) { msg # We're now waiting for %p2 to type !ready | set %1r on | halt }
if ($nick == %p2) && (!%1r) { msg # We're now waiting for %p1 to type !ready | set %2r on | halt }
if ($nick == %p1) && (%2r) { msg # Now both players are ready }
if ($nick == %p2) && (%1r) { msg # Now both players are ready }
set %channn #
.timer 1 3 bordize
}
if ($1 == !s) {
if (!%p1) { msg # Sorry but there isn't a game, type !target to start one | halt }
if ($nick != %p1) && ($nick != %p2) { msg # you aren't apart of this game | halt }
if (!%p2) { msg # we need a second player | halt }
if (!$2) { msg # You must choose a space | halt }
if ($2 != %coin) { msg # Wrong space $nick | halt }
else {
msg # $nick got it!
set %channn #
unset %coin
inc %s [ $+ [ $nick ] ]
inc %games
if (%games >= 10) {
msg # Well looks like the scores are %s [ $+ [ %p1 ] ] for %p1 and %s [ $+ [ %p2 ] ] for %p2 $+ , good game!
unset %p*
unset %s*
unset %games
unset %2r
unset %1r
unset %channn
halt
}
.timer 1 2 bordize
halt
}
}
}