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.
Support & discussion of released scripts, and announcements of new releases.
haferbrei
Voice
Posts: 24 Joined: Wed Apr 08, 2020 8:57 pm
Post
by haferbrei » Wed Nov 11, 2020 10:39 am
Is there a script where eggdrop looks for a file in a directory?
Something like !search Name
willyw
Revered One
Posts: 1205 Joined: Thu Jan 15, 2009 12:55 am
Post
by willyw » Wed Nov 11, 2020 5:38 pm
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: Select all
# 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.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
haferbrei
Voice
Posts: 24 Joined: Wed Apr 08, 2020 8:57 pm
Post
by haferbrei » Wed Nov 18, 2020 4:31 pm
I have solved it so similar