Unknown2005-04-27 20:49:25
Ken Keys released a new beta of TinyFugue (tf.tcp.com/~hawkeye/tf/). The new beta now supports 256 colors and much more, also fixed a whole slew of bugs and whatnot. With the new release I started poking around a bit more with my old scripts and created a new feature I think everyone will enjoy.
I figured out how to gag all "communication channels" (guild, city, market, tells, etc) and send them to another window (including their color attributes). There is great potential for this code to be used in other ways as well. With a few tweaks you could easily gag and send any text/information to other windows (status, score, time changes, who, etc).
There is no "feature" of TF that does split windows, I do this by taking advantage of a few Linux/Unix/Cygwin programs. TF gives you the ability to send information to "files" with the commands tfopen, tfclose, and tfwrite (see /help tfio). In Linux/Unix/Cygwin you can create files that are really pipes. A pipe doesn't hold/save information like a normal file, it's more a means of transferring data between commands/programs.
For example:
Executing that line in your shell (bash or whatever you use) will run the "find" program, listing all contents of the "/" (root) directory. The output of the find program is piped to the "grep" program, which filters out and displays anything matching "tfrc.tf". The "|" character is a built-in pipe the shell uses. You can create your own pipes using the "mknod" command.
For example:
This command will create a pipe in your current directory named "mypipe". You can now have programs send/receive data from "mypipe", using it to talk to eachother.
What I did first was create pipes for the different channel groups I wanted to display:
This created 5 pipes for me to send/receive data from.
Then I started up a terminal and ran "screen" (www.gnu.org/software/screen/); screen is a program that allows you to run several terminal windows in one window (it splits the screen horizontally as many times as you like, similar to vim/emacs, and run a terminal in each part). I then split the screen window up into 5 separate parts. If you don't want to use screen you could just as easily start 5 separate terminal windows.
In each terminal window I ran the following:
Where PIPENAME is one of the 5 pipes I created up above. Running each of these commands won't appear to do anything, it won't even give you a new line to run any commands. What it's doing is waiting for input to come from the different PIPENAME's, so that it can display it.
Now you'll want to open a new terminal window and startup tf with the following code included in your scripts (adjusted slightly to reflect the channels you're wishing to display, the location of your created pipes, and the proper line for your prompt if you're not running with CONFIG PROMPT ALL):
First the code opens each of those 5 pipes for writing. Then it creates triggers for all of your channels. When a channel communication is spotted, TF will do a few different things.
First it will gag the line that triggered it, encode it with the ansi color codes that terminals understand, and then send it to the pipes you created where it will instantly be displayed. Next it creates a trigger that catches everything; this new trigger does the same thing as the first, gagging/encoding the text and passing it along to the correct pipe.
There is also a prompt trigger that is always running. Whenever the prompt trigger sees your prompt it checks to see if you are grabbing a communication channel. If you are it deletes that trigger, if you're not it does nothing. Since all communication channels start with a certain pattern and end with a prompt, this code will catch all lines (not just the first one).
One thing you should take note of:
On my Debian system I HAD to have the 5 terminals open with the "cat < PIPENAME" commands running BEFORE I ran TF with that code. If I ran TF first without having the other terminals open, TF would hang and I had to CTRL-C to kill the triggers. I'm not certain if this behavior will be the same on all systems, but I just thought I'd give you a heads-up.
I solved this problem by creating an interface to the above script. I'll post it in a reply to this post.
Below is a screenshot of this script in action:
I figured out how to gag all "communication channels" (guild, city, market, tells, etc) and send them to another window (including their color attributes). There is great potential for this code to be used in other ways as well. With a few tweaks you could easily gag and send any text/information to other windows (status, score, time changes, who, etc).
There is no "feature" of TF that does split windows, I do this by taking advantage of a few Linux/Unix/Cygwin programs. TF gives you the ability to send information to "files" with the commands tfopen, tfclose, and tfwrite (see /help tfio). In Linux/Unix/Cygwin you can create files that are really pipes. A pipe doesn't hold/save information like a normal file, it's more a means of transferring data between commands/programs.
For example:
CODE
find / | grep tfrc.tf
Executing that line in your shell (bash or whatever you use) will run the "find" program, listing all contents of the "/" (root) directory. The output of the find program is piped to the "grep" program, which filters out and displays anything matching "tfrc.tf". The "|" character is a built-in pipe the shell uses. You can create your own pipes using the "mknod" command.
For example:
CODE
mknod mypipe p
This command will create a pipe in your current directory named "mypipe". You can now have programs send/receive data from "mypipe", using it to talk to eachother.
What I did first was create pipes for the different channel groups I wanted to display:
CODE
mknod comm_city p
mknod comm_guild p
mknod comm_market p
mknod comm_tells p
mknod comm_other p
mknod comm_guild p
mknod comm_market p
mknod comm_tells p
mknod comm_other p
This created 5 pipes for me to send/receive data from.
Then I started up a terminal and ran "screen" (www.gnu.org/software/screen/); screen is a program that allows you to run several terminal windows in one window (it splits the screen horizontally as many times as you like, similar to vim/emacs, and run a terminal in each part). I then split the screen window up into 5 separate parts. If you don't want to use screen you could just as easily start 5 separate terminal windows.
In each terminal window I ran the following:
CODE
cat < PIPENAME
Where PIPENAME is one of the 5 pipes I created up above. Running each of these commands won't appear to do anything, it won't even give you a new line to run any commands. What it's doing is waiting for input to come from the different PIPENAME's, so that it can display it.
Now you'll want to open a new terminal window and startup tf with the following code included in your scripts (adjusted slightly to reflect the channels you're wishing to display, the location of your created pipes, and the proper line for your prompt if you're not running with CONFIG PROMPT ALL):
CODE
/set redirecting_comm no
/set comm_channel=
/eval /set comm_city $
/eval /set comm_guild $
/eval /set comm_tells $
/eval /set comm_market $
/eval /set comm_other $
/def -mregexp -n0 -p2 -q -h"PROMPT (\\d+)h, (\\d+)m, (\\d+)e, (\\d+)p, (\\d+)en, (\\d+)w (.*)\\-" comm_prompt_catch = \\
  /if ({redirecting_comm} =~ "yes") \\
    /undef catch_all_comm %; \\
    /set redirecting_comm no %; \\
  /endif
