converting RTCW console output to html -1 reply

  • 1
  • 2

Please wait...

Rudi_alias_Rudi

I want to be like the Admins

50 XP

29th March 2004

0 Uploads

258 Posts

0 Threads

#1 13 years ago

"

# translating color codes # FIXME: We need to add some special cases like ^$ if test -n "$1" && test -f "$1" then cat $1 |sed -u\ -e 's/\(\^[^\^]\)*\(\^[^\^]\)/\2/g' \ -e 's/\(\^[^\^]\)\([^\^]*\)/\2<\/font>/g' \ -e 's/\^[0pz]/000000/g' \ -e 's/\^[1jkq]/FF0000/g' \ -e 's/\^[2hmr]/008000/g' \ -e 's/\^[3aos]/FFFF00/g' \ -e 's/\^[4t]/0000FF/g' \ -e 's/\^[5bdfu]/3399FF/g' \ -e 's/\^[6ceiv]/CC3399/g' \ -e 's/\^[7gnw]/FFFFFF/g' \ -e 's/\^[8lx]/FF9900/g' \ -e 's/\^[9y]/D0D0D0/g' \ -e 's/$/
/g' else echo "input file was not found
by rtcw2html" fi

#FIXME: validator.w3.org test fails in some special cases for #instance if there are html tags in inputfile echo -e "




Rudi_alias_Rudi

I want to be like the Admins

50 XP

29th March 2004

0 Uploads

258 Posts

0 Threads

#2 13 years ago

And to make it complete another 2 scripts: rtcw2null - just removes RTCW-color codes from logfiles rtcw2forum - translates RTCW-console output into this forum format #! /bin/bash # rtcw2null reads from file or stdin and removes RTCW-color-codes cat $1 |sed -u -e 's/\^.//g' #! /bin/bash # rtcw2forum reads from file or stdin and translates RTCW-colors # into Forum-format # FIXME: Are there a forum tag for backround color? cat $1 |sed -u\ -e 's/\(\^[^\^]\)*\(\^[^\^]\)/\2/g' \ -e 's/\(\^[^\^]\)\([^\^]*\)/[COLOR=\1]\2[\/COLOR]/g' \ -e 's/\^[0pz]/000000/g' \ -e 's/\^[1jkq]/FF0000/g' \ -e 's/\^[2hmr]/008000/g' \ -e 's/\^[3aos]/FFFF00/g' \ -e 's/\^[4t]/0000FF/g' \ -e 's/\^[5bdfu]/3399FF/g' \ -e 's/\^[6ceiv]/CC3399/g' \ -e 's/\^[7gnw]/000000/g' \ -e 's/\^[8lx]/FF9900/g' \ -e 's/\^[9y]/000000/g'




Rudi_alias_Rudi

I want to be like the Admins

50 XP

29th March 2004

0 Uploads

258 Posts

0 Threads

#3 13 years ago

here an example for rtcw2forum: =WWE=Rudi (Bunk Beds / Stereo): Adios amigos. HFX-REBEL (Bunk Beds / Stereo): Adios amigos. {Rev}MaltaGoya (Entertainment Area): Adios amigos. {Rev}el.burro (unknown): See ya later partner. {Rev}el.jaden: bye rudi {Rev}el.jaden (unknown): See ya later partner.

edit: I just see that I need better colors - plz help me if you know good ones aleready I attached an example for rtcw2html!




Ignacio

Slap leather, varmint!!!

50 XP

7th October 2003

0 Uploads

1,364 Posts

0 Threads

#4 13 years ago

Nice work Rudi, thanks.




Gringo Starr

Green Whorn

50 XP

8th May 2003

0 Uploads

165 Posts

0 Threads

#5 13 years ago

Very slick dude! :)




Hfx-Rebel VIP Member

AzH owns my ass

50 XP

15th March 2004

0 Uploads

10,426 Posts

0 Threads

#6 13 years ago

nice job...impressive




El Dragon

Wild West Mod

50 XP

25th June 2003

0 Uploads

2,523 Posts

0 Threads

#7 13 years ago

I'm assuming this is linux only but adding to master sticky list. Also I wouldn't worry about fussing with colors as each forum format here (and there are several) will have different colored backgrounds so you'll always have an issue with one or more no mater what the color choices, leave them as default (we can always highlight them to read what is hard to read) Great work Rudi p.s. Rudi, What was the other script that you posted here? Seems I didn't add it to the master sticky list (I think)




Mad Crabs

{Rev}MadCrabs

50 XP

29th April 2004

0 Uploads

62 Posts

0 Threads

#8 13 years ago

My favorite program for this is at: http://theburrow.fragland.net/forums/viewtopic.php?t=52

Has option to filter out team chat (among many other tweaks) and it spits everything out in super organized fashion. (sadly windows only)

I threw the below into my custom config file:

//Log Toggle set logon "logfile 2;echo ^2Outputting-log;set logtoggle vstr logoff" set logoff "logfile 0;echo ^1Not ^1outputting-log;set logtoggle vstr logon" set logtoggle "vstr logon" bind F10 "vstr logtoggle"




Rudi_alias_Rudi

I want to be like the Admins

50 XP

29th March 2004

0 Uploads

258 Posts

0 Threads

#9 13 years ago

@dragon this is a bash script which you can use on all unix like OS but if you have remote access to a linux box you can use it via putty (ssh-client) too. Also it I think its possible to install a bash or another GNU-shell on a Windows system - I never did that but I would try it - I couldnt imagine to sit on a comp without a bash like commandline. Also I am sure thats easy to port that scripts into perl - but I dont know about exactly syntax.

@MadCrabs - did you tried the log-analyzer with wine-emulator? If I have time next week I will post a chatfilter too here. I have it aleready complete but not here right now - its just a 1 or 2 liner in bash. (its also icluded in my other script wich I posted here some time ago)

BTW how are you guys logging your console? I dont know the internal loging function.




Mad Crabs

{Rev}MadCrabs

50 XP

29th April 2004

0 Uploads

62 Posts

0 Threads

#10 13 years ago

The command is /logfile 0,1,2,3

The logfile command has 4 settings: 0 = Disable logging. 1 = Enable buffered logging where the log file is only updated when the text buffer fills up. The log file will be deleted and overridden when a new server starts up. 2 = Enable continuous logging where the log file is updated with every new line of text. The log file will be deleted and overridden when a new server starts up. 3 = Enable continuous logging where the log file is updated with every new line of text. The log file will be appended to and logging will continue to the same log file when a new server starts up.

I haven't tried wine out yet, the program is nothing but a flash/shockwave thing packed into a Macromedia Projector, so it would run fine on linux if it wasn't for being packed into a exe. Hopefully the next version will be distributed in a more friendly format.

It doesn't work 100% with WW. It doesn't filter out the weapons but i just used a batch find and replace to change them to RTCW names in the logfile. The next version will allow for custom weapon names etc luckily (hope it gets released).

Here is the output I got from a few minutes on a server last night: http://home.comcast.net/~t7g/WW/




  • 1
  • 2