Code:
;@@@ Mastermind @@@
on 1:text:*mastermind:#: {
  if (%!mastermind == on) {
    if ($1 == %c $+ mastermind) {
      if ($me !isvoice $chan) {
        MSG $chan Sorry, I've lost the privilege to speak. Try again later when I've been reactivated.
        halt
      }    
      set %fnum $rand(1,9)
      set %snum $rand(1,9)
      set %tnum $rand(1,9)
      set %hnum $rand(1,9)
      set %mnum %fnum $+ %snum $+ %tnum $+ %hnum
      bt $chan The number is %mnum
      	}
    }
  }
  on 1:text:*guess:#: {
    if ($1 == %c $+ guess) {
      if (%mnum == $null) { msg $chan I'm not thinking of a number yet. | halt }
      if ($2 !isnum 1000-9999) { msg $chan Enter a number between 1000 and 9999 | halt }
      if ($2 == %mnum) { 
        	msg $chan You win!
        unset %mnum | halt
        	}
        if ($2 != %mnum) { msg $chan Guess again! | halt }
      }
    }


I did what you suggested and put it into the scripts editor in mIRC (up until now I've been working in notepad, in the folders where the bot actually reads these from...)
Near as I can tell, I have an even number of brackets now and they all line up correctly, but it's telling me I have a bracket mismatch in line 18, the on 1:text:*guess:#: line. It also stops recognizing anything below this in the file with it written like this. When I add another bracket to the bottom, giving me an uneven number, it recognizes everything below this section again, but the editor tells me I have a bracket mismatch in line 4. What do I have screwed up here?

Last edited by Fernin; 25/01/09 06:56 PM.