/def catch_multiline_comm = \\
  /set redirecting_comm yes %; \\
  /set comm_channel $ %; \\
  /test comm_channel:=%{comm_channel} %; \\
  /def -mregexp -n0 -ag -t".*" catch_all_comm = /test tfwrite({comm_channel},encode_ansi({P0}))
; city channels
/def -mregexp -n0 -ag -t"^\\(Magnagora\\):.+$" comm_city_catch = \\
  /test tfwrite({comm_city},encode_ansi({P0})) %; \\
  /catch_multiline_comm city
; guild channels
/def -mregexp -n0 -ag -t"^\\(Ur'guard\\):.+$" comm_guild_catch1 = \\
  /test tfwrite({comm_guild},encode_ansi({P0})) %; \\
  /catch_multiline_comm guild
/def -mregexp -n0 -ag -t"^\\(Grunts\\):.+$" comm_guild_catch2 = \\
  /test tfwrite({comm_guild},encode_ansi({P0})) %; \\
  /catch_multiline_comm guild
/def -mregexp -n0 -ag -t"^\\(The Barracks\\):.+$" comm_guild_catch3 = \\
  /test tfwrite({comm_guild},encode_ansi({P0})) %; \\
  /catch_multiline_comm guild
; tells channel
/def -mregexp -n0 -ag -t"^You tell.+$" comm_tells_catch1 = \\
  /test tfwrite({comm_tells},encode_ansi({P0})) %; \\
  /catch_multiline_comm tells
/def -mregexp -n0 -ag -t"^\\w+ tells you.+$" comm_tells_catch2 = \\
  /test tfwrite({comm_tells},encode_ansi({P0})) %; \\
  /catch_multiline_comm tells
; market channel
/def -mregexp -n0 -ag -t"^\\(Market\\):.+$" comm_market_catch = \\
  /test tfwrite({comm_market},encode_ansi({P0})) %; \\
  /catch_multiline_comm market
; other channels
/def -mregexp -n0 -ag -t"^\\(Newbie\\):.+$" comm_other_catch1 = \\
  /test tfwrite({comm_other},encode_ansi({P0})) %; \\
  /catch_multiline_comm other
/def -mregexp -n0 -ag -t"^\\(Noctus Altus\\):.+$" comm_other_catch2 = \\
  /test tfwrite({comm_other},encode_ansi({P0})) %; \\
  /catch_multiline_comm other
/set comm_channel=
/eval /set comm_city $
/eval /set comm_guild $
/eval /set comm_tells $
/eval /set comm_market $
/eval /set comm_other $
/def -mregexp -n0 -p2 -q -h"PROMPT (\\d+)h, (\\d+)m, (\\d+)e, (\\d+)p, (\\d+)en, (\\d+)w (.*)\\-" comm_prompt_catch = \\
  /if ({redirecting_comm} =~ "yes") \\
    /undef catch_all_comm %; \\
    /set redirecting_comm no %; \\
  /endif
/def catch_multiline_comm = \\
  /set redirecting_comm yes %; \\
  /set comm_channel $ %; \\
  /test comm_channel:=%{comm_channel} %; \\
  /def -mregexp -n0 -ag -t".*" catch_all_comm = /test tfwrite({comm_channel},encode_ansi({P0}))
; city channels
/def -mregexp -n0 -ag -t"^\\(Magnagora\\):.+$" comm_city_catch = \\
  /test tfwrite({comm_city},encode_ansi({P0})) %; \\
  /catch_multiline_comm city
