egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

script request [ solved ]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Sun Sep 17, 2006 6:41 am    Post subject: script request [ solved ] Reply with quote

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
Back to top
View user's profile Send private message
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Sun Sep 17, 2006 7:07 am    Post subject: Reply with quote

try this (not tested)

Code:
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
Back to top
View user's profile Send private message
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Sun Sep 17, 2006 3:02 pm    Post subject: Reply with quote

it did not work - nothing in the channel and nothing in the dcc window - i have cheked pers and should be fine :-s
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sun Sep 17, 2006 5:34 pm    Post subject: Reply with quote

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

Code:
.set errorInfo

_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Sun Sep 17, 2006 7:29 pm    Post subject: Reply with quote

Sorry buddy Very Happy

.set errorInfo
What? You need '.help'
.set errorinfo
What? You need '.help'
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sun Sep 17, 2006 8:27 pm    Post subject: Reply with quote

whittinghamj wrote:
Sorry buddy Very Happy

.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
Back to top
View user's profile Send private message Visit poster's website
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Tue Sep 19, 2006 6:05 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Tue Sep 19, 2006 6:14 pm    Post subject: Reply with quote

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

thanks
Back to top
View user's profile Send private message
deadite66
Halfop


Joined: 30 May 2005
Posts: 74
Location: Great Yarmouth, UK

PostPosted: Tue Sep 19, 2006 6:27 pm    Post subject: Reply with quote

\o/
_________________
<- tcl newb
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber