Originally Posted By: DaveC
did i misss something or cant u just use a format like
on *:TEXT:!trigger *:#:{ what ever here, and the defualt text has displayed already }

?

I do things differently. I use the "^" prefix, because sometimes, I want the TEXT to be displayed differently than usual (i.e. display triggers differently, and don't log them).

Here's part of my remote script:
Code:
;NOTE: This event triggers for EVERY text event.  This works better for my purposes (the stuff I'm not showing below).
ON ^1:TEXT:*:*:{

  ;<<<<<< the rest of my TEXT scripts go here >>>>>>>

  ;[[[[[ TRIGGERS ]]]]]
  if ((%triggers_off) || (%triggers_off. [ $+ [ $chan ] ] ) || (! !isin $1) || (_about isin $1)) goto end
  if ($readini(Misc.ini,triggers,$1) == $null) goto end
  /var %trigger = $ifmatch
  if ((!$gettok(%trigger,1,32)) && ($2)) goto end

  ;>>>>>Current work around to display text normally, doesn't log properly.
  echo $chan $timestamp $+(<,$nick($chan,$nick).pnick,>) $1-

  ;>>>>>The matched ini line contains the corresponding alias to be called, along with needed parameters.
  [ $gettok(%trigger,2-,32) ]
  if ($result != 404) {
    .timer_nick.alert* off
    /event 0,12[ $+ $chan $+ ]14,0<<4 $1 Trigger Used ( $+ $nick $+ ):3 $1-
    /set -u6 %triggers_off. [ $+ [ $chan ] ] 6
  }
  halt

  :end
  ;>>>>Text to ignore:
  if (($1- == @find) || ($1 == !download) || (($left($1- ,1) == !) && ($0 == 1) && (!$readini(Misc.ini,triggers,$1))) /remote_format $1-
;>>>"/remote_format" is an alias that uses "echo -g" with my own custom formatting depending on $event.  In the case of TEXT, it displays with a gray background (and doesn't log, of course).
}



And actually, that last line got me thinking. In addition to providing somewhere to tweak the default text, would it be possible to add something that will temporarily change the color settings? I don't mean something like "[ctrl+K]1,15", because that only covers the length of the text. I mean that entire line (and specifically that line), however many lines it is and changing with window resizes, to have a gray (or whatever) background. Though I guess that might be a little too much to ask for?

To achieve that effect in my "/remote_format" alias, I had to write my own tabbing alias in conjunction with a different ascii space (not 32) which I also use in my "/remote_format" anyway:

Code:
/remote_format {
  if ($event isin "~OP~HELP~VOICE~DEOP~DEHELP~DEVOICE~UNBAN~") {
    if ($1- == %usermode_change. [ $+ [ $chan ] ]) halt
    /set -u1 %usermode_change. [ $+ [ $chan ] ] $1-
  }
  if ($chan) /remote_echo $chan $readini(Misc.ini,format,$event)
  else {
    /var %loop = 0, %nick = $iif($newnick,$newnick,$nick)
    while (%loop < $comchan(%nick,0)) {
      inc %loop
      remote_echo $comchan(%nick,%loop) $readini(Misc.ini,format,$event)
    }
  }
  halt
}
/remote_echo {
  if ($len($3- ) > $readini(Misc.ini,format,maxlen)) /var %text = $left($3- ,$calc($readini(Misc.ini,format,maxlen) - 3)) $+ ...
  else if ($len($3- ) == $readini(Misc.ini,format,maxlen)) /var %text = $3-
  else /var %text = $tabTo($3- $+ $+(»,$calc($readini(Misc.ini,format,maxlen) - 1),»,$chr(160)))

  if ($event == NICK) /echo $1  $+ $2 $+ %text
  else /echo -g $1  $+ $2 $+ ,15 $+ %text
}

/tabTo {
  ;[text]»[number]»[text]»[number]»...

  /tokenize 187 $1-
  /var %num_tok = 2, %spaces, %text = $1

  while (%num_tok < $0) {
    %spaces = $calc($ [ $+ [ %num_tok ] ] - $len($strip(%text)))
    while (%spaces > 0) {
      ;%text = %text 
      %text = %text $+ $chr(160)
      dec %spaces
    }
    inc %num_tok
    %text = %text $+ $ [ $+ [ %num_tok ] ]
    inc %num_tok
  }
  return %text
}

Then I still have to figure out how many spaces are in a line, and make sure my channel windows are all the same size vs the nick list, and make sure I don't change the size of the mirc window, and add an additional alias to cut off text that would stretch more than one line...




In summary (^^;;), the three features I would be happy to see are:

  • /display_default_text
  • /change_color_settings
  • An options menu to tweak default event display settings.

Last edited by CitizenKane; 01/01/07 01:37 AM.