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.

put messages into specific channels

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
r
rayvtirx
Voice
Posts: 16
Joined: Mon May 31, 2010 9:35 am
Location: bristol,england
Contact:

put messages into specific channels

Post by rayvtirx »

Code: Select all

# 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 :)
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

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 :)
Post Reply