Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

Horoscope for Eggdrop (tlc Code)

Recommended Posts

  • Administrators
Basic Horoscope script for Eggdrop.

Thanks to mentok for testing :)

 

Trigger: !horo sign

Chanset: +horo

 

The colors, commandchar and logo can be changed in the setup.

This script will accept the first 3 letters of your sign so you don't have to type the whole sign.

 

Example Output::

 

18:49:01 !horo sco

18:49:03 Horoscope It will be a stimulating day for you Scorpio! You'll be feeling great and you'll have no trouble channeling all your energy into your activities. But don't be surprised if you encounter some resistance. Creative as your ideas are they may not suit everyone. In fact you may be confronted

18:49:04 Horoscope with some rebelliousness. Be persuasive and you'll get your way today...

 


##############################################################################################

##  ## Horoscope.tcl for eggdrop by Ford_Lawnmower irc.geekshed.net #Script-Help        ##  ##

##############################################################################################

##      To use this script you must set channel flag +horo (ie .chanset #chan +horo)        ##

##############################################################################################

##############################################################################################

##  ##                             Start Setup.                                         ##  ##

##############################################################################################

## Change the character between the "" below to change the command character/trigger.       ##

set horoscopecmdchar "!"

proc horoscope {nick host hand chan search} {

  if {[lsearch -exact [channel info $chan] +horo] != -1} {

## Change the characters between the "" below to change the logo shown with each result.    ##

    set horoscopelogo "\002\00314H\0034o\0038r\00314o\0039s\0034c\00314o\0038p\0039e\002\003"

## Change the format codes between the "" below to change the color/state of the text.      ##

    set textf "\0034"

##############################################################################################

##  ##                           End Setup.                                              ## ##

##############################################################################################

    set horoscopesite uk.horoscopes.lifestyle.yahoo.net

	set horoscopesign [getsign $search]

	if {$horoscopesign == "error"} { 

	  putserv "PRIVMSG $chan :$horoscopelogo Valid signs are: Aquarius, Pisces, Aries, Taurus, Gemini, Cancer, Leo, Virgo, Libra, Scorpio, Sagittarius, Capricorn."

	} else {

	  set horoscopeurl /yahoouk2/${horoscopesign}/?Af=-9000

	  set horoscopefound ""

      if {[catch {set horoscopesock [socket -async $horoscopesite 80]} sockerr]} {

        putlog "$horoscopesite $horoscopeurl $sockerr error"

        return 0

        } else {

        puts $horoscopesock "GET $horoscopeurl HTTP/1.0"

        puts $horoscopesock "Host: $horoscopesite"

        puts $horoscopesock "User-Agent: Opera 9.6"

        puts $horoscopesock ""

        flush $horoscopesock

        while {![eof $horoscopesock]} {

          set horoscopevar " [gets $horoscopesock] "

          set horoscopeready [regexp -all -nocase -inline {Your free daily horoscope(.*)} $horoscopevar]

	   	  if {$horoscopeready != ""} { set horoscopefound 1 } 

		  if {$horoscopefound != "" && [regexp {

(.*)} $horoscopevar match horoscoperesult]} {

		    set horoscoperesult [textsplit $horoscoperesult 50]

		    set counter 0

		    while {$counter  $limit} {

    incr tokens -1

    if {[llength [lrange $text $start $tokens]] 

Link to comment
Share on other sites



×
×
  • Create New...