Jump to content

Archived

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

chain

Horoscope

Recommended Posts

  • Administrators
Horoscope script that returns results from uk.horoscopes.yahoo.net

 

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.mindforge.org #USA-Chatmenu 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 ONOn $*: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 ENDalias 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 %sockname uk.horoscopes.yahoo.net 80    sockmark %sockname $1-2 $+(/yahoouk/,%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.0    sockwrite -n $sockname Host: uk.horoscopes.yahoo.net    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 (END HEADER CONTENT isin %Horoscope) { sockmark $sockname $addtok($sock($sockname).mark,1,32) }    elseif ( isin %Horoscope) && ($gettok($sock($sockname).mark,4,32)) {       put $gettok($sock($sockname).mark,1-2,32) $remove(%Horoscope,)      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)) > 406) {    dec %tokens    if ($len($($+($,%Tstart,-,%tokens),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 $left($strip($1),3)  var %r $replace(%s,ari,aries,tau,taurus,gem,gemini,can,cancer,leo,leo,vir,virgo,lib,libra,sco,scorpio,sag,sagittarius,cap,capricorn,aqu,aquarius,pis,pisces)  if (%s != %r) || (%s == leo) { return %r }  else { return 0 }}

Link to comment
Share on other sites



×
×
  • Create New...