; guild channels
/def -mregexp -n0 -ag -t"^\\(Ur'guard\\):.+$" comm_guild_catch1 = \\
  /test tfwrite({comm_guild},encode_ansi({P0})) %; \\
  /catch_multiline_comm guild
/def -mregexp -n0 -ag -t"^\\(Grunts\\):.+$" comm_guild_catch2 = \\
  /test tfwrite({comm_guild},encode_ansi({P0})) %; \\
  /catch_multiline_comm guild
/def -mregexp -n0 -ag -t"^\\(The Barracks\\):.+$" comm_guild_catch3 = \\
  /test tfwrite({comm_guild},encode_ansi({P0})) %; \\
  /catch_multiline_comm guild
; tells channel
/def -mregexp -n0 -ag -t"^You tell.+$" comm_tells_catch1 = \\
  /test tfwrite({comm_tells},encode_ansi({P0})) %; \\
  /catch_multiline_comm tells
/def -mregexp -n0 -ag -t"^\\w+ tells you.+$" comm_tells_catch2 = \\
  /test tfwrite({comm_tells},encode_ansi({P0})) %; \\
  /catch_multiline_comm tells
; market channel
/def -mregexp -n0 -ag -t"^\\(Market\\):.+$" comm_market_catch = \\
  /test tfwrite({comm_market},encode_ansi({P0})) %; \\
  /catch_multiline_comm market
; other channels
/def -mregexp -n0 -ag -t"^\\(Newbie\\):.+$" comm_other_catch1 = \\
  /test tfwrite({comm_other},encode_ansi({P0})) %; \\
  /catch_multiline_comm other
/def -mregexp -n0 -ag -t"^\\(Noctus Altus\\):.+$" comm_other_catch2 = \\
  /test tfwrite({comm_other},encode_ansi({P0})) %; \\
  /catch_multiline_comm other
First the code opens each of those 5 pipes for writing. Then it creates triggers for all of your channels. When a channel communication is spotted, TF will do a few different things.
First it will gag the line that triggered it, encode it with the ansi color codes that terminals understand, and then send it to the pipes you created where it will instantly be displayed. Next it creates a trigger that catches everything; this new trigger does the same thing as the first, gagging/encoding the text and passing it along to the correct pipe.
There is also a prompt trigger that is always running. Whenever the prompt trigger sees your prompt it checks to see if you are grabbing a communication channel. If you are it deletes that trigger, if you're not it does nothing. Since all communication channels start with a certain pattern and end with a prompt, this code will catch all lines (not just the first one).
One thing you should take note of:
On my Debian system I HAD to have the 5 terminals open with the "cat < PIPENAME" commands running BEFORE I ran TF with that code. If I ran TF first without having the other terminals open, TF would hang and I had to CTRL-C to kill the triggers. I'm not certain if this behavior will be the same on all systems, but I just thought I'd give you a heads-up.
I solved this problem by creating an interface to the above script. I'll post it in a reply to this post.
Below is a screenshot of this script in action:
Manjanaia2005-04-27 20:55:01
That's damn cool. *peer Java*
Unknown2005-04-27 21:03:05
I liked having my communications split amongst different windows, but I wanted a little more flexability. Sometimes I just want to connect real quick to check messages and not have to start up all those other windows. I also thought it would be handy to have all communications redirected to 1 separate window.
The following script works the same way as the one above. Basically, I started with the one above and added/re-arranged parts to get this new one.
With this script you dont have to have the 5 separate windows up and running before you start TF. When you start TF there is no channel redirection, it starts off with everything in one window. You now have a new command (alias) though, "comm_redirect".
"comm_redirect split" will redirect your comm channels to those 5 windows as in the script above. Make sure you have the windows created and running before you run this command (same as before).
"comm_redirect single" will redirect you comm channels to a single window. I created a new pipe, comm_all, for this. Make sure you have another window created and running "cat < comm_all" before you run this command.
"comm_redirect off" turns off the redirecting and sends everything to your TF window as normal.
Here's the code:
The following script works the same way as the one above. Basically, I started with the one above and added/re-arranged parts to get this new one.
With this script you dont have to have the 5 separate windows up and running before you start TF. When you start TF there is no channel redirection, it starts off with everything in one window. You now have a new command (alias) though, "comm_redirect".
"comm_redirect split" will redirect your comm channels to those 5 windows as in the script above. Make sure you have the windows created and running before you run this command (same as before).
"comm_redirect single" will redirect you comm channels to a single window. I created a new pipe, comm_all, for this. Make sure you have another window created and running "cat < comm_all" before you run this command.
"comm_redirect off" turns off the redirecting and sends everything to your TF window as normal.
Here's the code:
CODE
/set redirecting_status off
/set redirecting_comm no
/set comm_channel=
/def comm_redirect_cleanup = \\
  /if (({redirecting_status} =~ "single") | ({redirecting_status} =~ "split")) \\
    /undef comm_prompt_catch %; \\
    /undef catch_multiline_comm %; \\
    /undef comm_city_catch %; \\
    /undef comm_guild_catch1 %; \\
    /undef comm_guild_catch2 %; \\
    /undef comm_guild_catch3 %; \\
    /undef comm_tells_catch1 %; \\
    /undef comm_tells_catch2 %; \\
    /undef comm_market_catch %; \\
    /undef comm_other_catch1 %; \\
    /undef comm_other_catch2 %; \\
  /endif %; \\
  /if ({redirecting_status} =~ "single") \\
    /test tfclose({comm_all}) %; \\
    /unset comm_all %; \\
  /elseif ({redirecting_status} =~ "split") \\
    /test tfclose({comm_city}) %; \\
    /test tfclose({comm_guild}) %; \\
    /test tfclose({comm_tells}) %; \\
    /test tfclose({comm_market}) %; \\
    /test tfclose({comm_other}) %; \\
    /unset comm_city %; \\
    /unset comm_guild %; \\
    /unset comm_tells %; \\
    /unset comm_market %; \\
    /unset comm_other %; \\
  /endif
