!horoscope
Platform: mIRC
Published Feb 24, 2006
Updated Mar 01, 2006
!horoscope uses
www.daily-horoscopes.com to get the latest horoscope information(updated daily): Load this script on your bot and write !horoscope <sign> in the channel to get the info abt it.
note: there is a flood protecion included to prevent users from using !horoscope more than 3 times in 5 seconds.
on *:text:!horoscope *:* {
inc -u5 %m 1
if (%m > 3) { notice $nick flood detected.please wait 4 seconds before using !horoscope again }
else {
if ($istok(Aquarius.Pisces.Aries.Taurus.Gemini.Cancer.Leo.Virgo.Libra.Scorpio.Sagittarius.Capricorn,$2,46)) {
sockopen horo www.daily-horoscopes.com 80
set %horo $2
set %channi $chan
}
else { msg $chan I dont know what is the 4 $2 Horoscope | notice $nick Horoscope usage: !horoscope <sign> }
}
}
on *:sockopen:horo: {
if (!$sockerr) {
sockwrite -n horo GET / $+ %horo $+ .php HTTP/1.0
sockwrite horo $crlf
}
}
on *:sockread:horo: {
var %tmp
if (%xa) {
sockread %tmp | msg %channi 8,12 %horo $+ : 0 $+ %tmp
sockclose horo | unset %xa | unset %channi | unset %horo
halt
}
.sockread %tmp
if (<FONT SIZE="+1"> isin %tmp) { set %xa 1 }
}