PennMUSH Community
Show
Ignore:
Timestamp:
07/08/07 20:50:12 (1 year ago)
Author:
shawnw
Message:

Merged 1.8.3p4 into trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 1.8.3/trunk/game/txt/hlp/pennchat.hlp

    r846 r1032  
    3535 
    3636See also: chat, CHAN_USEFIRSTMATCH 
     37& @CHATFORMAT 
     38  @chatformat <object>[= <message>] 
     39 
     40  The @chatformat attribute is evaluated when an object receives 
     41  a channel message. The evaluated result, is displayed to the 
     42  player, otherwise the default message is shown. A null result, 
     43  as long as the attribute exists, shows nothing. 
     44 
     45  Registers: 
     46    %0:  The 'type' of the message. It is a single character that 
     47         will always be set: 
     48           '"', ';' or ':' for say, semipose and pose, respectively. 
     49           '|' for an @cemit. 
     50           '@' for a "system" message - such as "Walker has connected." 
     51    %1:  The channel name. e.g: "Public" "Admin" "Softcode" 
     52    %2:  The message as typed (post-evaluation, if necessary) by the 
     53         speaker.  Be warned, though - If type is '@', then %2 will 
     54         contain the entire message, and will include the name of 
     55         the speaker that caused it. 
     56    %3:  The speaker name, unless channel is set NO_NAME. 
     57    %4:  The speaker's channel title, unless none is set, or the 
     58         channel is NO_TITLE. 
     59    %5:  The original message. 
     60 
     61    If The channel is NO_NAME, and the speaker either has no title or 
     62    the channel is also set NO_TITLE, then %3 will be "Someone" 
     63 
     64(continued in help @chatformat2) 
     65See also: @chat, @pageformat, speak() 
     66& @CHATFORMAT2 
     67  Examples: 
     68 
     69  Walker's preferred @chatformat, which strips all ansi out, wraps 
     70  every line to your width and prefixes them with <ChannelName>: 
     71 
     72    @chatformat me=<%1> [switch(%0,@,%2,edit(wrap(speak(&[if(%4,%4%b)]%3, 
     73         %0[stripansi(%2)]),sub(width(%!),add(4,strlen(%1)))),%r,%r<%1>%b))] 
     74 
     75  If you're on a system with chat_strip_quote set to "no", you might 
     76  want to change the "%0%2" arg to speak() to '[switch(%0,",%2,%0%2)]' 
     77 
     78  Suppose you want it just like the old version, but anytime somebody 
     79  says your name, you want it all in red: 
     80 
     81    @chatformat me=ansi(if(strmatch(%2,*[name(%!)]*),r,n),%5) 
     82 
     83(More examples in help @chatformat3) 
     84& @CHATFORMAT3 
     85  A popular feature in clients now available in PennMUSH directly: 
     86  Let's suppose you want "Public" channel chatter to all be green, 
     87  "Softcode" to be blue and "Admin" to be cyan. 
     88 
     89    @chatformat me=ansi(switch(%1,Public,g,Softcode,b,Admin,c,n),%5) 
     90 
     91  Maybe you dislike players who re-@name themselves a lot: 
     92 
     93    &playernames me=#6061:Walker #7:Javelin #6388:Cheetah 
     94    @chatformat me=<%1> [switch(%0,@,%2,speak(&[if(%4,%4%b)][firstof( 
     95           after(grab(v(playernames),%#:*),:),%3)],%2))] 
     96 
     97  Or you're writing a loggerbot, and you want to convert all channel 
     98  input to HTML: 
     99 
     100    @chatformat me=CHAT:%1:[edit(switch(%0,@,%2,speak(if(%4,%4%b)%3,%0%2)), 
     101           &,&amp;,<,&lt;,>,&gt;,%r,<BR>,%b%b,%b&nbsp;)] 
     102 
     103See also: @chat, @pageformat, speak() 
    37104& CHAN_USEFIRSTMATCH 
    38105  CHAN_USEFIRSTMATCH (any type) 
     
    107174  @channel/mute <channel> = <yes|no> 
    108175  @channel/gag <channel> = <yes|no> 
    109   @channel/recall <channel> [ = <lines>[,<start line>] ] 
     176  @channel/recall <channel> [ = <lines|duration>[,<start line>] ] 
    110177 
    111178  Some channels broadcast messages when players connect or disconnect from 
     
    124191  @channel/recall shows you the most recent messages on the channel; 
    125192  the number of messages depends on how the channel is configured, but 
    126   can be limited by specifying <lines> to show and a <start line> to start 
    127   display from. You must be on a channel to recall from it. 
     193  can be limited by specifying <lines> to show and a <start line> to 
     194  start display from.  If <lines> is an elapsed time, like '1h', 
     195  messages from within the given interval will be recalled.  You must 
     196  be on a channel to recall from it. 
    128197 
    129198  See "help @channel4" for more.