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.

help-- Output a text file to channel

Old posts that have not been replied to for several years.
Locked
C
Crypto

Post by Crypto »


Hi -

I am trying to output a text file to a channel via my bot. I have tried all the !trigger scripts I could find, but they all have the same problem. They will not output 2 lines of text that are the same.

EXAMPLE:

The text file looks like this:

commands you can use in this chan
.
!help
!list
!info
.
commands you can send to bot
!hi
!nfo
.
commands you can send to ops
!addme
!addhost

Ok ... but this is the output I get in the channel:

commands you can use in this chan
.
!help
!list
!info
commands you can send to bot
!hi
!nfo
commands you can send to ops
!addme
!addhost

Notice the period that I use as a seperator is now gone between each line. I have tried other characters in place of the period, thinking that was the problem, but it was not. No matter what I put on the line as a seperator, it will not print that line *if* it has allready printed it before.

Here is the code:

set bfile "/home/eggdrop/info.file"
set cmd "!help"
set bwhere 0

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 "NOTICE $chan :$line"
}
}
}

Thanks :smile:
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Look in your config file for this section:

# [0/1] allow a msg being twice in a queue?
set double-mode 0
set double-server 0
set double-help 0

That controls whether duplicate messages are allowed in the queue. Since you're using puthelp, try setting double-help to 1 instead of 0.
C
Crypto

Post by Crypto »


Thanks alot !!

Crypto
Locked