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.

Change irc topic based on website

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
Fire-Fox
Master
Posts: 289
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

Change irc topic based on website

Post by Fire-Fox »

Hi,

Would it be possible to make a script that change topics on irc based on website is up or down. And when the website is up again it should switch the topic back on to working again?
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
User avatar
Fire-Fox
Master
Posts: 289
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

Post by Fire-Fox »

I have this from way back but there is a

Code: Select all

set url
and I have no idea whats hidden in bot.php

Code: Select all

proc obstats.online {min hour day month year} {
global obtempcheck
## Open socket

set url "/URL/bot.php"
set nick nickname
   if {[catch {set obsock [socket -async <IP ADDRESS> 80]} sockerr]} {
      puthelp "NOTICE $nick :$sockerr"
      puthelp "NOTICE $nick :Try again later, look out the window till then!"
      close $obsock
      return 0
   }
   puts $obsock "GET $url"
   flush $obsock
   set i 0
   set j 1 
   
  set obout [gets $obsock]
  
  putlog "OB: checking if Site is online $url"
  
  if { $obtempcheck != $obout } {

  if { $obout == 000 } { putserv "TOPIC #chan : ..::: 07Velkommen til #chan <> Site - 04OFF <> 07#chan  - 04OFF ::.." }
  if { $obout == 001 } { putserv "TOPIC #chan : ..::: 07Velkommen til #chan <> Site - 04OFF <> 07#chan  - 04OFF ::.." }
  if { $obout == 010 } { putserv "TOPIC #chan : ..::: 07Velkommen til #chan <> Site - 04OFF <> 07#chan  - 04OFF ::.." }
  if { $obout == 011 } { putserv "TOPIC #chan : ..::: 07Velkommen til #chan <> Site - 04OFF <> 07#chan  - 04OFF ::.." }
  if { $obout == 100 } { putserv "TOPIC #chan : ..::: 07Velkommen til #chan <> Site - 09ON <> 07#chan  - 09ON ::.." }
  if { $obout == 101 } { putserv "TOPIC #chan : ..::: 07Velkommen til #chan <> Site - 09ON <> 07#chan  - 09ON ::.." }
  if { $obout == 110 } { putserv "TOPIC #chan : ..::: 07Velkommen til #chan <> Site - 09ON <> 07#chan  - 09ON ::.." }
  
    set obtempcheck $obout
  
    }
}    
  putlog "topic test"
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
Post Reply