/def comm_redirect_single = \\
  /eval /set comm_all $ %; \\
  /def -mregexp -n0 -p2 -q -h"PROMPT (\\\\d+)h, (\\\\d+)m, (\\\\d+)e, (\\\\d+)p, (\\\\d+)en, (\\\\d+)w (.*)\\\\-" comm_prompt_catch = \\
    /if ({redirecting_comm} =~ "yes") \\
      /undef catch_all_comm %%; \\
      /set redirecting_comm no %%; \\
    /endif %; \\
  /def catch_multiline_comm = \\
    /set redirecting_comm yes %%; \\
    /def -mregexp -n0 -ag -t".*" catch_all_comm = /test tfwrite({comm_all},encode_ansi({P0})) %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Magnagora\\\\):.+\\$" comm_city_catch = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Ur'guard\\\\):.+\\$" comm_guild_catch1 = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Grunts\\\\):.+\\$" comm_guild_catch2 = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^\\\\(The Barracks\\\\):.+\\$" comm_guild_catch3 = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^You tell.+\\$" comm_tells_catch1 = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^\\\\w+ tells you.+\\$" comm_tells_catch2 = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Market\\\\):.+\\$" comm_market_catch = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Newbie\\\\):.+\\$" comm_other_catch1 = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Noctus Altus\\\\):.+\\$" comm_other_catch2 = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm
/def comm_redirect_split = \\
  /eval /set comm_city $ %; \\
  /eval /set comm_guild $ %; \\
  /eval /set comm_tells $ %; \\
  /eval /set comm_market $ %; \\
  /eval /set comm_other $ %; \\
  /def -mregexp -n0 -p2 -q -h"PROMPT (\\\\d+)h, (\\\\d+)m, (\\\\d+)e, (\\\\d+)p, (\\\\d+)en, (\\\\d+)w (.*)\\\\-" comm_prompt_catch = \\
    /if ({redirecting_comm} =~ "yes") \\
      /undef catch_all_comm %%; \\
      /set redirecting_comm no %%; \\
    /endif %; \\
  /def catch_multiline_comm = \\
    /set redirecting_comm yes %%; \\
    /set comm_channel $$ %%; \\
    /test comm_channel:=%%{comm_channel} %%; \\
    /def -mregexp -n0 -ag -t".*" catch_all_comm = /test tfwrite({comm_channel},encode_ansi({P0})) %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Magnagora\\\\):.+\\$" comm_city_catch = \\
      /test tfwrite({comm_city},encode_ansi({P0})) %%; \\
      /catch_multiline_comm city %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Ur'guard\\\\):.+\\$" comm_guild_catch1 = \\
      /test tfwrite({comm_guild},encode_ansi({P0})) %%; \\
      /catch_multiline_comm guild %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Grunts\\\\):.+\\$" comm_guild_catch2 = \\
      /test tfwrite({comm_guild},encode_ansi({P0})) %%; \\
      /catch_multiline_comm guild %; \\
    /def -mregexp -n0 -ag -t"^\\\\(The Barracks\\\\):.+\\$" comm_guild_catch3 = \\
      /test tfwrite({comm_guild},encode_ansi({P0})) %%; \\
      /catch_multiline_comm guild %; \\
    /def -mregexp -n0 -ag -t"^You tell.+\\$" comm_tells_catch1 = \\
      /test tfwrite({comm_tells},encode_ansi({P0})) %%; \\
      /catch_multiline_comm tells %; \\
    /def -mregexp -n0 -ag -t"^\\\\w+ tells you.+\\$" comm_tells_catch2 = \\
      /test tfwrite({comm_tells},encode_ansi({P0})) %%; \\
      /catch_multiline_comm tells %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Market\\\\):.+\\$" comm_market_catch = \\
      /test tfwrite({comm_market},encode_ansi({P0})) %%; \\
      /catch_multiline_comm market %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Newbie\\\\):.+\\$" comm_other_catch1 = \\
      /test tfwrite({comm_other},encode_ansi({P0})) %%; \\
      /catch_multiline_comm other %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Noctus Altus\\\\):.+\\$" comm_other_catch2 = \\
      /test tfwrite({comm_other},encode_ansi({P0})) %%; \\
      /catch_multiline_comm other
