Flag Game

By Yoradorc on Jun 09, 2011

Simple game. All you have to do is .flag and answer with the flag's country name.
It has a flood issue though. And I'm not sure how to fix it because I'm still new to this. Please tell me in the comments how can I improve it.

on *:text:*:#: {
  if (.flags == $1) {
    set -u15 %ct = $ctime
    set %flagsnick $nick
    var %item = $rand(1,15)
    if (%item == 1) {
      set -u15 %answer italy
      msg $chan 3,3......0,0......4,4......
      msg $chan 3,3......0,0......4,4......
      msg $chan 3,3......0,0......4,4......
      msg $chan 3,3......0,0......4,4......
      msg $chan 3,3......0,0......4,4......
      msg $chan 3,3......0,0......4,4......
    }
    elseif (%item == 2) {
      set -u15 %answer sweden
      msg $chan 12,12....8,8...12,12...........
      msg $chan 12,12....8,8...12,12...........
      msg $chan 8,8..................
      msg $chan 12,12....8,8...12,12...........
      msg $chan 12,12....8,8...12,12...........
      msg $chan 12,12....8,8...12,12...........
    }
    elseif (%item == 3) {
      set -u15 %answer france
      msg $chan 12,12......0,0......4,4......
      msg $chan 12,12......0,0......4,4......
      msg $chan 12,12......0,0......4,4......
      msg $chan 12,12......0,0......4,4......
      msg $chan 12,12......0,0......4,4......
      msg $chan 12,12......0,0......4,4......
    }
    elseif (%item == 4) {
      set -u15 %answer germany
      msg $chan 1,1..................
      msg $chan 1,1..................
      msg $chan 4,4..................
      msg $chan 4,4..................
      msg $chan 8,8..................
      msg $chan 8,8..................
    }
    elseif (%item == 5) {
      set -u15 %answer hungary
      msg $chan 4,4..................
      msg $chan 4,4..................
      msg $chan 0,0..................
      msg $chan 0,0..................
      msg $chan 3,3..................
      msg $chan 3,3..................
    }
    elseif (%item == 6) {
      set -u15 %answer austria
      msg $chan 4,4..................
      msg $chan 4,4..................
      msg $chan 0,0..................
      msg $chan 0,0..................
      msg $chan 4,4..................
      msg $chan 4,4..................
    }
    elseif (%item == 7) {
      set -u15 %answer indonesia
      msg $chan 4,4..................
      msg $chan 4,4..................
      msg $chan 4,4..................
      msg $chan 0,0..................
      msg $chan 0,0..................
      msg $chan 0,0..................
    }
    elseif (%item == 8) {
      set -u15 %answer poland
      msg $chan 0,0..................
      msg $chan 0,0..................
      msg $chan 0,0..................
      msg $chan 4,4..................
      msg $chan 4,4..................
      msg $chan 4,4..................
    }
    elseif (%item == 9) {
      set -u15 %answer ireland
      msg $chan 3,3......0,0......7,7......
      msg $chan 3,3......0,0......7,7......
      msg $chan 3,3......0,0......7,7......
      msg $chan 3,3......0,0......7,7......
      msg $chan 3,3......0,0......7,7......
      msg $chan 3,3......0,0......7,7......
    }
    elseif (%item == 10) {
      set -u15 %answer spain
      msg $chan 4,4..................
      msg $chan 4,4..................
      msg $chan 8,8..................
      msg $chan 8,8..................
      msg $chan 4,4..................
      msg $chan 4,4..................
    }    
    elseif (%item == 11) {
      set -u15 %answer finland
      msg $chan 0,0....12,12...0,0...........
      msg $chan 0,0....12,12...0,0...........
      msg $chan 12,12..................
      msg $chan 0,0....12,12...0,0...........
      msg $chan 0,0....12,12...0,0...........
      msg $chan 0,0....12,12...0,0...........
    }
    elseif (%item == 12) {
      set -u15 %answer libya
      msg $chan 3,3..................
      msg $chan 3,3..................
      msg $chan 3,3..................
      msg $chan 3,3..................
      msg $chan 3,3..................
      msg $chan 3,3..................
    }    
    elseif (%item == 13) {
      set -u15 %answer portugal
      msg $chan 3,3......4,4............
      msg $chan 3,3......4,4............
      msg $chan 3,3....8,8....4,4..........
      msg $chan 3,3....8,8....4,4..........
      msg $chan 3,3......4,4............
      msg $chan 3,3......4,4............
    }
    elseif (%item == 14) {
      set -u15 %answer angola
      msg $chan 4,4..................
      msg $chan 4,4..................
      msg $chan 4,4.......8,8....4,4.......
      msg $chan 1,1.......8,8....1,1.......
      msg $chan 1,1..................
      msg $chan 1,1..................
    }
    elseif (%item == 15) {
      set -u15 %answer russia
      msg $chan 0,0..................
      msg $chan 0,0..................
      msg $chan 12,12..................
      msg $chan 12,12..................
      msg $chan 4,4..................
      msg $chan 4,4..................
    }
    .timerFlags $+ %answer 1 15 msg $chan Time's Up
  }
  elseif ($nick == %flagsnick) {
  if (($1 == %answer) && ($calc($ctime-%ct) <= 15)) {
      if ($nick == %flagsnick) msg $chan Correct!
      unset %answer
      timerFlags* off
    }
  }
}

Comments

Sign in to comment.
Annaiidziithaa   -  Jul 19, 2011

I prefer to do it this way

