Haltdef

From Scriptwiki
Revision as of 10:44, 11 September 2006 by Cail (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Stops mIRCs default text for various types of IRC Server events.

/haltdef

To stop mIRCs default text, you need to use the ^ event prefix in the specific event. So you can either use haltdef, that only halts the default text without halting the entire script, or halt, that stops the entire script.

Note that the ^ event doesn't replace your existing event. Your normal event is independent and is still processed whether there is a ^ event in a script or not.

You can check if a script has already halted the default text by using the $halted identifier; it returns $true if a user has used /halt or /haltdef in a ^ event, and $false if not.

The ^ event prefix currently works only on the following types of events: ACTION, BAN, CHAT, DEHELP, DEOP, DEVOICE, HELP, INVITE, JOIN, KICK, MODE, NICK, NOTICE, OP, OPEN, PART, PING, TEXT, UNBAN, USERMODE, VOICE, QUIT, SERV, SERVERMODE, SNOTICE, TOPIC, WALLOPS.

Though, you can use haltdef for raws too, stopping their default output.

Note that halting the default text for an event affects how mIRC displays the most basic information about IRC events to a user, so it should be used carefully.

Example

on ^*:TEXT:*fuck*:*: {
  haltdef
}

This would stop mIRC showing a sentence containing the word "fuck", both in a channel or in private.


on ^*:OPEN:?:*: {
  if ($istok(Spam1 Spam2 eriowj,$nick,32)) {
    halt
  }
}

This example would prevent mIRC from opening a query window if someone is called "Spam1", "Spam2" or "eriowj" and queries you.

on *:INPUT:*: { 
  if (!$ctrlenter && $left($1-,1) != $readini(mirc.ini,text,commandchar)) { 
    haltdef
    echo $color(Own) -tam ( $+ $me $+ ) $1-
    .msg $active $1-
  }
}

on *:TABCOMP:*: {
  haltdef
}

The two above examples allow you to halt the default mIRC actions, note the lack of ^ prefix. The first example changes the look of the text you type and the second halts the tab auto-complete functionality.