/alias comm_redirect \\
  /if ({1} =~ "off") \\
    /comm_redirect_cleanup %; \\
    /set redirecting_status off %; \\
    /echo -aBCcyan <<<< communications redirecting has been disabled. >>>> %; \\
  /elseif ({1} =~ "single") \\
    /comm_redirect_cleanup %; \\
    /comm_redirect_single %; \\
    /set redirecting_status single %; \\
    /echo -aBCcyan <<<< communications will be redirected to a single destination. >>>> %; \\
  /elseif ({1} =~ "split") \\
    /comm_redirect_cleanup %; \\
    /comm_redirect_split %; \\
    /set redirecting_status split %; \\
    /echo -aBCcyan <<<< communications will be redirected to split destinations. >>>> %; \\
  /else \\
    /echo -aBCcyan <<<< comm_redirect error: legal arguments are "off", "single", or "split". >>>> %; \\
  /endif
/set redirecting_comm no
/set comm_channel=
/def comm_redirect_cleanup = \\
  /if (({redirecting_status} =~ "single") | ({redirecting_status} =~ "split")) \\
    /undef comm_prompt_catch %; \\
    /undef catch_multiline_comm %; \\
    /undef comm_city_catch %; \\
    /undef comm_guild_catch1 %; \\
    /undef comm_guild_catch2 %; \\
    /undef comm_guild_catch3 %; \\
    /undef comm_tells_catch1 %; \\
    /undef comm_tells_catch2 %; \\
    /undef comm_market_catch %; \\
    /undef comm_other_catch1 %; \\
    /undef comm_other_catch2 %; \\
  /endif %; \\
  /if ({redirecting_status} =~ "single") \\
    /test tfclose({comm_all}) %; \\
    /unset comm_all %; \\
  /elseif ({redirecting_status} =~ "split") \\
    /test tfclose({comm_city}) %; \\
    /test tfclose({comm_guild}) %; \\
    /test tfclose({comm_tells}) %; \\
    /test tfclose({comm_market}) %; \\
    /test tfclose({comm_other}) %; \\
    /unset comm_city %; \\
    /unset comm_guild %; \\
    /unset comm_tells %; \\
    /unset comm_market %; \\
    /unset comm_other %; \\
  /endif
/def comm_redirect_single = \\
  /eval /set comm_all $ %; \\
  /def -mregexp -n0 -p2 -q -h"PROMPT (\\\\d+)h, (\\\\d+)m, (\\\\d+)e, (\\\\d+)p, (\\\\d+)en, (\\\\d+)w (.*)\\\\-" comm_prompt_catch = \\
    /if ({redirecting_comm} =~ "yes") \\
      /undef catch_all_comm %%; \\
      /set redirecting_comm no %%; \\
    /endif %; \\
  /def catch_multiline_comm = \\
    /set redirecting_comm yes %%; \\
    /def -mregexp -n0 -ag -t".*" catch_all_comm = /test tfwrite({comm_all},encode_ansi({P0})) %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Magnagora\\\\):.+\\$" comm_city_catch = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Ur'guard\\\\):.+\\$" comm_guild_catch1 = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Grunts\\\\):.+\\$" comm_guild_catch2 = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^\\\\(The Barracks\\\\):.+\\$" comm_guild_catch3 = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^You tell.+\\$" comm_tells_catch1 = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^\\\\w+ tells you.+\\$" comm_tells_catch2 = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Market\\\\):.+\\$" comm_market_catch = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Newbie\\\\):.+\\$" comm_other_catch1 = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Noctus Altus\\\\):.+\\$" comm_other_catch2 = \\
      /test tfwrite({comm_all},encode_ansi({P0})) %%; \\
      /catch_multiline_comm
