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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
whittinghamj
Op
Posts: 103 Joined: Sun May 21, 2006 4:50 pm
Post
by whittinghamj » Sun Sep 17, 2006 6:41 am
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.
deadite66
Halfop
Posts: 74 Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK
Post
by deadite66 » Sun Sep 17, 2006 7:07 am
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
whittinghamj
Op
Posts: 103 Joined: Sun May 21, 2006 4:50 pm
Post
by whittinghamj » Sun Sep 17, 2006 3:02 pm
it did not work - nothing in the channel and nothing in the dcc window - i have cheked pers and should be fine :-s
Alchera
Revered One
Posts: 3344 Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:
Post
by Alchera » Sun Sep 17, 2006 5:34 pm
73 posts and you still have not learnt that "It does not work" doesn't work with us.
Add [SOLVED] to the thread title if your issue has been.
Search |
FAQ |
RTM
whittinghamj
Op
Posts: 103 Joined: Sun May 21, 2006 4:50 pm
Post
by whittinghamj » Sun Sep 17, 2006 7:29 pm
Sorry buddy
.set errorInfo
What? You need '.help'
.set errorinfo
What? You need '.help'
Alchera
Revered One
Posts: 3344 Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:
Post
by Alchera » Sun Sep 17, 2006 8:27 pm
whittinghamj wrote: Sorry buddy
.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
whittinghamj
Op
Posts: 103 Joined: Sun May 21, 2006 4:50 pm
Post
by whittinghamj » Tue Sep 19, 2006 6:05 pm
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
whittinghamj
Op
Posts: 103 Joined: Sun May 21, 2006 4:50 pm
Post
by whittinghamj » Tue Sep 19, 2006 6:14 pm
I resolved it - it was an error in the path to file.
thanks
deadite66
Halfop
Posts: 74 Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK
Post
by deadite66 » Tue Sep 19, 2006 6:27 pm
\o/
<- tcl newb