PDA

View Full Version : A better spawnlog.txt cleaner



helper
07-01-2002, 04:53 PM
Made this up real fast because sed is way to slow for me ;)




#!/bin/bash
#Spawnlog clean by helper.


#change to where your spawnlog.txt lives
cd /seq/share/showeq

#make backup.
cp spawnlog.txt spawnlog.txt.bak

#Housecleaning time.
egrep -v "^-:|[a-z]\(|corpse|_warder|familiar" spawnlog.txt > tmp.txt

mv tmp.txt spawnlog.txt

exit 0

BlueAdept
07-02-2002, 08:13 AM
Heh...thanks the one I did was real quick and didnt feel like looking up they syntax.

Mind if put that on my site to replace the one I did?

helper
07-02-2002, 09:52 AM
Thats fine, I am currently expanding it to do a few more intelligent checks as well. I will post it here when its finished.

Enjoy =)

Nobody
07-03-2002, 12:56 AM
I wanted to test my script a few more times, but it's working fine. I'll rip out the debug stuff and send it to BA for upload.

Nobody
07-07-2002, 05:27 PM
I'm attaching a .tar.gz file that will make the filter files. It will create a directory named "KnownMobs" which has a list of every mob that has been processed. This is used to prevent replications.

To use it untar it in your seq directory "/usr/local/share/showeq/" and then "./GetMobs -f <spawnlogfile>" and watch it go through a list of the zones.

If you ahve a bug, post the spawnlog file and I'll update.

helper
07-10-2002, 01:59 PM
There is something wrong with the pet cleaning regex - It matches on a few named mobs like Gornit00, Zordak_Ragefire00 and Zordakalicus_Ragefire00 for example.

Working on cleaning it up a tad =)


Otherwise I really like! =)

Aelorean
07-10-2002, 05:26 PM
Ok -- I will admit that I am a complete idiot when it comes to Perl :( ....can you tell me what I need to do to fix this error? Thanks!



root:/usr/local/share/showeq> ./GetMobs.pl
Uncaught exception from user code:
Uncaught exception from user code:
Can't locate Getopt/Mixed.pm in @INC (@INC contains: /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at ./GetMobs.pl line 6.
main::BEGIN() called at Getopt/Mixed.pm line 6
require 0 called at Getopt/Mixed.pm line 6
BEGIN failed--compilation aborted at ./GetMobs.pl line 6.

Cryonic
07-10-2002, 06:08 PM
CPAN Module - Getopt::Mixed

www.cpan.org

powerspike
07-22-2002, 08:58 PM
to save a bit of of trouble
you can also do perl -MCPAN -e `install PACKAGE`
ie perl -MCPAN -e `install Getopt:Mixed`

=)

astraa
08-06-2002, 11:43 AM
Originally posted by helper
Made this up real fast because sed is way to slow for me ;)




#!/bin/bash
#Spawnlog clean by helper.


#change to where your spawnlog.txt lives
cd /seq/share/showeq

#make backup.
cp spawnlog.txt spawnlog.txt.bak

#Housecleaning time.
egrep -v "^-:|[a-z]\(|corpse|_warder|familiar" spawnlog.txt > tmp.txt

mv tmp.txt spawnlog.txt

exit 0


Hi All

would someone mind explaining how to make this an ex file so I can run this by mouse click, Im still very new to Linux world.

Thks :-)

high_jeeves
08-06-2002, 11:55 AM
1) there is no such thing as an exe file in linux
2) Take a look at chmod (type 'man chmod'), it will show you how to change the mode to executable.

--Jeeves

Mr. Suspicious
08-06-2002, 07:33 PM
Im still very new to Linux world.

Good places to start:

http://www.linux.org
http://www.linuxdocs.org

http://www.yourdistro.org(com)/manual

Don't take this the wrong way: but try to learn about the OS you are working with by actually reading the manual that comes with it... just think of it this way: if someone never used Windows and you'd tell him to "set your swapfile to static", would he know what you are talking about? Or even what to do? No... and instead of taking him by the hand 10 times a day and explain every step he would have to take... you'd direct him to the manual (which he can read in ease, at his own tempo, specifically designed to be easilly understood and well comprehensable)

Another good thing to read is the pre-face section of: http://www.smoothwall.org/download/pdf/docs/0.9.9/doc.faq.pdf very Very VERY worth the 15 minutes you will spend to read it.

Dedpoet
08-06-2002, 08:11 PM
I hope the other regulars don't flame me for this, but after following all of their advice, change into the directory where your file is and type:

chmod 755 yourfilename

That will make the file readable, writable, and executable by whatever user you are performing this as (probably root), and readable and executable by all other users. Those man pages and other documentation will help you understand why.

astraa
08-06-2002, 09:25 PM
Originally posted by Mr. Suspicious


Good places to start:

http://www.linux.org
http://www.linuxdocs.org

http://www.yourdistro.org(com)/manual

Don't take this the wrong way: but .................................................. .......... it.

Nope I do not take it the wrong way at all, thank you for your reply, the one from .... was far shorter and had me puzzled, the man chmod file on my box does not tell me much in the way of examples, but i have found out to do it with 755 and I saw a reference to -x so thanks again to all. I do some times wonder thou if some of the replys are just downright attempts to scare would be new commers right off, shame really as we all started out asking questions even after reading as much as we can, but then again even getting a manual to display when you dont know the commands or the short cuts is hard, we are not all experts.

:-)
TTFN

Mr. Suspicious
08-07-2002, 06:18 AM
I do some times wonder thou if some of the replys are just downright attempts to scare would be new commers right off

but then again even getting a manual to display when you dont know the commands or the short cuts is hard, we are not all experts.

You obviously didn't read the last URL (to the .pdf file) I provided.

My grandparents accuse Windoo$ of the very same thing. Inprogramm manuals are usually less detailed and assume a greater basic knowledge then "real" manuals and so do most people's answers. How will you be able to refill your cars oil, if you don't even know what a hood, the contact-key or the windshield-wiper of your car is? . You know.. books... websites that have the books in HTML form... step-by-steps... HOWTO's... exactly the reason I meantioned those URL's because they have them.

chmod is a basic Linux command (it's like right clicking a file in Windoo$ and changing it's properties) just go pickup a good book like "Linux for Dummies" and actually READ the manual of your distro and visit the wonderfull HOWTO's and "Linux for starters" websites... chmod (and a lot of other commands) ARE mentioned and explained to detail in them.

astraa
08-07-2002, 06:27 AM
Originally posted by Mr. Suspicious


You obviously didn't read the last URL (to the .pdf file) I provided.



Yes I have read your links. Thankyou for pointing out that im sooooo Stupid. Maybe one day I will also be able to pass on the divine light to lesser mortals :-~) But joking aside Sorry Mr. Suspicious I indeed did reply before reading. My bad.

TTFN
Astraa