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 

Read .txt

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


Joined: 22 Sep 2005
Posts: 5

PostPosted: Thu Sep 22, 2005 11:26 am    Post subject: Read .txt Reply with quote

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? Smile

*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.
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Thu Sep 22, 2005 11:35 am    Post subject: Reply with quote

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 [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
cBuster
Voice


Joined: 22 Sep 2005
Posts: 5

PostPosted: Thu Sep 22, 2005 11:51 am    Post subject: Reply with quote

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... Smile
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Thu Sep 22, 2005 11:26 pm    Post subject: Reply with quote

hey this was in Script Help forum! wasn't it?
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
cBuster
Voice


Joined: 22 Sep 2005
Posts: 5

PostPosted: Sun Sep 25, 2005 1:13 pm    Post subject: Reply with quote

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? Laughing
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Sep 25, 2005 2:41 pm    Post subject: Reply with quote

Code:

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 [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
NTHosts
Op


Joined: 10 Oct 2005
Posts: 100
Location: UK

PostPosted: Sun Oct 23, 2005 7:42 am    Post subject: ermmmmm Reply with quote

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 Very HappyVery HappyVery HappyVery Happy
_________________
www.NT-Hosts.Net - More than just a host
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
]Kami[
Owner


Joined: 24 Jul 2003
Posts: 590
Location: Slovenia

PostPosted: Sun Nov 06, 2005 6:42 pm    Post subject: Reply with quote

You need to change proc names aswell.

Script should look like this then:

Code:
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
_________________
Slovene Eggdrop Page


Last edited by ]Kami[ on Sun Nov 06, 2005 6:56 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Nov 06, 2005 6:55 pm    Post subject: Reply with quote

You forgot to close the open brace of the foo proc.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
NTHosts
Op


Joined: 10 Oct 2005
Posts: 100
Location: UK

PostPosted: Sun Nov 06, 2005 7:38 pm    Post subject: yay Reply with quote

Thanks guys, works great now Smile
_________________
www.NT-Hosts.Net - More than just a host
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
lebjustice
Voice


Joined: 17 Jun 2007
Posts: 5

PostPosted: Wed Dec 26, 2007 7:33 am    Post subject: Reply with quote

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:
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
}

Back to top
View user's profile Send private message
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