guessing game

By ^Alexis^ on Sep 01, 2008

just a basic guessing game. leech/rip w/e

rate & hate

commands:
!number
!guess

ON *:TEXT:!number:#:{ inc %scriptcount | 
  set %number [ $+ [ $chan ] ] $rand(1,999) 
  msg $chan I Have Choosen A Random Number Between: 1 And 999 To Guess What It Is Type: !guess <number> 
} 
ON *:TEXT:!guess*:#:{ inc %scriptcount | 
  if ($2 == %number [ $+ [ $chan ] ]) { msg # WOW nice job!!$nick The Number Was $2 | unset %number [ $+ [ $chan ] ] }  
  elseif ($2 < %number [ $+ [ $chan ] ]) { msg # It's Higher Than  $2 } 
  elseif ($2 > %number [ $+ [ $chan ] ]) { msg # It's Lower Than $2 } 
  else { notice Script Error! } 
} 

Comments

Sign in to comment.
Bluepower10   -  Jan 19, 2009

Works good, but it answers weird.

 Respond  
Blitzjager   -  Jan 18, 2009

Napa posted one that does.
Here's another one. TO change the time between guesses change the 10 in set -u10 %guessact 1

ON *:TEXT:!number:#: {
  if (!%number [ $+ [ $chan ] ]) {
    set %number [ $+ [ $chan ] ] $rand(1,999) 
    msg $chan I Have Chosen A Random Number Between: 1 And 999 To Guess What It Is Type: !guess <number> 
  } 
}
ON *:TEXT:!guess*:#: {
  if (%number [ $+ [ $chan ] ]) && ($2 isnum 1-999) && (!%guessact) {
    set -u10 %guessact 1
    inc %guesses
    if ($2 == %number [ $+ [ $chan ] ]) { msg # WOW nice job!! $nick The Number Was $2 $+ ! It took %guesses guesses. | unset %number [ $+ [ $chan ] ] | unset %scriptcount }
    elseif ($2 < %number [ $+ [ $chan ] ]) { msg # It's Higher Than $2 } 
    elseif ($2 > %number [ $+ [ $chan ] ]) { msg # It's Lower Than $2 } 
    else { echo Script Error! } 
  }
}
 Respond  
Gizb   -  Jan 18, 2009

Just two questions.

How editing the script i can give voice to the person that guesses the correct number

and how can i restrict the time between guesses?

thanks

 Respond  
ChunkieMonkey   -  Nov 04, 2008

{ msg # WOW nice job!!$nick The Number Was $2 |

I found it needs a space between job!! and $nick

otherwise it says what the script says and not the actual $nick

I pointed that out above...Thanks you for bringing back a dead script!

 Respond  
Rottybot   -  Oct 09, 2008

{ msg # WOW nice job!!$nick The Number Was $2 |

I found it needs a space between job!! and $nick

otherwise it says what the script says and not the actual $nick

 Respond  
^Neptune   -  Sep 02, 2008

napa stop... napa-ing things D:

 Respond  
napa182   -  Sep 02, 2008

why not make it all on one on text event like this

ON *:TEXT:*:#:{ 
  if ($strip($1) == !number) { 
    if (!$($+(%,number,$chan),2)) {
      set $+(%,number,$chan) $r(1,100) 
      msg $chan I Have Choosen A Random Number Between: 1 And 100 To Guess What It Is Type: !guess <number> 
    } 
    elseif (!$($+(%,$chan,$nick,yesgame),2)) { msg $chan Game already in progress. Please Type " !guess 1-100 " to play. | set -u5 $+(%,$chan,$nick,yesgame) $nick }
  }
  if ($strip($1) == !guess) && (!$($+(%,flood,$chan),2)) { 
    set -u3 $+(%,flood,$chan) $nick
    if ($($+(%,number,$chan),2)) {
      if (!$2) || ($2 !isnum 1-100) { msg $chan Please pick a number 1-100 ex: !guess 34 }
      elseif ($2 == $($+(%,number,$chan),2)) { msg # WOW nice job!! $nick The Number Was $2 | unset $+(%,number,$chan) }  
      else { msg # $iif($2 < $($+(%,number,$chan),2),It's Higher Than $2,It's Lower Than $2) }
    }
    elseif (!$($+(%,$chan,$nick,nogame),2)) { msg $chan No Game in progress. Please Type " !number " to start a game. | set -u10 $+(%,$chan,$nick,nogame) $nick }
  }
}
 Respond  
DragonFlare   -  Sep 02, 2008

Why did you post the same script twice?
Its Eating Space On Hawkee.
-.-

 Respond  
ChunkieMonkey   -  Sep 01, 2008

And why complicate the script?

 Respond  
ChunkieMonkey   -  Sep 01, 2008
 if ($2 == %number [ $+ [ $chan ] ]) { msg # WOW nice job!!$nick The Number Was $2 | unset %number [ $+ [ $chan ] ] }  

umm..

 if ($2 == %number [ $+ [ $chan ] ]) { msg # WOW nice job!! $+ $nick The Number Was $2 | unset %number [ $+ [ $chan ] ] }  
 Respond  
Firstmate   -  Sep 01, 2008

Add a way to check if a game is already going, that way people don't just keep going !number
!number
!number

Also notice Script Error?
maybe notice $nick Script Error, or notice $me Script Error

 Respond  
^Alexis^   -  Sep 01, 2008

Oh btw, it came with color. and forgot to add it sorry! x.x

 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.