mIRC Homepage
Posted By: seanturner70 Why doesn't this work correctly? - 01/06/09 08:40 PM
Code:
...elseif ($read(C...>)) {
      if (($readini(topicsettings.ini,topic,$chan)) == 0) {
        /msg # ...
      }
      elseif (($readini(topicsettings.ini,topic,$chan)) == 1) {
        /topic # $1-
      }
      elseif (($readini(topicsettings.ini,topic,$chan)) == 2) {
        /msg # ...
      }
    }...


What I am trying to do, is have a topic script, with 2 possible settings.
A basic topic - 1
And a topic with !topic, !status, !static, - 2
And 0 means that they haven't chosen what kind they want yet.

The problem I am having, is when you type !topic test, it says: "== Unknown command".

I am not sure how I am supposed to say "If #channel has a number 1, do this command. If it has a number 2, do this one." The help file doesn't answer this question. Can .ini's not be used for this?

Thank you for any help.
Posted By: RoCk Re: Why doesn't this work correctly? - 01/06/09 08:53 PM

You've got extra brackets in your if statements.

Code:

...elseif ($read(C...>)) {
      if ($readini(topicsettings.ini,topic,$chan) == 0) {
        /msg # ...
      }
      elseif ($readini(topicsettings.ini,topic,$chan) == 1) {
        /topic # $1-
      }
      elseif ($readini(topicsettings.ini,topic,$chan) == 2) {
        /msg # ...
      }
    }...

Posted By: westor Re: Why doesn't this work correctly? - 01/06/09 09:33 PM
try using this:

Code:
...elseif ($read(C...>)) {
      if ($readini(topicsettings.ini,topic,$chan) == 0) {
        /msg # ...
      }
      elseif ($readini(topicsettings.ini,topic,$chan) == 1) {
        /topic # $1-
      }
      elseif ($readini(topicsettings.ini,topic,$chan) == 2) {
        /msg # ...
      }
    }...

Posted By: RoCk Re: Why doesn't this work correctly? - 01/06/09 09:43 PM

I thought I did.

* RoCk scratches his head... confused
Posted By: seanturner70 Re: Why doesn't this work correctly? - 01/06/09 10:19 PM
Oh, thank you so much!

So much confusion over brackets >.<
Posted By: westor Re: Why doesn't this work correctly? - 02/06/09 01:09 AM
Yeaph, RoCk didn't saw your post reply :S
© mIRC Discussion Forums