| View previous topic :: View next topic |
| Author |
Message |
haferbrei Voice
Joined: 08 Apr 2020 Posts: 23
|
Posted: Wed Nov 11, 2020 10:39 am Post subject: Searching File |
|
|
Is there a script where eggdrop looks for a file in a directory?
Something like !search Name |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Wed Nov 11, 2020 10:52 am Post subject: |
|
|
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  _________________ ComputerTech |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Wed Nov 11, 2020 5:38 pm Post subject: Re: Searching File |
|
|
| 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.
 _________________ 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 |
|
 |
haferbrei Voice
Joined: 08 Apr 2020 Posts: 23
|
Posted: Wed Nov 18, 2020 4:31 pm Post subject: |
|
|
I have solved it so similar  |
|
| Back to top |
|
 |
|