mIRC Homepage
Posted By: Lag < > vs. ( ) - 28/02/03 03:41 PM
how would i go about replacing the < > around the names with ( ) .. example= [08:18] <Lag> hi \\\ [08:18] (Lag) hi ...
Posted By: Hammer Re: < > vs. ( ) - 28/02/03 05:54 PM
Add the follow lines of code to your remotes (Alt-R):
Code:

  [color:#004400]
;  For channel text someone else types
   [/color]
#Custom.Display.Channel on
 
on ^*:TEXT:*:#:{
  echo $color(normal) -mbflirt $chan $&amp;
    $+($chr(40), $chr(3), $nick($chan, $nick).color, $pcnick($nick), $chr(3), $chr(41)) $1-
  haltdef
}
  [color:#004400]
;  For channel text you type
  [/color]
on *:INPUT:#:{
  if /* !iswm $1- &amp;&amp; $ctrlenter == $false {
    if ($ShouldPrefixOwn) echo $color(own) -mait $&amp;
      $+($chr(40), $chr(3), $nick($chan, $me).color, $pcnick($me), $chr(3), $chr(41)) $1-
    else $&amp;
      echo $color(own) -mait ) $1-
    .msg $active $1-
    halt
  }
}
 
#Custom.Display.Channel end
 [color:#004400] 
;  For query text someone else types
  [/color]
#Custom.Display.Query on
 
on ^*:TEXT:*:?:{
  echo $color(normal) -mbflirt $nick $*
    $+($chr(40), $chr(3), $cnick($nick).color, $nick, $chr(3), $chr(41)) $1-
  haltdef
}
  [color:#004400]
;  For query text you type
  [/color]
on *:INPUT:?:{
  if /* !iswm $1- &amp;&amp; $ctrlenter == $false {
    if ($ShouldPrefixOwn) echo $color(own) -mait $&amp;
      $+($chr(40), $chr(3), $cnick($me).color, $me, $chr(3), $chr(41)) $1-
    else echo $color(own) -mait ) $1-
    .msg $active $1-
    halt
  }
}
#Custom.Display.Query end
  [color:#004400]
;  Return the $pcnick(nick)
;  after checking mirc.ini to see if the $nick($chan, $nick).pnick should be returned.
  [/color]
alias -l pcnick return $iif($gettok($readini($mircini, Options, n2), 30, 44) == 1, $nick($chan, $1).pnick, $1)
  [color:#004400]
;  $ShouldPrefixOwn
;  returns $true or $null, depending on how you have your mIRC set up.
  [/color]
alias -l ShouldPrefixOwn if ($gettok($readini($mircini, Options, n0), 23, 44) == 1) return $true
  [color:#004400]
;  Popup menus to turn channel and query reformatting on and off individually.
  [/color]
menu status,channel,query {
  [color:#004400]
  ;  Main menu: Custom (Nick)
  [/color]
  Custom (Nick)
  [color:#004400]
  ;  Custom (Nick) Submenu: Channel
  [/color]
  .$iif($group(#Custom.Display.Channel) == on, $style(1)) Channel:{
    $iif($group(#Custom.Display.Channel) == on, .disable, .enable) #Custom.Display.Channel
  }
  [color:#004400]
  ;  Custom (Nick) Submenu: Query
  [/color]
  .$iif($group(#Custom.Display.Query) == on, $style(1)) Query:{
    $iif($group(#Custom.Display.Query) == on, .disable, .enable) #Custom.Display.Query
  }
  [color:#004400]
  ;  Custom (Nick) Submenu: Line separator
  [/color]
  .-
  [color:#004400]
  ;  Custom (Nick) Submenu: Both Channel and Query
  [/color]
  .$iif($group(#Custom.Display.Channel) == on, $style(1)) Both:{
    $iif($group(#Custom.Display.Channel) == on, .disable, .enable) #Custom.Display.*
  }
}

For an on TEXT event (which reacts to text someone else types in a query or channel window), you must use the ^ prefix to make the event fire before the normal event fires, thus allowing you to replace the default text (with <nick> blah) with whatever format you prefer. This doesn't apply to your own text because on INPUT fires right after you hit the enter key in the window (query or channel) and no text is echoed to the window until all on INPUT events have completed; therefore, the ^ is not needed.

The actual echo commands use several flags to try to make sure your global settings (Alt-O Options) will be followed even though this is a custom event. -m means that the message you're echoing is a user message as opposed to an event, like on JOIN. -bfl apply your beep/flash/highlight settings to the line being echoed. -r applies your strip settings to the message. -i indents the line 2 spaces, just like mIRC does by itself. -t includes a timestamp prior to the nick if you have timestamping turned on globally.

The $cnick() and $nick($chan, $nick).color identifiers are used to include the same colors you have set up in Alt-B / Nicks or /cnick. The .pnick prefaces nicks with their channel status character, if there is one.

The local identifier (not visible outside this script file) $pcnick(nick) checks to see if you have Alt-O (Options) / IRC / Show mode prefix checked. The local identifier $ShouldPrefixOwn checks to see if you have Alt-O / IRC / Prefix own messages checked.

Three popups are provided to manage the script, available in the Status Window, in any channel or in any query window. They are all grouped under a popup called Custom (Nick). Channel turns channel reformatting on and off, Query turns query reformatting on and off, and Both turns them both on and off (based on the current setting of the Channel reformatting). A check mark will appear beside each of them if they are enabled.

[EDIT: fixed the on INPUT events to actually send the target the text you typed.]
Posted By: Lag Re: < > vs. ( ) - 28/02/03 10:53 PM
thanks, it worked... except now i have another problem. do you have an idea how i could stop this?

[16:51] (Lag) hey
[16:51] <Lag> hey
[16:51] (cHemliFe) hey
[16:51] <cHemliFe> hey
[16:51] (Lag) [censored]
[16:51] <Lag> [censored]
[16:51] (Lag) alright, thanks
[16:51] <Lag> alright, thanks
[16:51] (cHemliFe) lol
[16:51] <cHemliFe> lol
[16:51] (cHemliFe) for what?
[16:51] <cHemliFe> for what?
Posted By: Hammer Re: < > vs. ( ) - 01/03/03 03:58 AM
You have another on INPUT loaded in a file that's loaded after the one you put the script I gave you. So, you have a choice. Either you will have to combine them (if you're a decent scripter, that's not too difficult), halt the second one, or disable the second one.
Posted By: MaxeY Re: < > vs. ( ) - 01/03/03 03:58 PM
Great code!! I've been lokking for something like this for god knows how long.... But when I use the code, other people can't seem to see what I'm writing.... How can I fix this??
Posted By: Hammer Re: < > vs. ( ) - 02/03/03 12:43 PM
Thank you for pointing out a really stupid mistake I made in BOTH on INPUT events. I forgot to actually send the message to the channel/nick!! I will edit the code above to fix that. (OMG!! Duh! *smacks self*)
Posted By: Lag Re: < > vs. ( ) - 03/03/03 04:46 AM
how would i go about finding the INPUT thats causing both < > and ( ) to display?
Posted By: Watchdog Re: < > vs. ( ) - 03/03/03 04:49 AM
From Hammer's script...
Code:
on *:INPUT:?:{
  if /* !iswm $1- &amp;&amp; $ctrlenter == $false {
    if ($ShouldPrefixOwn) echo $color(own) -mait $&amp;
      $+($chr(40), $chr(3), $cnick($me).color, $me, $chr(3), $chr(41)) $1-
    else echo $color(own) -mait ) $1-
    .msg $active $1-
    [color:red]halt[/color]
  }
}
He did it for you by adding halt. That should stop the original text appearing.
Posted By: Hammer Re: < > vs. ( ) - 03/03/03 05:31 AM
If the default <nick> version appears before the altered (nick) version, then the on INPUT event you'll be looking for will be loaded in a file loaded higher in the load order; if the (nick) appears first, then it's in a lower script file.
Posted By: Lag Re: < > vs. ( ) - 04/03/03 08:50 PM
the default <nick> appears after, but i dont know how to find where it's inputing from. there is nothing else in the remote file, would you have any idea where i should look?
Posted By: Hammer Re: < > vs. ( ) - 04/03/03 10:53 PM
Since it appears after the reformatted echoes, it's loaded afterwards -- or you haven't remembered the /halt.
  1. Alt-R (Remotes)
  2. Alt-V (View on the menu bar)
  3. Select the first file
  4. Ctrl-F (Find)
  5. Make sure [X] Search all files in this section is checked
  6. Find text: :INPUT:
  7. [ Find Next ]
  8. The first match you find will most likely be the one you just added (from the above script). Repeat [ Find Next ] until you find another on INPUT script that reformats your output. Repeat these steps for :TEXT: until you have them all.
  9. Either disable the scripts loaded after the one above or unload the script file you find them in, or perhaps just remove the entire event(s) from those files.
If you don't find any other scripts, then you haven't halted the events as shown above.
© mIRC Discussion Forums