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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
cBuster
Voice
Posts: 5 Joined: Thu Sep 22, 2005 7:06 am
Post
by cBuster » Thu Sep 22, 2005 11:26 am
Hi!
Anyone who can tell me how to make a .tcl-script that just announce everything that stands in a .txt?
Lets say that I want my bot to announce everything that stands in
http://xxx.xxxx.com/test.txt when I type !test
Anyone want do to a script like that for me?
*EDIT*
Forgot to say that I want the bot to notice the "results" for the one who typed the command. Not to all in chan or private-msg.
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Thu Sep 22, 2005 11:35 am
read the file into a list, bind to pub command and when that bind triggers, foreach element in your list putserv notice to the nick that issued command
connection, sharing, dcc problems? click
<here>
before asking for scripting help, read
<this>
use
cBuster
Voice
Posts: 5 Joined: Thu Sep 22, 2005 7:06 am
Post
by cBuster » Thu Sep 22, 2005 11:51 am
demond wrote: read the file into a list, bind to pub command and when that bind triggers, foreach element in your list putserv notice to the nick that issued command
I don't know a [censored] about .tcl. So I don't understand anything about what you said, hehe.
I thought a script like that was so simple to do that you had time to make one for me. It will take me like one week before I can do it myself. Don't have that much time so I hope a kind soul in here can help me out...
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Thu Sep 22, 2005 11:26 pm
hey this was in Script Help forum! wasn't it?
connection, sharing, dcc problems? click
<here>
before asking for scripting help, read
<this>
use
cBuster
Voice
Posts: 5 Joined: Thu Sep 22, 2005 7:06 am
Post
by cBuster » Sun Sep 25, 2005 1:13 pm
bind pub - !tmp pub:tmp
proc pub:tmp {nick uhost hand chan text} {
if ![channel get $chan tmp] return
set url "http://***.****/***.txt"
}
Something like that?
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Sun Sep 25, 2005 2:41 pm
Code: Select all
package require http
bind pub - !test foo
proc foo {n u h c t} {
set x [::http::geturl http://bar.com/moo.txt]
foreach e [split [::http::data $x] \n] {puthelp "privmsg $c :$e"}
::http::cleanup $x
}
connection, sharing, dcc problems? click
<here>
before asking for scripting help, read
<this>
use
NTHosts
Op
Posts: 100 Joined: Mon Oct 10, 2005 9:57 pm
Location: UK
Contact:
Post
by NTHosts » Sun Oct 23, 2005 7:42 am
Hello,
that script works fine if you are using just 1.
I tried 2 use a few of them 2 grab different txt files, however it just keeps on grabbing the same txt file and ignoring the rest... yes i am changing the !trigger and changing the url of the file..
Very confused... plz help
:D:D:D
]Kami[
Owner
Posts: 590 Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:
Post
by ]Kami[ » Sun Nov 06, 2005 6:42 pm
You need to change proc names aswell.
Script should look like this then:
Code: Select all
package require http
bind pub - !triger1 foo
bind pub - !triger2 foo2
proc foo {n u h c t} {
set x [::http::geturl http://bar.com/moo1.txt]
foreach e [split [::http::data $x] \n] {puthelp "privmsg $c :$e"}
::http::cleanup $x
}
proc foo2 {n u h c t} {
set x [::http::geturl http://bar.com/moo2.txt]
foreach e [split [::http::data $x] \n] {puthelp "privmsg $c :$e"}
::http::cleanup $x
}
// Thanks Sir_Fz
Last edited by
]Kami[ on Sun Nov 06, 2005 6:56 pm, edited 1 time in total.
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sun Nov 06, 2005 6:55 pm
You forgot to close the open brace of the foo proc.
NTHosts
Op
Posts: 100 Joined: Mon Oct 10, 2005 9:57 pm
Location: UK
Contact:
Post
by NTHosts » Sun Nov 06, 2005 7:38 pm
Thanks guys, works great now
lebjustice
Voice
Posts: 5 Joined: Sun Jun 17, 2007 11:20 pm
Post
by lebjustice » Wed Dec 26, 2007 7:33 am
How to make this auto check every 1 min the txt and if any 1line or 2 lines is been changed it will be auto posted in the chan. thanks
Code: Select all
package require http
bind pub - !test foo
proc foo {n u h c t} {
set x [::http::geturl http://bar.com/moo.txt]
foreach e [split [::http::data $x] \n] {puthelp "privmsg $c :$e"}
::http::cleanup $x
}