mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2008
Posts: 167
S
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.
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

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


Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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 # ...
      }
    }...



Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

I thought I did.

* RoCk scratches his head... confused

Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
Oh, thank you so much!

So much confusion over brackets >.<

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Yeaph, RoCk didn't saw your post reply :S


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-

Link Copied to Clipboard