mIRC Home    About    Download    Register    News    Help

Print Thread
#13573 28/02/03 03:41 PM
Joined: Feb 2003
Posts: 6
L
Lag Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Feb 2003
Posts: 6
how would i go about replacing the < > around the names with ( ) .. example= [08:18] <Lag> hi \\\ [08:18] (Lag) hi ...

#13574 28/02/03 05:54 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
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.]

Last edited by Hammer; 02/03/03 12:45 PM.

DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#13575 28/02/03 10:53 PM
Joined: Feb 2003
Posts: 6
L
Lag Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Feb 2003
Posts: 6
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?

#13576 01/03/03 03:58 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
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.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#13577 01/03/03 03:58 PM
Joined: Mar 2003
Posts: 9
M
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
M
Joined: Mar 2003
Posts: 9
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??


---------------
As Far As I Know, there is one positive thing about life......

It ends... laugh
#13578 02/03/03 12:43 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
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*)


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#13579 03/03/03 04:46 AM
Joined: Feb 2003
Posts: 6
L
Lag Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Feb 2003
Posts: 6
how would i go about finding the INPUT thats causing both < > and ( ) to display?

#13580 03/03/03 04:49 AM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
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.

#13581 03/03/03 05:31 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
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.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#13582 04/03/03 08:50 PM
Joined: Feb 2003
Posts: 6
L
Lag Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Feb 2003
Posts: 6
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?

#13583 04/03/03 10:53 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
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.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard