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 

put messages into specific channels

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
rayvtirx
Voice


Joined: 31 May 2010
Posts: 16
Location: bristol,england

PostPosted: Tue Apr 26, 2011 11:57 am    Post subject: put messages into specific channels Reply with quote

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 Smile
Back to top
View user's profile Send private message Visit poster's website
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Thu Jan 31, 2013 4:48 pm    Post subject: Reply with quote

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 Smile
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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