mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2009
Posts: 2
S
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: Feb 2009
Posts: 2
I want to make a script that, when someone enters in a message containing a specified string, removes the offending line. My main objective is to remove join/quit messages for SPECIFIC users. Perhaps there is an easier way to do this?

So far, I have something like an event handler:

on *:TEXT:*** TrAnSiEnT:# ;clear line

Where TrAnSiEnT is the name of the offending user.

My first line of irc script ever, so do I have the right idea?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
What you're wanting to do, is called halting the default display.
Once a line appears in your mIRC window (channel or private, is irrelevant) you can't remove the line from your window.

For joining you want the ON JOIN event.
For parting you want the ON PART event.
For quitting (which is when a person leaves the network and all channels) you want the ON QUIT event.

To halt the default display you use the haltdef command.

Example code:
Code:
on ^*:join:#:{
  if $istok(list of nicks you don't want to see the join information for space separated,$nick,32) {
    haltdef
  }
}


Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
As RusselB suggested, it will block out a user's join message; same goes to the part and quit event:
Code:
on ^*:JOIN:#: {
  if ($nick == TrAnSiEnT) {
    haltdef
  }
}
on ^*:PART:#: {
  if ($nick == TrAnSiEnT) {
    haltdef
  }
}
on ^*:QUIT: {
  if ($nick == TrAnSiEnT) {
    haltdef
  }
}

If you want to block certain strings from what Transient says in the channel, you can use:
Code:
on ^*:TEXT:*:*: {
  var %strings = string1 string2 string3 string4 string5 string6
  if ($nick == TrAnSiEnT) {
    if ($istok(%strings,$1-,32)) {
      haltdef
    }
  }
}

Just replace the sring1, string2, etc...(with a space as shown) with the the specific ones you want to remove them from the user transient.

Last edited by Tomao; 28/02/09 07:09 AM.
Joined: Feb 2009
Posts: 5
L
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
L
Joined: Feb 2009
Posts: 5
Code:
on ^*:join:#hellas:{
  if (($nick != $me) && ($network == grnet)) {
    echo -st 3 $nick ( $address($nick,0) has joined $chan )
    haltdef
  }
}

on ^*:part:#hellas:{
  if (($nick != $me) && ($network == grnet)) {
    echo -st 10 $nick ( $address($nick,0) has left $chan )
    haltdef
  }
}

on ^*:quit:{
  if (($comchan($nick,1) == #hellas) && ($network == grnet)) {
    echo -st 2 $nick [ $address($nick,0) ] has quit IRC)
    haltdef
  }
}


This is what i did for a specific chan.....the only thing is..that if you have a common channel with a nick that parts/quits from the channel you haltdef it shows it in that channel aswell.

Joined: Feb 2009
Posts: 2
S
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: Feb 2009
Posts: 2
Thanks for all the quick replies, guys. I'm very impressed with how active the community is for such a long-lived program like mIRC.

I'm more of a C programmer, by education, so this scripting business has always been tricky for me. I hope that by learning something like mIRC I can do some fun things, so you'll probably all hear from me again :P

One question, the join/quit messages generated by your client (or is it the server?), they are not "text" messages as well? I figured, based on how they're displayed, that they would be similar if not identical to the /me messages.

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Those are echos and only seen by you on your mirc.

/help /echo

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The messages displayed when someone joins, parts, quits, is kicked and/or is banned are recognized by mIRC via the various events. Each of those items has it's own event.

The ON TEXT event, which monitors regular messages does not recognize these messages as text, as they are part of different events.

These are different from information that is echoed, as echoed information is not sent to the server but events are.


Link Copied to Clipboard