/def comm_redirect_split = \\
  /eval /set comm_city $ %; \\
  /eval /set comm_guild $ %; \\
  /eval /set comm_tells $ %; \\
  /eval /set comm_market $ %; \\
  /eval /set comm_other $ %; \\
  /def -mregexp -n0 -p2 -q -h"PROMPT (\\\\d+)h, (\\\\d+)m, (\\\\d+)e, (\\\\d+)p, (\\\\d+)en, (\\\\d+)w (.*)\\\\-" comm_prompt_catch = \\
    /if ({redirecting_comm} =~ "yes") \\
      /undef catch_all_comm %%; \\
      /set redirecting_comm no %%; \\
    /endif %; \\
  /def catch_multiline_comm = \\
    /set redirecting_comm yes %%; \\
    /set comm_channel $$ %%; \\
    /test comm_channel:=%%{comm_channel} %%; \\
    /def -mregexp -n0 -ag -t".*" catch_all_comm = /test tfwrite({comm_channel},encode_ansi({P0})) %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Magnagora\\\\):.+\\$" comm_city_catch = \\
      /test tfwrite({comm_city},encode_ansi({P0})) %%; \\
      /catch_multiline_comm city %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Ur'guard\\\\):.+\\$" comm_guild_catch1 = \\
      /test tfwrite({comm_guild},encode_ansi({P0})) %%; \\
      /catch_multiline_comm guild %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Grunts\\\\):.+\\$" comm_guild_catch2 = \\
      /test tfwrite({comm_guild},encode_ansi({P0})) %%; \\
      /catch_multiline_comm guild %; \\
    /def -mregexp -n0 -ag -t"^\\\\(The Barracks\\\\):.+\\$" comm_guild_catch3 = \\
      /test tfwrite({comm_guild},encode_ansi({P0})) %%; \\
      /catch_multiline_comm guild %; \\
    /def -mregexp -n0 -ag -t"^You tell.+\\$" comm_tells_catch1 = \\
      /test tfwrite({comm_tells},encode_ansi({P0})) %%; \\
      /catch_multiline_comm tells %; \\
    /def -mregexp -n0 -ag -t"^\\\\w+ tells you.+\\$" comm_tells_catch2 = \\
      /test tfwrite({comm_tells},encode_ansi({P0})) %%; \\
      /catch_multiline_comm tells %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Market\\\\):.+\\$" comm_market_catch = \\
      /test tfwrite({comm_market},encode_ansi({P0})) %%; \\
      /catch_multiline_comm market %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Newbie\\\\):.+\\$" comm_other_catch1 = \\
      /test tfwrite({comm_other},encode_ansi({P0})) %%; \\
      /catch_multiline_comm other %; \\
    /def -mregexp -n0 -ag -t"^\\\\(Noctus Altus\\\\):.+\\$" comm_other_catch2 = \\
      /test tfwrite({comm_other},encode_ansi({P0})) %%; \\
      /catch_multiline_comm other
/alias comm_redirect \\
  /if ({1} =~ "off") \\
    /comm_redirect_cleanup %; \\
    /set redirecting_status off %; \\
    /echo -aBCcyan <<<< communications redirecting has been disabled. >>>> %; \\
  /elseif ({1} =~ "single") \\
    /comm_redirect_cleanup %; \\
    /comm_redirect_single %; \\
    /set redirecting_status single %; \\
    /echo -aBCcyan <<<< communications will be redirected to a single destination. >>>> %; \\
  /elseif ({1} =~ "split") \\
    /comm_redirect_cleanup %; \\
    /comm_redirect_split %; \\
    /set redirecting_status split %; \\
    /echo -aBCcyan <<<< communications will be redirected to split destinations. >>>> %; \\
  /else \\
    /echo -aBCcyan <<<< comm_redirect error: legal arguments are "off", "single", or "split". >>>> %; \\
  /endif
