mIRC Home    About    Download    Register    News    Help

Print Thread
[[TAB]nick #181981 03/08/07 02:23 AM
Joined: Aug 2007
Posts: 1
D
Daniel_Alexandre Offline OP
Mostly harmless
OP Offline
Mostly harmless
D
Joined: Aug 2007
Posts: 1
Would like to have a feature like:

when putted a slash /before TABing a nickname from the buddy list
from one channel it would send the message private to him.
when doubbled slashed //before the Nickname would send both pms and to that channel. To send to both channel and private may be useful in some situations, to alert better the receiver, for instance.

Re: [[TAB]nick [Re: Daniel_Alexandre] #182012 03/08/07 01:08 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
I think this can be scipted, and imho this is a very "special" request, so it should be scripted... smile

TABcomplete is not working with some text (like the /-chars you want to use) preceding the "nick"-chars.

To make it work the way you want, one has to:
1) replace mIRC's default tab completion with a custom one, so that tabcomp will cycle the "nicks" even if they were preceded by one or to /-chars, and keep that chars intact... I'm not able to do that smile
2) script a custom on-input-event, that, when pressing ENTER in the editbox to send the text, checks every token ("word") for a) containing a nickname and b) if containing a nickname: send the text to the channel and / or private - depending on whether or not the nick is preceded by one or two /-chars.

The following code is only a starting point.
It will not TAB-complete any nickname. It will only send the text as private massage to the nick and (if double-slashed) to the chan.

Code:
on *:TABCOMP:#: {
  var %last = $gettok($editbox($active),-1,32)

  ; is the last word starting with a "/"-char?
  if ($left(%last,1) == /) {

    ; besides the last word, is there some text to send?
    if ($deltok($editbox($active),-1,32)) {
      var %text = $v1, %nick = $remove(%last,/)

      ; is the last word, without / or //, a nick on that chan?
      if (%nick ison $chan) {

        ; if double-slahed, send  the text to the active channel
        if ($left(%last,2) == //) { msg $active %text }

        ; anyway, sent the text to nick as private message and clear the editbox
        msg %nick %text
        editbox $chan
      }

      else { echo -a TAB-send: %nick is no nick on $chan }
    }
    else { echo -a TAB-send: no text to send }
  }
}

To see what I mean, add the code to your remotes, then type:
"this is a test text sent only to you /Daniel_Alexandre" and press TAB
"this is a test text sent to you and the channel //Daniel_Alexandre" and press TAB