| View previous topic :: View next topic |
| Author |
Message |
rayvtirx Voice
Joined: 31 May 2010 Posts: 16 Location: bristol,england
|
Posted: Tue Apr 26, 2011 11:57 am Post subject: put messages into specific channels |
|
|
| Code: | # This sets the location of the file you want to be written out to someone in a msg
set bfile "/home/matt/eggdrop/scripts/url.txt"
#sets the command it should go on off in a chan or so
set cmd "!url"
#this is where you set where the file should be printed out
#private = 0
#channel = 1
set bwhere 1
## don't edit below this line -----------------------------------
bind pub -|- $cmd dumpfile
proc dumpfile {nick handle host chan text } {
global bfile bwhere
set foo [open $bfile r]
while { ! [eof $foo] } {
set line [gets $foo]
if {!$bwhere} {
puthelp "NOTICE $nick :$line"
} else {
puthelp "PRIVMSG $chan :$line"
}
}
}
# This sets the location of the file you want to be written out to someone in a msg
set cfile "/home/matt/eggdrop/scripts/console.txt"
#sets the command it should go on off in a chan or so
set cmdc "!console"
#this is where you set where the file should be printed out
#private = 0
#channel = 1
set cwhere 1
## don't edit below this line -----------------------------------
bind pub -|- $cmdc dumpfilec
proc dumpfilec {nick handle host chan text } {
global cfile cwhere
set foo [open $cfile r]
while { ! [eof $foo] } {
set line [gets $foo]
if {!$cwhere} {
puthelp "NOTICE $nick :$line"
} else {
puthelp "PRIVMSG $chan :$line"
}
}
}
# This sets the location of the file you want to be written out to someone in a msg
set dfile "/home/matt/eggdrop/scripts/servers.txt"
#sets the command it should go on off in a chan or so
set cmdd "!servers"
#this is where you set where the file should be printed out
#private = 0
#channel = 1
set dwhere 1
## don't edit below this line -----------------------------------
bind pub -|- $cmdd dumpfiled
proc dumpfiled {nick handle host chan text } {
global dfile dwhere
set foo [open $dfile r]
while { ! [eof $foo] } {
set line [gets $foo]
if {!$dwhere} {
puthelp "NOTICE $nick :$line"
} else {
puthelp "PRIVMSG $chan :$line"
}
}
} | im currently using the above to read text from textfiles and post it in chat.
would prefer to be able to specify which channel to bind the commands in, so i could add a new block with the same command say !url or anything else , to a specific channel, or group of channels.
any help greatly appreciated  |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Thu Jan 31, 2013 4:48 pm Post subject: |
|
|
You can use this script with the same purpouse like this you are using now
http://forum.egghelp.org/viewtopic.php?t=19313 if you want any other modifications to this script leave here a reply and i will help you.
With that script you can create any trigger command on any channel (every channel will have its own database) meaning that you can create !url on 2 different channels and with 2 different output texts (very usefull i can say  _________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
|