Unknown2005-04-27 23:27:23
Dang, nice job bwbettin. I'm impressed. Since you seem to be the TF guru here, I have a question. I see that your lines don't wrap at the standard 80 characters like mine does. Do you know how to change it so that it won't auto-wrap at 80 characters per line?
EDIT: Sorry for the unexpected hijack.
EDIT: Sorry for the unexpected hijack.
Unknown2005-04-27 23:42:35
QUOTE(Neocount @ Apr 27 2005, 06:27 PM)
Dang, nice job bwbettin. I'm impressed. Since you seem to be the TF guru here, I have a question. I see that your lines don't wrap at the standard 80 characters like mine does. Do you know how to change it so that it won't auto-wrap at 80 characters per line?
EDIT: Sorry for the unexpected hijack.
EDIT: Sorry for the unexpected hijack.
108704
If you're referring to the screenshot you should probably count the characters again. Both my channel redirecting window and TF window wrap at the standard 80 (or 79, whatever).
If you're referring to the sourcecode, it all depends on what editor you're using. I use Vim (www.vim.org). Vim uses the settings found in a ".vimrc" file in your home directory, or the global one if it exists (located at /etc/vim/vimrc in Debian). I have mine setup to disable word wrapping.
Here's my vimrc:
CODE
" vim settings
set nocompatible         " use vim defaults instead of vi compatibility
set showcmd           " show (partial) command in status line
set incsearch          " incremental search
filetype plugin indent on    " enabled filetype detection, use filetype settings
set backspace=indent,eol,start " more powerful backspacing
" defaults for the editor
set nu        " precede each line with its line number
set autoindent    " automatically indent next line
set ruler      " show cursor position
set wrap! Â Â Â Â Â " disable line wrapping
set textwidth=0 Â Â " don't wrap words
set history=100 Â Â " keep 100 lines of command line history
set expandtab    " replace tabs with appropriate number of spaces
set shiftwidth=4 Â Â " number of spaces to use for each step of autoindent
set softtabstop=4 Â " number of spaces a tab counts for while editing
set tabstop=4 Â Â Â " number of spaces a tab counts for in file (:retab)
set writebackup   " make a backup before overwriting a file
set backup      " keep the backup file
" setup syntax highlighting
syntax on      " enable syntax highlighting
colorscheme default " set the colorscheme to the default scheme
set background=dark " adjust colors to look best on a dark background
set nocompatible         " use vim defaults instead of vi compatibility
set showcmd           " show (partial) command in status line
set incsearch          " incremental search
filetype plugin indent on    " enabled filetype detection, use filetype settings
set backspace=indent,eol,start " more powerful backspacing
" defaults for the editor
set nu        " precede each line with its line number
set autoindent    " automatically indent next line
set ruler      " show cursor position
set wrap! Â Â Â Â Â " disable line wrapping
set textwidth=0 Â Â " don't wrap words
set history=100 Â Â " keep 100 lines of command line history
set expandtab    " replace tabs with appropriate number of spaces
set shiftwidth=4 Â Â " number of spaces to use for each step of autoindent
set softtabstop=4 Â " number of spaces a tab counts for while editing
set tabstop=4 Â Â Â " number of spaces a tab counts for in file (:retab)
set writebackup   " make a backup before overwriting a file
set backup      " keep the backup file
" setup syntax highlighting
syntax on      " enable syntax highlighting
colorscheme default " set the colorscheme to the default scheme
set background=dark " adjust colors to look best on a dark background
Unknown2005-04-27 23:48:44
I was referring to the screenshot. I didn't even count the characters to be honest. I took a quick glance and it seemed like a whole lot more than 80 characters.
Here's my .vimrc. I didn't make the original file, but edited some stuff here and there. I have mine to wordwrap still after 100 characters, which I should probably change now that I think about it.
Here's my .vimrc. I didn't make the original file, but edited some stuff here and there. I have mine to wordwrap still after 100 characters, which I should probably change now that I think about it.
CODE
" An example for a vimrc file.
"
" Maintainer: Â Bram Moolenaar
" Last change: Â 2001 Jul 18
"
" To use it, copy it to
" Â Â for Unix and OS/2: Â ~/.vimrc
" Â Â Â Â for Amiga: Â s:.vimrc
" Â for MS-DOS and Win32: Â $VIM\\_vimrc
" Â Â Â for OpenVMS: Â sys$login:.vimrc
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
 finish
endif
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
" allow you to define rectangles beyond end of line when in visual mode
set virtualedit+=block
set autoindent    " always set autoindenting on
filetype indent on
if has("vms")
 set nobackup    " do not keep a backup file, use versions instead
else
 set backup     " keep a backup file
endif
set history=50 Â Â Â " keep 50 lines of command line history
set ruler    " show the cursor position all the time
set showcmd   " display incomplete commands
set incsearch    " do incremental searching
set cmdheight=3 Â Â " set height of command line at bottom
set textwidth=100
"set guifont=8x13bold
"set guifont=9x15bold
"set guifont=7x14bold
"set guifont=7x13bold
"set guifont=-bitstream-charter-*-*-normal-*-10-*-*-*-*-*-*-*
" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
" let &guioptions = substitute(&guioptions, "t", "", "g")
" Don't use Ex mode, use Q for formatting
map Q gq
" Make p in Visual mode replace the selected text with the "" register.
vnoremap p:let current_reg = @"gvs=current_reg
" Change the search mapping: Â puts you in the real search prompt, which
" might be helpful if you have maps, abbv
vnoremap //\\%>=line("'<")-1l\\%<=line("'>")+1l
vnoremap ??\\%>=line("'<")-1l\\%<=line("'>")+1l
" This is an alternative that also works in block mode, but the deleted
" text is lost and it only works for putting the current register.
"vnoremap p "_dp
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2
  syntax on
  set hlsearch
endif
"Settings useful if using gvim
if has("gui_running")
  colorscheme morning
  "colorscheme desert
  "set bg=dark
  set co=120
  set lines=40
  set number
