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 

online/offline in a greet
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Snorly
Voice


Joined: 17 Apr 2006
Posts: 25

PostPosted: Sat Jun 30, 2007 5:20 am    Post subject: online/offline in a greet Reply with quote

hello.
i was wondering if u can make me simple script that checks if site is online but it would say it when u come on channel like...

[11:08:40] * Now talking in #egghelp.org
[11:08:40] * Topic is 'bla bla bla'
[11:08:41] -bot- Welcome! the site www.egghelp.org is ONLINE!

and if the site is not online

[11:08:40] * Now talking in #egghelp.org
[11:08:40] * Topic is 'bla bla bla'
[11:08:41] -bot- Welcome! the site www.egghelp.org is OFFLINE!

tnx Smile
_________________
Si-Shell
Back to top
View user's profile Send private message
Snorly
Voice


Joined: 17 Apr 2006
Posts: 25

PostPosted: Sun Jul 01, 2007 9:28 am    Post subject: Reply with quote

i see no one replayed so this is hard?

you cant do it?
_________________
Si-Shell
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sun Jul 01, 2007 11:23 am    Post subject: Reply with quote

Snorly wrote:
i see no one replayed so this is hard?

you cant do it?

This has nothing to do with being "hard", nor with being able to do it.
My guess is that no one wants to do it.

This is a "request" forum, no one is obligated to make requests, I suggest a lot more patience.
Back to top
View user's profile Send private message
Snorly
Voice


Joined: 17 Apr 2006
Posts: 25

PostPosted: Mon Jul 02, 2007 8:31 am    Post subject: Reply with quote

oh i see Very Happy tnx anyway
_________________
Si-Shell
Back to top
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Mon Jul 02, 2007 10:41 am    Post subject: Reply with quote

What's the website you will check status on/off ?
_________________
|AmDeAtH @ Undernet


Death is only the *Beginning*...
Back to top
View user's profile Send private message Visit poster's website
Snorly
Voice


Joined: 17 Apr 2006
Posts: 25

PostPosted: Tue Jul 03, 2007 3:11 pm    Post subject: Reply with quote

http://www.partis.si
and http://www.si-shell.net
_________________
Si-Shell
Back to top
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Tue Jul 03, 2007 6:17 pm    Post subject: Reply with quote

It's not in English so atleast I can't help I am sorry.
_________________
|AmDeAtH @ Undernet


Death is only the *Beginning*...
Back to top
View user's profile Send private message Visit poster's website
Snorly
Voice


Joined: 17 Apr 2006
Posts: 25

PostPosted: Wed Jul 04, 2007 8:33 am    Post subject: Reply with quote

u can make it in English and i will edit it. Smile
_________________
Si-Shell
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Wed Jul 04, 2007 9:22 am    Post subject: Reply with quote

iamdeath wrote:
It's not in English so atleast I can't help I am sorry.

Snorly wrote:
u can make it in English and i will edit it.

I believe iamdeath meant the websites.
Back to top
View user's profile Send private message
Snorly
Voice


Joined: 17 Apr 2006
Posts: 25

PostPosted: Wed Jul 04, 2007 12:09 pm    Post subject: Reply with quote

oh ok i have some other website to check

so can u make it for -> http://www.filelist.org ?
_________________
Si-Shell
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Wed Jul 04, 2007 12:51 pm    Post subject: Reply with quote

Code:
package require http
set query "http://www.filelist.org"
set ua "Lynx"
set http [::http::config -useragent $ua]
catch {set http [::http::geturl "$query" -timeout [expr 1000 * 5]]} error
if {$error != "" } {
   putserv "NOTICE $nick :Welcome! the site ${query} is OFFLINE!"
} else {
   putserv "NOTICE $nick :Welcome! the site ${query} is ONLINE!"
}

I'm assuming that your request meant to only check if the site was loadable, not to actually scrape anything from it. The above snippet will accomplish it. Someone else can turn this into a full script for you if they care to, or you yourself can with basic tcl knowledge. Laughing
Back to top
View user's profile Send private message
Snorly
Voice


Joined: 17 Apr 2006
Posts: 25

PostPosted: Wed Jul 04, 2007 1:06 pm    Post subject: Reply with quote

yes thats it Very Happy can u add that i set a channel i dont want to greet with this on all channels Very Happy
_________________
Si-Shell
Back to top
View user's profile Send private message
Snorly
Voice


Joined: 17 Apr 2006
Posts: 25

PostPosted: Wed Jul 04, 2007 1:28 pm    Post subject: Reply with quote

and btw the bot does not greet me :S
thats what happends when i rehash the bot
[19:29:10] <h3lp> [19:50] -h3lp (help@users.si-shell.net)- Welcome! the site http://www.si-shell.net is OFFLINE!

but the web page is online
_________________
Si-Shell
Back to top
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Wed Jul 04, 2007 2:00 pm    Post subject: Reply with quote

Just because an error is returned doesn't mean its offline, speechles should of checked the error.

Maybe something like below:

Code:
package require http

bind join -|- {*} greet:join

proc greet:join {nick uhost hand chan} {
  if {[string equal -nocase #mychannel $chan]} {
    set site "http://www.mysite.com"
    set useragent "Lynx"
    set timeout "5000"; # 1000 = 1 second
    http::config -useragent $useragent
    set token [http::geturl $site -timeout 5000]
    if {[http::status $token] == "error"} {
      putserv "NOTICE $nickname :Welcome! the site $site is OFFLINE!"
    } else {
      putserv "NOTICE $nickname :Welcome! the site $site is ONLINE!"
    }
    http::cleanup $token
  }
}


Not tested.
_________________
r0t3n @ #r0t3n @ Quakenet
Back to top
View user's profile Send private message MSN Messenger
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Wed Jul 04, 2007 4:04 pm    Post subject: Reply with quote

DragnLord wrote:
iamdeath wrote:
It's not in English so atleast I can't help I am sorry.

Snorly wrote:
u can make it in English and i will edit it.

I believe iamdeath meant the websites.


That's right. I could'nt understand the web language. Smile
_________________
|AmDeAtH @ Undernet


Death is only the *Beginning*...
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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