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.

Need TCL script to run a command and display result in chan

Old posts that have not been replied to for several years.
Locked
M
MnM
Voice
Posts: 17
Joined: Sat Jan 01, 2005 1:43 pm

Need TCL script to run a command and display result in chan

Post by MnM »

Hello,

Yes I did try search and found around 4 answers similar to what I am asking here except that they all display text in the chan not the result of a command.

What I have is a loaded tcl that provides the !info command to eggdrop.
Now users can run this manually whenever they want to, however, I really want eggdrop to run this command every 10 minutes and display the result in the channel. I am new to this and after trying for a couple of days I decided to ask the question.

The following links are the topic that I've found but they didnt work for me (most do put the command in the channel - !info - but eggdrop doesnt do anything with it it almost looks like is treating it as plain text to the chan rather than a command):

http://forum.egghelp.org/viewtopic.php? ... ipt+minute

http://forum.egghelp.org/viewtopic.php? ... te+command

http://forum.egghelp.org/viewtopic.php? ... te+command

Hopefully you guys can help m with this one.

Thanks.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

what command do you need to be run?
M
MnM
Voice
Posts: 17
Joined: Sat Jan 01, 2005 1:43 pm

Post by MnM »

!info - this is loaded from another tcl script
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

okay, but what does that command do? you have the source?
M
MnM
Voice
Posts: 17
Joined: Sat Jan 01, 2005 1:43 pm

Post by MnM »

ohhh sorry yes here it is:

bind pub - !info pub:turlastul

proc pub:turlastul {nick uhost handle chan arg} {
putquick "PRIVMSG $chan :Processing info list for..."
set binary {/glftpd/bin/tur-lastul.sh}
set section [lindex $arg 0]
set amount [lindex $arg 1]
foreach line [split [exec $binary $section $amount] "\n"] {
putquick "PRIVMSG $chan :$line"
}
}
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

bind time - "%0 % % % %" {pub:turlastul x x x #chan {1 2};#}
this will execute the command every 10 mins and display on #chan results of section 1, amount 2
M
MnM
Voice
Posts: 17
Joined: Sat Jan 01, 2005 1:43 pm

Post by MnM »

Thanks for that. I changed the 1 & 2 values to the correct ones and it works a treat :).

I appreciate your quick help. Thanks again.
Locked