This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

script request [ solved ]

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

script request [ solved ]

Post by whittinghamj »

Hello guys.

I have a bit of a hard one here so it might challange some of your guru's

I have files in a dir /home/eggdrop/news/

I keep backup files of news.txt once its changed it moved to eg news.lastdateused.txt eg news.091706.txt etc

I was looking for a script that could count up how many files where in that folder but exclute the file news.txt

How hard would that be?

The output should be someing really simple like

<bot> There are 12 backup files in the NEWS archive.

What that be possable?
Cheers guys

Quest
Last edited by whittinghamj on Tue Sep 19, 2006 6:14 pm, edited 1 time in total.
d
deadite66
Halfop
Posts: 74
Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK

Post by deadite66 »

try this (not tested)

Code: Select all

bind pub - !news newsrun
proc newsrun {nick uhost hand chan arg} {
set globres [glob -nocomplain -directory /home/eggdrop/news/ news.*.txt]
puthelp "PRIVMSG $chan : There are [llength $globres] backup files in the NEWS archive"
}
<- tcl newb
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

it did not work - nothing in the channel and nothing in the dcc window - i have cheked pers and should be fine :-s
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

73 posts and you still have not learnt that "It does not work" doesn't work with us.

Code: Select all

.set errorInfo
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

Sorry buddy :D

.set errorInfo
What? You need '.help'
.set errorinfo
What? You need '.help'
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

whittinghamj wrote:Sorry buddy :D

.set errorInfo
What? You need '.help'
.set errorinfo
What? You need '.help'
Then setup your bot to enable it. The forums contain the necessary information.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

hi guys - ok I have it reporting 0 files so its half way working now. just not adding up the files.

Slight change in the requirments. I dont need it it to explude anything now. Just count everything all files. I tried cahnge the news.*.txt to just * but i still get 0 archive files in the privmsg.

Any ideas?

cheers

Jamie
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

I resolved it - it was an error in the path to file.

thanks
d
deadite66
Halfop
Posts: 74
Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK

Post by deadite66 »

\o/
<- tcl newb
Post Reply