mIRC Home    About    Download    Register    News    Help

Print Thread
Why doesn't this work correctly? #212752 01/06/09 08:40 PM
Joined: Oct 2008
Posts: 167
S
seanturner70 Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
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.

Last edited by seanturner70; 01/06/09 08:41 PM.
Re: Why doesn't this work correctly? [Re: seanturner70] #212753 01/06/09 08:53 PM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021

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 # ...
      }
    }...


Re: Why doesn't this work correctly? [Re: RoCk] #212754 01/06/09 09:33 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
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 # ...
      }
    }...


Re: Why doesn't this work correctly? [Re: westor] #212756 01/06/09 09:43 PM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021

I thought I did.

* RoCk scratches his head... confused

Re: Why doesn't this work correctly? [Re: RoCk] #212757 01/06/09 10:19 PM
Joined: Oct 2008
Posts: 167
S
seanturner70 Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
Oh, thank you so much!

So much confusion over brackets >.<

Re: Why doesn't this work correctly? [Re: seanturner70] #212758 02/06/09 01:09 AM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Yeaph, RoCk didn't saw your post reply :S