mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2009
Posts: 4
D
D3matt Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: May 2009
Posts: 4
I'm trying to make my bot change the topicmask and then the topic on a certain command from an "announcement mode" to a "event date mode". Problem is... Nothing about it works. I tried adding echoes to it, not 1 single echo showed up, even 1 at the very beginning of the script. I am truly lost. Every other script from the bot that I make, using the same general form works, except this. I checked to make sure the file was loaded by adding another simple command to the file, and that worked. The code is below:

Code:
on 1000:text:*datetopic*:#:{
  if ($1 == %c $+ datetopic) {
    if (%topicmode == date) {
      .msg chanserv #PD-Reunion topic $readini ini\pd.ini reunion date
      .msg $nick Topic updated to date: $readini ini\pd.ini reunion date
    }
    else {
      .msg chanserv #PD-Reunion set enftopic 499
      .msg chanserv #PD-Reunion set topicmask 0,2Welcome to the official Planet Descent Reunion Games Channel! | http://www.planetdescent.com/ | The next games are at: *
      .msg chanserv #PD-Reunion set enftopic 501
      .msg chanserv #PD-Reunion topic $readini ini\pd.ini reunion date
      set %topicmode date
      .msg $nick Topic changed to display date: $readini ini\pd.ini reunion date
    }
  else { halt }
  }
}

on 1000:text:*announcetopic*:#:{
  if ($1 == %c $+ datetopic) {
    if (%topicmode == announce) {
      .msg chanserv #PD-Reunion topic $readini ini\pd.ini reunion announcement
      .msg $nick Topic updated to display date: $readini ini\pd.ini reunion announcement
    }
    else {
      .msg chanserv #PD-Reunion set enftopic 499
      .msg chanserv #PD-Reunion set topicmask 0,2Welcome to the official Planet Descent Reunion Games Channel! | http://www.planetdescent.com/ | News: *
      .msg chanserv #PD-Reunion set enftopic 501
      .msg chanserv #PD-Reunion topic $readini ini\pd.ini reunion announcement
      set %topicmode announce
      .msg $nick Topic updated to display date: $readini ini\pd.ini reunion announcement
    }
  else { halt }
  }
}

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
No echo's means the script is not triggering, meaning it has nothing to do with the code.

I assume you have multiple of these on text scripts in one file... mIRC will only execute the first matching event of a file, so if you have multiple ON TEXT's, only the first one will work.

Also I assume you use ON 1000 for the other working events...yes?


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: May 2009
Posts: 4
D
D3matt Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: May 2009
Posts: 4
Yes. But I've had plenty of other scripts all using ON the same permission level in the same file that worked. There are 2 commands above these in the file both using ON 1600 that still work too.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
They work, but the on 1000 will not, not at the same time anyway. As I said, only the first matching event in a file will be used. To be perfectly safe, move the event to a separate file or merge the events into one.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
As argv0 said, only the first matching event in a file will trigger. If you have two events definitions that are mutually exclusive then they will both trigger when expected, but if you have two event definitions that can both match a single line of text then only the first one will trigger.

A clear example of this is:
Code:
on *:TEXT:*:*:echo -a This event will trigger for all messages
on *:TEXT:anything:*:echo -a This event will never trigger at all

Joined: May 2009
Posts: 4
D
D3matt Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: May 2009
Posts: 4
There are no commands that would cause this not to trigger.

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Originally Posted By: D3matt
There are no commands that would cause this not to trigger.

mIRC's behaviour causes the second event in my example not to trigger. You may not believe this applies to your case but you should still rule it out by moving the event to another file and seeing if it behaves as expected.

Joined: May 2009
Posts: 4
D
D3matt Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: May 2009
Posts: 4
I beleive a /me facepalms is in order. I'd closed one of the commands above it 1 too many times. whistle


Link Copied to Clipboard