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 

Information from web

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


Joined: 14 Aug 2006
Posts: 5

PostPosted: Mon Aug 14, 2006 1:32 pm    Post subject: Information from web Reply with quote

Hi
I have one PHP file in my server and it contains one line text. It is good in the way it is in the file so only thing what TCL has to do is:

When somebody says in channel !example then bot says text from PHP file to channel.


I don't have very good english, but i'll hope that somebody understands.

Best Regards
Bert
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Mon Aug 14, 2006 3:39 pm    Post subject: Reply with quote

Code:

bind pub - !example my:example

proc my:example {nick uhost hand chan text} {
  set url "http://your.web.server/page.php"
  set token [::http::geturl $url]
  set content [::http::data $token]
  ::http::cleanup $content
  foreach line [split $content \n] {
    putserv "PRIVMSG $chan :$line"
  }
}

Something like this anyway. Use this as an example. Use the search function to find more examples related to this subject. If you (or anyone else) got any questions feel free to ask (just reply).
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
TheOne1337
Voice


Joined: 14 Aug 2006
Posts: 5

PostPosted: Mon Aug 14, 2006 11:17 pm    Post subject: Reply with quote

Big big big thanks! It worked perfectly.
Back to top
View user's profile Send private message
monie089
Halfop


Joined: 29 Jul 2006
Posts: 76

PostPosted: Tue Aug 15, 2006 12:00 pm    Post subject: Reply with quote

how can i make that tell the users online from a forum
_________________
New server irc.NintendoXG.com come and visit
Back to top
View user's profile Send private message Send e-mail
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Tue Aug 15, 2006 5:01 pm    Post subject: Reply with quote

TheOne1337: You'r welcome.

monie089: in your case *erase* (using regsub for instance) the crap you don't want. Example:
Code:

regsub -all {<[^>]+>|<} $content { } content

Use it (the code I've posted above) as an example. Use the search function to find other discutions on this subject.
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
monie089
Halfop


Joined: 29 Jul 2006
Posts: 76

PostPosted: Wed Aug 16, 2006 12:29 pm    Post subject: Reply with quote

ok thanks
_________________
New server irc.NintendoXG.com come and visit
Back to top
View user's profile Send private message Send e-mail
DJmart
Voice


Joined: 08 Mar 2006
Posts: 21

PostPosted: Wed Aug 30, 2006 7:40 pm    Post subject: Reply with quote

How can I edit that so it PM's or notices the user?

Thanks.
Back to top
View user's profile Send private message Send e-mail AIM Address
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Wed Aug 30, 2006 8:48 pm    Post subject: Reply with quote

Change:

Code:
putserv "PRIVMSG $chan :$line"


To:

For PM:
Code:
putserv "PRIVMSG $nick :$line"


For Notice:
Code:
putserv "NOTICE $nick :$line"

_________________
r0t3n @ #r0t3n @ Quakenet
Back to top
View user's profile Send private message MSN Messenger
Justdabomb2
Voice


Joined: 29 Sep 2006
Posts: 37
Location: United States of America

PostPosted: Fri Sep 29, 2006 11:17 pm    Post subject: Game Stats Reply with quote

nvm *edited*

I got help

~Thanks caesar
_________________
Yeah!
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN 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