endif
" Highlight redundant trailing spaces and redundant space chars embedded
" inside of leading spaces
au Syntax * Â Â syn match Error /\\s\\+$/ | syn match Error /^\\s* \\t\\s*/
" Only do this part when compiled with support for autocommands.
if has("autocmd")
 " Enable file type detection.
 " Use the default filetype settings, so that mail gets 'tw' set to 72,
 " 'cindent' is on in C files, etc.
 " Also load indent files, to automatically do language-dependent indenting.
 filetype plugin indent on
 " For all text files set 'textwidth' to 78 characters.
 autocmd FileType text setlocal textwidth=78
 autocmd FileType html,php setlocal textwidth=250
 autocmd FileType html,htm,php,aspvbs,smarty  so ~/.vimhtmlrc
 "autocmd! BufRead,BufNewFile *.tpl     setfiletype html
 " When editing a file, always jump to the last known cursor position.
 " Don't do it when the position is invalid or when inside an event handler
 " (happens when dropping a file on gvim).
 autocmd BufReadPost *
  \\ if line("'\\"") > 0 && line("'\\"") <= line("$") |
  \\  exe "normal g`\\"" |
  \\ endif
 " View ms.doc files.  Needs antiword.
 autocmd BufReadPre *.doc set ro
 autocmd BufReadPre *.doc set hlsearch!
 autocmd BufReadPost *.doc %!antiword "%"
endif " has("autocmd")
highlight Comment ctermfg=LightGray
:set pastetoggle= Â Â Â " toggle between paste mode and normal mode
set tabstop=4
set softtabstop=4
set shiftwidth=4
set smarttab
set expandtab
set showmatch
set backupdir=~/.vimbackup
" Following is for plugin taglist.vim
nnoremap :Tlist
nnoremap :TlistSync
let g:showmarks_include="a-dmtuA-E"
"
" Maintainer: Â Bram Moolenaar
" Last change: Â 2001 Jul 18
"
" To use it, copy it to
" Â Â for Unix and OS/2: Â ~/.vimrc
" Â Â Â Â for Amiga: Â s:.vimrc
" Â for MS-DOS and Win32: Â $VIM\\_vimrc
" Â Â Â for OpenVMS: Â sys$login:.vimrc
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
 finish
endif
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
" allow you to define rectangles beyond end of line when in visual mode
set virtualedit+=block
set autoindent    " always set autoindenting on
filetype indent on
if has("vms")
 set nobackup    " do not keep a backup file, use versions instead
else
 set backup     " keep a backup file
endif
set history=50 Â Â Â " keep 50 lines of command line history
set ruler    " show the cursor position all the time
set showcmd   " display incomplete commands
set incsearch    " do incremental searching
set cmdheight=3 Â Â " set height of command line at bottom
set textwidth=100
"set guifont=8x13bold
"set guifont=9x15bold
"set guifont=7x14bold
"set guifont=7x13bold
"set guifont=-bitstream-charter-*-*-normal-*-10-*-*-*-*-*-*-*
" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
" let &guioptions = substitute(&guioptions, "t", "", "g")
" Don't use Ex mode, use Q for formatting
map Q gq
" Make p in Visual mode replace the selected text with the "" register.
vnoremap p
" Change the search mapping: Â puts you in the real search prompt, which
" might be helpful if you have maps, abbv
vnoremap /
vnoremap ?
" This is an alternative that also works in block mode, but the deleted
" text is lost and it only works for putting the current register.
"vnoremap p "_dp
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2
  syntax on
  set hlsearch
endif
"Settings useful if using gvim
if has("gui_running")
  colorscheme morning
  "colorscheme desert
  "set bg=dark
  set co=120
  set lines=40
  set number
endif
" Highlight redundant trailing spaces and redundant space chars embedded
" inside of leading spaces
au Syntax * Â Â syn match Error /\\s\\+$/ | syn match Error /^\\s* \\t\\s*/
" Only do this part when compiled with support for autocommands.
if has("autocmd")
 " Enable file type detection.
 " Use the default filetype settings, so that mail gets 'tw' set to 72,
 " 'cindent' is on in C files, etc.
 " Also load indent files, to automatically do language-dependent indenting.
 filetype plugin indent on
 " For all text files set 'textwidth' to 78 characters.
 autocmd FileType text setlocal textwidth=78
 autocmd FileType html,php setlocal textwidth=250
 autocmd FileType html,htm,php,aspvbs,smarty  so ~/.vimhtmlrc
 "autocmd! BufRead,BufNewFile *.tpl     setfiletype html
 " When editing a file, always jump to the last known cursor position.
 " Don't do it when the position is invalid or when inside an event handler
 " (happens when dropping a file on gvim).
 autocmd BufReadPost *
  \\ if line("'\\"") > 0 && line("'\\"") <= line("$") |
  \\  exe "normal g`\\"" |
  \\ endif
 " View ms.doc files.  Needs antiword.
 autocmd BufReadPre *.doc set ro
 autocmd BufReadPre *.doc set hlsearch!
 autocmd BufReadPost *.doc %!antiword "%"
endif " has("autocmd")
highlight Comment ctermfg=LightGray
:set pastetoggle=
set tabstop=4
set softtabstop=4
set shiftwidth=4
set smarttab
set expandtab
set showmatch
set backupdir=~/.vimbackup
" Following is for plugin taglist.vim
nnoremap
nnoremap
let g:showmarks_include="a-dmtuA-E"