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 

Searching File

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
haferbrei
Voice


Joined: 08 Apr 2020
Posts: 5

PostPosted: Wed Nov 11, 2020 10:39 am    Post subject: Searching File Reply with quote

Is there a script where eggdrop looks for a file in a directory?
Something like !search Name
Back to top
View user's profile Send private message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 216

PostPosted: Wed Nov 11, 2020 10:52 am    Post subject: Reply with quote

haferbrei, tried looking in the TclArchive ?

If not, i'll point you to the right direction.

http://tclarchive.org/search.php?Server

try looking through that Cool
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1106

PostPosted: Wed Nov 11, 2020 5:38 pm    Post subject: Re: Searching File Reply with quote

haferbrei wrote:
Is there a script where eggdrop looks for a file in a directory?
Something like !search Name


This is VERY rudimentary. There ought to be lots of things that can be done, to improve it. It just depends on what you are trying to do.

Code:

# November 11, 2020
#
# http://forum.egghelp.org/viewtopic.php?p=109154&sid=af6ef787512bdf9d5d1f0ea3be3949e7#109154
#
##############


bind pub n "!search" filesearch



###
proc filesearch {nick uhost handle chan text} {

        if {![llength [split $text]]} {
                putserv "privmsg $chan :Syntax: !search path/filename  (can contain wildcards) "
                return 0
        }

        putserv "privmsg $chan :[glob [lindex [split $text] 0 ] ] "

}
###



Something like this is not limited in the code, as to where the user might search. Thus, the bind is flagged for use only by bot owner. Before you change that to something lesser, give it some thought.

Reference:
http://www.tcl.tk/man/tcl8.6/TclCmd/glob.htm
http://www.tcl.tk/man/tcl8.6/TclCmd/contents.htm

Have fun with it. I hope that gets you started.
Smile
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
haferbrei
Voice


Joined: 08 Apr 2020
Posts: 5

PostPosted: Wed Nov 18, 2020 4:31 pm    Post subject: Reply with quote

I have solved it so similar Smile
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 Support & Releases 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