Jump to content

Timer


wizard1970

Recommended Posts

how i put a timer is this game, lets say.....1 minute

i want put a timer like this

""msg $chan $nick has started a cookie guessing game! guess by saying !cg NUMBER, you have 1 minute""

 

thanks

 

 

on *:TEXT:!cguess*:#:{

if (%numberzz == $null) goto this

if (%numberzz != $null) goto that

:this

msg $chan $nick has started a cookie guessing game! guess by saying !cg NUMBER.

set %numberzz $rand(0,100)

echo 3 -a %numberzz

.notice Sephiroth1n6 the answer is %numberzz

halt

:that

.notice $nick a game is in progress. please wait until the game is over, or you could just type !stopcookie

halt

}

on *:TEXT:!stopcookie*:#:{

if (%numberz != $null) goto not

if (%numberz == $null) goto yup

:not

msg $chan Cookie Guessing Stopped By $nick $+ . The Answer Was %numberz $+ .

unset %numberzz

halt

:yup

.notice $nick There Is Currently No Game In Progress.

halt

}

on *:TEXT:!cg *:#:{

if ($2 > %numberzz) goto greater

if ($2 < %numberzz) goto lesser

if ($2 == %numberzz) goto equal

if (%numberzz == $null) goto whom

else goto what

:greater

msg $chan $nick $+ , That Answer Was Wrong! But Keep Guessing. Try a Lower Number!

halt

:lesser

msg $chan $nick $+ , That Answer Was Wrong! But Keep Guessing. Try a Higher Number!

halt

:equal

msg $chan $nick Guessed The Correct Number of cookies, %numberzz and gets to eat them all!!!

unset %numberzz

halt

:what

halt

:whom .notice $nick there is currently no game in progress. Type !cguess to start a game.

halt

}

Link to comment
Share on other sites

Guest Travis

on *:TEXT:!cguess*:#:{ 
  if (%numberzz == $null) goto this
  if (%numberzz != $null) goto that 
  :this
  msg $chan $nick has started a cookie guessing game! guess by saying !cg NUMBER. You have 1 minute to guess.
  timercg 1 60 /cg_stop $chan
  set %numberzz $rand(0,100)
  echo 3 -a %numberzz
  .notice Sephiroth1n6 the answer is %numberzz
  halt
  :that
  .notice $nick a game is in progress. please wait until the game is over, or you could just type !stopcookie
  halt
}
on *:TEXT:!stopcookie*:#:{
  if ($timer(cg)) { timercg off }
  if (%numberz != $null) goto not
  if (%numberz == $null) goto yup
  :not
  msg $chan Cookie Guessing Stopped By $nick $+ . The Answer Was %numberz $+ .
  unset %numberzz
  halt
  :yup
  .notice $nick There Is Currently No Game In Progress.
  halt
}
on *:TEXT:!cg *:#:{
  if ($2 > %numberzz) goto greater
  if ($2 < %numberzz) goto lesser
  if ($2 == %numberzz) goto equal
  if (%numberzz == $null) goto whom
  else goto what
  :greater
  msg $chan $nick $+ , That Answer Was Wrong! But Keep Guessing. Try a Lower Number!
  halt
  :lesser
  msg $chan $nick $+ , That Answer Was Wrong! But Keep Guessing. Try a Higher Number!
  halt
  :equal
  msg $chan $nick Guessed The Correct Number of cookies, %numberzz and gets to eat them all!!!
  unset %numberzz
  .timercg off
  halt
  :what
  halt
  :whom .notice $nick there is currently no game in progress. Type !cguess to start a game.
  halt
}

alias cg_stop {
  msg $1 Game Over
  unset %numberzz
}

 

This isn't tested.

Edited by Travis
Link to comment
Share on other sites

Guest Travis

timer sends the channel name as $1. I dont know your server. If the room names start with % you can try removing the % and adding it when you join.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...