on *:text:*:#: {
  if (.flags == $1) {
    set -u15 %ct = $ctime
    set %flagsnick $nick
    var %item = $rand(1,15)
    if (%item == 1) { msg $chan $read italy.txt | msg $chan $read italy2.txt
     set -u15 %answer italy 
    }
    elseif (%item == 2) { msg $chan $read sweden.txt | msg $chan $read sweden2.txt | msg $chan $read sweden3.txt
      set -u15 %answer sweden
    }
    elseif (%item == 3) { msg $chan $read france.txt | msg $chan $read france2.txt
      set -u15 %answer france
    }
    elseif (%item == 4) { msg $chan $read germany.txt | msg $chan $read germany2.txt | msg $chan $read germany3.txt
      set -u15 %answer germany
    }
    elseif (%item == 5) { msg $chan $read hungary.txt | msg $chan $read hungary2.txt | msg $chan $read hungary3.txt
      set -u15 %answer hungary
    }
    elseif (%item == 6) { msg $chan $read austria.txt | msg $chan $read austria2.txt | msg $chan $read austria3.txt
      set -u15 %answer austria
    }
    elseif (%item == 7) { msg $chan $read indonesia.txt | msg $chan $read indonesia2.txt
      set -u15 %answer indonesia
    }
    elseif (%item == 8) { msg $chan $read poland.txt | msg $chan $read poland2.txt
      set -u15 %answer poland
    }
    elseif (%item == 9) { msg $chan $read ireland.txt | msg $chan $read ireland2.txt
      set -u15 %answer ireland
    }
    elseif (%item == 10) { msg $chan $read spain.txt | msg $chan $read spain2.txt | msg $chan $read spain3.txt
      set -u15 %answer spain 
    }    
    elseif (%item == 11) { msg $chan $read finland.txt | msg $chan $read finland2.txt | msg $chan $read finland3.txt
      set -u15 %answer finland
    }
    elseif (%item == 12) { msg $chan $read libya.txt | msg $chan $read libya2.txt
      set -u15 %answer libya
    }    
    elseif (%item == 13) { msg $chan $read portugal.txt | msg $chan $read portugal2.txt | msg $chan $read portugal3.txt
      set -u15 %answer portugal
    }
    elseif (%item == 14) { msg $chan $read angola.txt | msg $chan $read angola2.txt | msg $chan $read angola3.txt | msg $chan $read angola4.txt
      set -u15 %answer angola
    }
    elseif (%item == 15) { msg $chan $read russia.txt | msg $chan $read russia2.txt | msg $chan $read russia3.txt
       set -u15 %answer russia
     }
     .timerFlags $+ %answer 1 15 msg $chan Time's Up
  }
  elseif ($nick == %flagsnick) {
  if (($1 == %answer) && ($calc($ctime-%ct) <= 15)) {
      if ($nick == %flagsnick) msg $chan Very good $nick you guessed the name of the flag!!
      unset %answer
      timerFlags* off
    }
  }
}

List of flags;
http://www.megaupload.com/?d=AWY821AA

I accept all kinds of commentaries: P

 Respond  
Yoradorc   -  Jun 11, 2011

@Memoli
It's supposed to be a channel game.

 Respond  
Memoli   -  Jun 11, 2011

Here is my version for Flag Game :) i used napa182's idea

http://www.hawkee.com/snippet/8718/

 Respond  
blackvenomm666   -  Jun 11, 2011

hehehe

 Respond  
blackvenomm666   -  Jun 11, 2011

good idea napa:D

 Respond  
Yoradorc   -  Jun 11, 2011

I really don't know how to do that napa182.

 Respond  
napa182   -  Jun 10, 2011

odd game, be neat if you made it into a dialog an a 1 person game then have the real flag images pop on the dialog then you have to guess.

 Respond  
blackvenomm666   -  Jun 10, 2011

well if its your room that your doing this in and you have control over it. you can have it set it to moderated only and have no one voiced till after its done. im not quite sure how you have the answering system for it set up. they are supposed to answer after the pic is done correct? because you can easily have it set the mode to moderated on the intial command and then after the flag is done being made you can have it unset it from moderated so they can talk again:)

 Respond  
Yoradorc   -  Jun 10, 2011

Fixed GrimReaper.
That's the Problem Jethro_.

 Respond  
Jethro   -  Jun 09, 2011

Using timer is a good idea, but it gets interrupted if many people talk at once, making the artwork output in segments.

 Respond  
blackvenomm666   -  Jun 09, 2011

as for your flood problem you can use timers for your msg commands

elseif (%item == 4) {
      set -u15 %answer germany
      msg $chan 1,1..................
      .timer 1 1 msg $chan 1,1..................
      .timer 1 3 msg $chan 4,4..................
     .timer 1 5 msg $chan 4,4..................
     .timer 1 7 msg $chan 8,8..................
      msg $chan 8,8..................
    }
 Respond  
GrimReaper   -  Jun 09, 2011

For all your

elseif ((portugal == $1) && ($calc($ctime-%ct) <= 15) && (%answer == portugal)) {
    if ($nick == %flagsnick) msg $chan Correct!
    unset %answer
    timerFlags* off
}

You could have

elseif (($1 == %answer) && ($calc($ctime-%ct) <= 15)) {
      if ($nick == %flagsnick) msg $chan Correct!
      unset %answer
      timerFlags* off
    }

Which you shrink your code by a few lines.

Other than that.. Good work. :)

 Respond  
Jordyk19   -  Jun 09, 2011

Pretty nice.

 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.