Horoscope script that returns results from uk.horoscopes.yahoo.net
THIS SCRIPT NOW REQUIRES SSL!!
***Download and install OpenSSL: http://www.mirc.com/download/openssl/openssl-0.9.8r-setup.exe if needed.
To use:
Load the script into remotes and per the suggestion by NXArmada, type +horo in each channel you want the script to run in.
Triggers are:
!horo sign : Will notice the user.
@horo sign : Will message the channel if the user has halfops or higher.
+horo : Will turn the script on in the current channel.
-horo : Will turn the script off in the current channel.
Note The sign name only needs the first three letters.
There is also a master ON/OFF switch in the right click channel/status menu.
Example output:
21:40:14 @horo vir
21:40:15 Searching for Horoscope Please Wait........................
21:40:18 Horoscope More than likely there was at least one time in your life in which you felt like the ugly ducking Virgo. Perhaps this had something to do with your weight. Whether this feeling of insecurity or self-consciousness was self-imposed or not it’s time to rid yourself of such thoughts and feelings. Today is a day to love every bit of yourself. Have pride in your body inside and out.
;Horoscope script by Ford_Lawnmower irc.Geekshed.net #Script-Help
menu Channel,Status {
.$iif($group(#Horoscope) == On,$style(1)) Horoscope Trigger
..$iif($group(#Horoscope) == On,$style(2)) On: .enable #Horoscope
..$iif($group(#Horoscope) == Off,$style(2)) Off: .disable #Horoscope
}
#Horoscope ON
On $*:Text:/^(\+|-|!|@)Horo/Si:#: {
;Change line 10 to change the trigger character. Valid characters are @ and !. If you want to use another character you will have to add it to the regex on line 8.
var %CommandChar !
var %action $regml(1)
if (%action isin +-) && ($regex($nick($chan,$nick).pnick,/(!|~|&|@)/)) {
if (%action == +) {
if ($istok(%HoroscopeChanList,$+($network,$chan),32)) { .msg $chan $nick $chan is already running the Horoscope script }
else {
Set %HoroscopeChanList $addtok(%HoroscopeChanList,$+($network,$chan),32)
.msg $chan $nick has activated the Horoscope script for $chan .
}
}
else {
if (!$istok(%HoroscopeChanList,$+($network,$chan),32)) { .msg $chan $nick $chan is not running the Horoscope script }
else {
Set %HoroscopeChanList $remtok(%HoroscopeChanList,$+($network,$chan),1,32)
.msg $chan $nick has deactivated the Horoscope script for $chan .
}
}
}
elseif (!$timer($+(Horoscope,$network,$nick))) && ($istok(%HoroscopeChanList,$+($network,$chan),32)) {
.timer $+ $+(Horoscope,$network,$nick) 1 6 noop
var %method $iif(%action == %CommandChar,.notice $nick,$iif($regex($nick($chan,$nick).pnick,/(!|~|&|@|%)/),.msg $chan,.notice $nick))
GetHoroscope %method $2-
}
}
#Horoscope END
alias Horoscope { GetHoroscope echo -a $1- }
alias -l GetHoroscope {
if ($signcheck($3)) {
var %sign $v1
$1-2 04Searching for Horoscope Please Wait05........................
var %sockname $+(Horoscope,$network,$2,$ticks)
sockopen -e %sockname uk.astrology.yahoo.com 443
sockmark %sockname $1-2 $+(/horoscopes/,%sign,/)
}
else { $1-2 04Please provide a valid sign! Syntax !Horo sign }
}
On *:sockopen:Horoscope*: {
if (!$sockerr) {
sockwrite -nt $sockname GET $gettok($sock($sockname).mark,3,32) HTTP/1.1
sockwrite -n $sockname Host: $sock($sockname).addr
sockwrite -n $sockname $crlf
}
else { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
}
On *:sockread:Horoscope*: {
if ($sockerr) { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
else {
var %Horoscope | sockread %Horoscope
if ($regex(%Horoscope,<div class="astro-tab-body">(.*?)<\/div>)) {
put $gettok($sock($sockname).mark,1-2,32) $+($regml(1),.)
sockclose $sockname
return
}
}
}
alias -l Put {
if (!$regex($1,/(\.|^)(msg|notice|echo)$/Si)) || (!$3) { echo -st **Put error** Syntax /Put msg #channel text - or - /Put notice nickname text | return }
var %tokens $0, %Tstart 3, %Dtimer 1500
if ($timer($+(Put,$2,$network)).secs) { %Dtimer = $calc($v1 * 1000) }
while ($len($($+($,%Tstart,-,%tokens),2)) > 350) {
dec %tokens
if ($len($($+($,%Tstart,-,%tokens),2)) <= 350) {
.timer -m 1 %Dtimer $1-2 05H14oroscope0504 $($+($,%Tstart,-,%tokens),2))
inc %Dtimer 1500
%Tstart = $calc(%tokens + 1)
%tokens = $0
}
}
.timer -m 1 %Dtimer $1-2 05H14oroscope0504 $($+($,%Tstart,-,%tokens),2))
.timer $+ $+(Put,$2,$network) -m 1 $calc(%Dtimer + 1500) noop
}
alias -l SignCheck {
var %s $lower($left($strip($1),3))
if ($istok(ari tau gem can leo vir lib sco sag cap aqu pis,%s,32)) {
return $replace(%s,ari,aries,tau,taurus,gem,gemini,can,cancer,vir,virgo,lib,libra,sco,scorpio,sag,sagittarius,cap,capricorn,aqu,aquarius,pis,pisces)
}
else { return 0 }
}
No idea incognitus.
I can try to sort it , but I need to see what is happening.
Pls. load this debug code : http://scriptbin.net/view/00aa2a95
Do @horo sign one time , then /run horoscope.txt
Pastebin the contents of horoscope.txt and post the link here and I will try to trace the problem.
Just taking a stab at it based on your source.
Try this edit incognitus : http://scriptbin.net/view/5b2dbb26
One more try before I call it a day : http://scriptbin.net/view/fb05647d
Okay incognitus, I just made a new parser with horoscope.com : http://scriptbin.net/view/ff1c94d7
I just loaded this script, have the confirmation that I activated it in the channel, but it doesn't return a horoscope. It hangs at "Searching for Horoscope Please Wait........................"
I've been looking for a working horoscope script and this one, from the comments; looked like it was working great. Any help would be appreciated.
Thanks
@Karman It looks like they are doing some changes to the site. They do not have any horoscopes posted right now so I can't check the script. http://uk.astrology.yahoo.com/horoscopes/
I will watch the site and fix the script, if needed, when they start posting horoscopes again.
@RIcko This script is working fine, as are the all the other scripts you posted comments on.
Please stop posting for a few moments so we can sort your problem.
13:24:49 <@Ford_Lawnmower> +horo
13:24:49 <oogleBoogle Ford_Lawnmower has activated the Horoscope script for #FordIRC .
13:24:58 <@Ford_Lawnmower> @horo sag
13:24:58 < GoogleBoogle Searching for Horoscope Please Wait........................
13:25:01 <GoogleBoogle Horoscope A loan or donation or even doing work over and beyond the call of duty will not buy any special favours. Your boss isn't going to single you out for promotion because you've been putting yourself out to please them. A colleague will quickly forget how you helped ease their workload when you suddenly find yourself competing against each other. It won't be the first time
13:25:01 < GoogleBoogle you feel let down in this way but
13:25:02 <GoogleBoogle Horoscope your conscience is clear. Keep that at the forefront of your mind.
+horo requires ops
@horo will message the channel
!horo will notice the user
Please explain the problem you are having in detail.
If you are using a non standard network like justin.tv please include that.
Actually I do have a Spanish Horoscope script Gran_lider_negro .
It's a lot better than this one though.
Triggers are:
!horo sign : Will notice the user.
@horo sign : Will message the channel if the user has halfops or higher.
+horo : Will turn the script on in the current channel.(Requires ops)
-horo : Will turn the script off in the current channel.(Requires ops)
Note The sign name only needs the first three letters.
There is also a master ON/OFF switch in the right click channel/status menu.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Horoscope in Spanish by Ford_Lawnmower irc.abjects.net #mIRC
alias -l sets {
goto $prop
:Salud
return $+($chr(15),$chr(3),03)
:Dinero
return $+($chr(15),$chr(3),07)
:Amor
return $+($chr(15),$chr(3),04)
:Familia
return $+($chr(15),$chr(3),06)
:Stars-
return $+($chr(15),$chr(3),14)
:TagColor
return $+($chr(15),$chr(2),$chr(31))
:TextColor
return $+($chr(15))
:PreTextColor
return $+($chr(15),$chr(3),12)
:Delim
return $+($chr(15),¤)
:Flood
return 15
}
menu Channel,Status {
.$iif($group(#SpanishHoroscope) == On,$style(1)) SpanishHoroscope Trigger
..$iif($group(#SpanishHoroscope) == On,$style(2)) On: .enable #SpanishHoroscope
..$iif($group(#SpanishHoroscope) == Off,$style(2)) Off: .disable #SpanishHoroscope
}
#SpanishHoroscope on
On $*:Text:/^(\+|-|!|@)horo.*/Si:#: {
var %action $regml(1)
if (%action isin +-) && ($regex($nick($chan,$nick).pnick,/(!|~|&|@)/)) {
if (%action == +) {
if ($istok(%SpanishHoroscopeChanList,$+($network,$chan),32)) { .msg $chan $nick $chan ya se está ejecutando el guión Horoscope. }
else {
.enable #SpanishHoroscope
Set %SpanishHoroscopeChanList $addtok(%SpanishHoroscopeChanList,$+($network,$chan),32)
.msg $chan $nick ha puesto en marcha el guión de Horoscope $chan .
}
}
else {
if (!$istok(%SpanishHoroscopeChanList,$+($network,$chan),32)) { .msg $chan $nick $chan no se está ejecutando el guión Horoscope. }
else {
Set %SpanishHoroscopeChanList $remtok(%SpanishHoroscopeChanList,$+($network,$chan),1,32)
.msg $chan $nick ha desactivado la escritura de Horoscope $chan .
}
}
}
elseif (!$timer($+(SpanishHoroscope,$network,$nick))) && ($istok(%SpanishHoroscopeChanList,$+($network,$chan),32)) {
.timer $+ $+(SpanishHoroscope,$network,$nick) 1 $sets().flood noop
var %method $iif(%action == !,.notice $nick,$iif($regex($nick($chan,$nick).pnick,/(!|~|&|@|%\+)/),.msg $chan,.notice $nick))
if (!$sign($2)) %method Correct syntax is: !horoscope <signo>
else GetSpanishHoroscope %method $sign($2) $3
}
}
#SpanishHoroscope end
alias SpanishHoroscope { GetSpanishHoroscope echo -a $sign($1) }
alias -l GetSpanishHoroscope {
var %sockname $+(SpanishHoroscope,$network,$2,$ticks)
sockopen %sockname servicios.aol.com 80
svar %sockname method $1-2
svar %sockname get $+(/content/astrologia/horoscopos-2009/signos/signo.php?Domain=http://tuvida.aol.com/&Signo=,$3,$iif($4 == a || $4 == m,$+(&F=,$upper($v1))))
}
On *:sockopen:SpanishHoroscope*: {
if (!$sockerr) {
sockwrite -nt $sockname GET $svar($sockname,get) HTTP/1.0
sockwrite -n $sockname Host: servicios.aol.com
sockwrite -n $sockname $crlf
}
else { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
}
On *:sockread:SpanishHoroscope*: {
if ($sockerr) { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
else {
var %SpanishHoroscope | sockread %SpanishHoroscope
if ($regex(check,%SpanishHoroScope,/<td><strong>(.*?)<\/strong><br>/i)) {
svar $sockname horofound 1|date $regml(check,1)
}
elseif ($svar($sockname,horofound) && $regex(check,%SpanishHoroscope,(.*?)<\/td>)) {
svar $sockname horofound 0|horo $regml(check,1)
}
elseif ($regex(check,%SpanishHoroscope,/<td><img\ssrc="\.\.\/images\/stars\/(.*?)\.gif"><\/td>/i)) {
svar $sockname starfound $calc($svar($sockname,starfound) + 1)
svar $sockname $gettok(salud|dinero|amor|familia,$svar($sockname,starfound),124) $regml(check,1)
}
elseif ($regex(check,%SpanishHoroscope,/<span\sclass="amuletosubtitulo">(.*?)<\/span>/i)) {
svar $sockname amulet 1|amulet_prefix $regml(check,1)
}
elseif ($regex(check,%SpanishHoroscope,/<strong>(.*?)<\/strong>/i)) {
svar $sockname extrafound $calc($svar($sockname,extrafound) + 1)
svar $sockname $gettok(santo|numero|color|sorpresa,$svar($sockname,extrafound),124) $regml(check,1)
}
elseif ($svar($sockname,amulet) && $regex(check,%SpanishHoroscope,(.*?)<\/td>)) {
var %salud $+($sets().tagcolor,Salud,$chr(15),:,$chr(32),$stars($sets().salud,$svar($sockname,salud),$sets().stars-))
var %dinero $+($sets().tagcolor,Dinero,$chr(15),:,$chr(32),$stars($sets().dinero,$svar($sockname,dinero),$sets().stars-))
var %amor $+($sets().tagcolor,Amor,$chr(15),:,$chr(32),$stars($sets().amor,$svar($sockname,amor),$sets().stars-))
var %familia $+($sets().tagcolor,Familia,$chr(15),:,$chr(32),$stars($sets().familia,$svar($sockname,familia),$sets().stars-))
var %amuleto $sets().tagcolor $+ Amuleto del $+(día,$chr(15),:) $+($sets().pretextcolor,$svar($sockname,amulet_prefix),$chr(15)) $sets().delim $+($sets().textcolor,$regml(check,1))
var %santo $sets().tagcolor $+ Santo del $+(día,$chr(15),:) $+($sets().pretextcolor,$svar($sockname,santo),$chr(15))
var %numero $sets().tagcolor $+ Número del $+(día,$chr(15),:) $+($sets().pretextcolor,$svar($sockname,numero),$chr(15))
var %color $sets().tagcolor $+ Color del $+(día,$chr(15),:) $+($sets().pretextcolor,$svar($sockname,color),$chr(15))
var %sorpresa $+($sets().tagcolor,Sorpresa,$chr(15),:) $+($sets().pretextcolor,$svar($sockname,sorpresa),$chr(15))
put $svar($sockname,method) $+($sets().tagcolor,Date,$chr(15),:) $+($sets().textcolor,$svar($sockname,date))
put $svar($sockname,method) $+($sets().tagcolor,Info,$chr(15),:) $+($sets().textcolor,$svar($sockname,horo))
put $svar($sockname,method) %salud %dinero %amor %familia $sets().delim %santo $sets().delim %numero $sets().delim %color $sets().delim %sorpresa
put $svar($sockname,method) %amuleto
sockclose $sockname
return
}
}
}
alias -l Stars {
return $+($1,$str(*,$2),$3,$str(*,$calc(5 - $2)))
}
alias -l Svar {
var %sockname $1, %item $2
if ($isid) {
if ($regex(Svar,$sock(%sockname).mark,/ $+ %item $+ \x01([^\x01]*)/i)) return $regml(Svar,1)
}
else {
tokenize 124 $2-
var %count 1
while (%count <= $0) {
var %record $($+($,%count),2), %item $gettok(%record,1,32), %value $gettok(%record,2-,32)
if (!$regex($sock(%sockname).mark,/ $+ %item $+ \x01/i)) sockmark %sockname $+($sock(%sockname).mark,$chr(1),%item,$chr(1),%value)
else sockmark %sockname $regsubex($sock(%sockname).mark,/( $+ %item $+ \x01[^\x01]*)/i,$+(%item,$chr(1),%value))
inc %count
}
}
}
alias -l sign {
var %signs acu|ari|cap|can|sco|gem|leo|lib|pis|sag|tau|vir, %sign $replace($utfdecode($strip($1)),á,a,é,e,q,c)
if ($findtok(%signs,$left(%sign,3),1,124) || $findtok(%signs,$mid(%sign,2,3),1,124)) { return $v1 }
}
alias -l Put {
if (!$regex($1,/(\.|^)(msg|notice|echo)$/Si)) || (!$3) { echo -st **Put error** Syntax /Put msg #channel text - or - /Put notice nickname text | return }
tokenize 32 $regsubex($1-,/([$\|%\[\]][^\s]*)/g,$+($chr(2),$chr(2),\t))
var %tokens $0, %Tstart 4, %Dtimer 1500
if ($timer($+(Put,$2,$network)).secs) { %Dtimer = $calc($v1 * 1000) }
while ($len($($+($,%Tstart,-,%tokens),2)) > 430) {
dec %tokens
if ($len($($+($,%Tstart,-,%tokens),2)) <= 430) {
.timer -m 1 %Dtimer $1-2 $3 $($+($,%Tstart,-,%tokens),2))
inc %Dtimer 1500
%Tstart = $calc(%tokens + 1)
%tokens = $0
}
}
.timer -m 1 %Dtimer $1-2 $3 $($+($,%Tstart,-,%tokens),2))
.timer $+ $+(Put,$2,$network) -m 1 $calc(%Dtimer + 1500) noop
}
Laughs I don't like that one much :P
More than likely there was at least one time in your life in which you felt like the ugly ducking, Virgo. Perhaps this had something to do with your weight. Whether this feeling of insecurity or self-consciousness was self-imposed or not, it’s time to rid yourself of such thoughts and feelings. Today is a day to love every bit of yourself. Have pride in your body inside and out.
Poor Virgo, haha.
This could be someones favorite site though. You should make a post out of it in case someone doesn't like the other sites.
Personally I don't believe in crap like horoscopes but some people do.
Yea im having the exact same issue. FordLawnmower can you take a look at this please? Much appreciated as usual ;)