mIRC Home    About    Download    Register    News    Help

Print Thread
#131843 05/10/05 10:59 AM
Joined: Jul 2005
Posts: 13
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Jul 2005
Posts: 13
Code:
 

;Num Game
on 10:text:*:#:{
  if (!nstart iswm $1) && (!%numg. [ $+ [ $address($nick,2) ] ]) {
    if ($1 != !guess) {    
      set %num $rand(1,99)
      set %ngame 1
      msg # Guessing game is on.    
    }
  } 
  elseif (%ngame == 1) && ($1 == !nguess) && ($2 == $null) {
    notice $nick SYNTAX: !guess <number>
  }
  elseif (!guess* iswm $1) && (%ngame == 0) {
    notice $nick Game is currently down.
    inc -z %numg. [ $+ [ $address($nick,2) ] ] 900 
  }
  elseif (!guess* iswm $1) && ($2 < %num) {
    notice $nick $2 is too low.
    inc -z %numg. [ $+ [ $address($nick,2) ] ] 900
  }
  elseif (!guess* iswm $1) && ($2 > %num) { 
    notice $nick $2 is too high.
    inc -z %numg. [ $+ [ $address($nick,2) ] ] 900 
  }
  elseif (!guess* iswm $1) && ($2 == %num) {
    msg # $2 is Correct! $nick is the winner.
    set %num $rand(1,99)
    hinc -m nwinners %numg. [ $+ [ $nick ] ] %win
  }
 else { 
    notice $nick You must wait $duration(%numg. [ $+ [ $address($nick,2) ] ] )
  }
}  



problem is - the bot is not ignoring :\

hope you can help. smile

#131844 05/10/05 11:28 AM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
if (!nstart iswm $1) && (!%numg. [ $+ [ $address($nick,2) ] ]) {

There's no space between those 2, so the ] is taken as text and not as the evaluation-changing symbol.

#131845 05/10/05 11:42 AM
Joined: Jul 2005
Posts: 13
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Jul 2005
Posts: 13
Now he's telling me how much time left every time I write something that's not starting with !guess,and he's not telling how much time left after I type !guess more then one time. :X

#131846 05/10/05 01:10 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Well, it will always respond because you said that if nothing else is true, to reply with the time. Assuming that part is so that someone has to wait X amount of time between guesses, here's a fix...

(I've also made your code a bit faster for you by splitting out the !guess* iswm section and cleaned it up a bit so that your guesses must include a number after !guess)

Code:
 

;Num Game
on 10:text:*:#:{
  if (!nstart == $1) && (!%numg. [ $+ [ $address($nick,2) ] ]) {
    set %num $rand(1,99)
    set %ngame 1
    msg # Guessing game is on.    
  } 
  elseif ($1 == !guess && $2 isnum) {
    if (%ngame == 0) {
      notice $nick Game is currently down.
      inc -z %numg. [ $+ [ $address($nick,2) ] ] 900 
    }
    elseif (%numg. [ $+ [ $address($nick,2) ] ] != $null) {
      notice $nick You must wait $duration(%numg. [ $+ [ $address($nick,2) ] ] )
    }
    elseif ($2 < %num) {
      notice $nick $2 is too low.
      inc -z %numg. [ $+ [ $address($nick,2) ] ] 900
    }
    elseif ($2 > %num) { 
      notice $nick $2 is too high.
      inc -z %numg. [ $+ [ $address($nick,2) ] ] 900 
    }
    elseif ($2 == %num) {
      msg # $2 is Correct! $nick is the winner.
      set %num $rand(1,99)
      hinc -m nwinners %numg. [ $+ [ $nick ] ] %win
    }
  }
  elseif ($1 == !guess && $2 !isnum) {
    notice $nick SYNTAX: !guess <number>
  }
}  


Last edited by Riamus2; 05/10/05 01:20 PM.

Invision Support
#Invision on irc.irchighway.net
#131847 05/10/05 01:53 PM
Joined: Jul 2005
Posts: 13
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Jul 2005
Posts: 13
Tthanks,but
it's sending twice :X
Code:
  
12(16:52:23) (12~bnz420) !guess 44
12(16:52:24) -prophet- 44 is too high.
12(16:52:24) -prophet- 44 is too high.

#131848 05/10/05 02:20 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Are you sure you don't have your original script in there as well? This shouldn't be able to send it twice. Do a search through all your scripts for "is too high" and see if it's there more than one place.


Invision Support
#Invision on irc.irchighway.net
#131849 05/10/05 05:07 PM
Joined: Jul 2005
Posts: 13
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Jul 2005
Posts: 13
yeah,you were right.
Thank you very very much! smile

#131850 05/10/05 06:01 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
Isn't it much easyer to just download a higher/lower game ?


Link Copied to Clipboard