!horoscope uses www.daily-horoscopes.com to get the latest horoscope information(updated daily): Load this script on your bot and write !horoscope 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 }
}
What about making a horoscope animal like Sagittarius is a rat. Chinese Horoscope Animal Signs.
!sagittarius Sagittarius: Your friends and family have a lot to say today -- too much, most likely! That doesn't mean you should blow them off, but at some point your impatience is sure to show through. Then it's time to act! !rat Rat: Proceed with caution on the day of the Wood Rabbit. Treading lightly around others could help defend against gossips and petty attacks on your character. Spending frugally is advisable, as these times could put a strain on your checkbook and unforeseen expenditures might begin to pile up.if ($2 isin AquariusPiscesAriesTaurusGeminiCancerLeoVirgoLibraScorpioSagittariusCapricorn) {
You could
if ($istok(Aquarius.Pisces.Aries.Taurus.Gemini.Cancer.Leo.Virgo.Libra.Scorpio.Sagittarius.Capricorn,$2,46))
That would prevent someone trying !horoscpe Tau or !horoscope a
Also, make sure the socket isnt open with if ($sock(horo))
It will give you annoying errors if you try reopening a socket thats already opened
Bear
i think he means cause your missing a : at the end. although it still seems to work without it. i always thought it was necessary.
Instead of
if ($2 isin AquariusPiscesAriesTaurusGeminiCancerLeoVirgoLibraScorpioSagittariusCapricorn) {
i\'d suggest using $istok(Aquarius|pisces|...,$2,124) or something, the way it is now will trigger on bogus things like !horoscope a or !horoscope nican lol