w-Horoscope

By ipewannasay on Apr 14, 2011

I know this is just noob script. I just made it for my own use till my friend ask me this script. So here it is :P

Before you use this script, make sure you have installed Simple Socket Creator.

First of all you have to write this command to set which nick you would use as bot is
/botnick

Random Quote script:
.fq
.fq homer
.fq bart
.fq quote
.fq love

Horoscope script:
.hc

BONUS:
Alay script:
.alay

on *:text:.fq*:#: {
  if ( $me == %botnick ) {
    var %idfq $right($ticks,8)
    var %snfq sockfq. [ $+ [ %idfq ] ]
    set %chan. [ $+ [ %snfq ] ] $chan
    set %nick. [ $+ [ %snfq ] ] $nick
    sockclose %snfq
    if ( quote isin $2 ) {
      set %ln. [ $+ [ %snfq ] ] /cgi-perl/randjoke.cgi?type=q
      set %hs. [ $+ [ %snfq ] ] www.jokes2go.com
    }
    elseif ( homer isin $2 ) {
      set %ln. [ $+ [ %snfq ] ] /randomizer/simpsons/homer.html
      set %hs. [ $+ [ %snfq ] ] www.smacie.com
    }
    elseif ( bart isin $2 ) {
      set %ln. [ $+ [ %snfq ] ] /randomizer/simpsons/bart.html
      set %hs. [ $+ [ %snfq ] ] www.smacie.com
    }
    elseif ( help isin $2 ) {
      msg %chan. [ $+ [ %snfq ] ] 13,1 ::11,1 %nick. [ $+ [ %snfq ] ] 13,1::11,1 Command: 8,1.fq11,1 or 8,1.fq <option> 13,1::11,1 Option value: 8,1bart11,1, 8,1homer11,1, 8,1love11,1, or 8,1quote 13,1::11,1 Ex: 8,1.fq 11,1or 8,1.fq homer 13,1:: 
      unset %chan. [ $+ [ %snfq ] ] %nick. [ $+ [ %snfq ] ]
      halt
    }
    elseif ( love isin $2 ) {
      set %ln. [ $+ [ %snfq ] ] /asst/RomanceOracle.php
      set %hs. [ $+ [ %snfq ] ] www.weeklyhoroscope.com
    }
    else {
      set %ln. [ $+ [ %snfq ] ] /
      set %hs. [ $+ [ %snfq ] ] www.fortunecookiemessage.com
    }
    sockopen %snfq %hs. [ $+ [ %snfq ] ] 80
  }
  else halt
}

on *:SOCKOPEN:sockfq*: {
  sockwrite -nt $sockname GET %ln. [ $+ [ $sockname ] ] HTTP/1.1
  sockwrite -nt $sockname Host: %hs. [ $+ [ $sockname ] ]
  sockwrite -nt $sockname $crlf
}

on *:SOCKREAD:sockfq*: {
  var %snfq $sockname
  if ($sockerr) {
    msg %chan. [ $+ [ %snfq ] ] Socket Error: %snfq $+ . Error code: $sockerr Please inform $me of this error message.
    unset %chan. [ $+ [ %snfq ] ] %nick. [ $+ [ %snfq ] ] %hs. [ $+ [ %snfq ] ] %ln. [ $+ [ %snfq ] ]
    sockclose %snfq
  }
  else {
    set %rd. [ $+ [ %snfq ] ]
    var %rdv %rd. [ $+ [ %snfq ] ]
    sockread %rdv
    if ( www.weeklyhoroscope.com isin %hs. [ $+ [ %snfq ] ] ) {
      if ( <div class=HoroscopeText isin %rdv ) {
        echo 3 -a %rdv     
        set %fqcont. [ $+ [ %snfq ] ] 8,1 " $+ $remove( $nohtml( %rdv ), $chr(9) ) $+ " 13,1:: 
      }
      elseif ( copyright isin %rdv ) {
        msg %chan. [ $+ [ %snfq ] ] 13,1 ::11,1 %nick. [ $+ [ %snfq ] ] 13,1::8,1 %fqcont. [ $+ [ %snfq ] ] 
        unset %chan. [ $+ [ %snfq ] ] %nick. [ $+ [ %snfq ] ] %fqcont. [ $+ [ %snfq ] ] %rd. [ $+ [ %snfq ] ] %hs. [ $+ [ %snfq ] ] %ln. [ $+ [ %snfq ] ]
        sockclose %snfq
      }
    }
    if ( www.jokes2go.com isin %hs. [ $+ [ %snfq ] ] ) {
      if ( <pre style= isin %rdv ) set %fqcount. [ $+ [ %snfq ] ] 1
      if ( <!-- isin %rdv ) set %fqcount. [ $+ [ %snfq ] ] 0
      if ( %fqcount. [ $+ [ %snfq ] ] == 1 ) {
        if ( %fqcont. [ $+ [ %snfq ] ] == $null ) set %fqcont. [ $+ [ %snfq ] ] $nohtml( %rdv )
        else set %fqcont. [ $+ [ %snfq ] ] %fqcont. [ $+ [ %snfq ] ] $nohtml( %rdv )
      }
      if ( </html> isin %rdv ) {
        msg %chan. [ $+ [ %snfq ] ] 13,1 ::11,1 Quote for %nick. [ $+ [ %snfq ] ] 13,1:: $+ 8,1 %fqcont. [ $+ [ %snfq ] ] $+ 13,1 :: 
        unset %chan. [ $+ [ %snfq ] ] %nick. [ $+ [ %snfq ] ] %fqcont. [ $+ [ %snfq ] ] %fqcount. [ $+ [ %snfq ] ] %rd. [ $+ [ %snfq ] ] %hs. [ $+ [ %snfq ] ] %ln. [ $+ [ %snfq ] ]
        sockclose %snfq
      }
    }
    elseif ( www.smacie.com isin %hs. [ $+ [ %snfq ] ] ) {
      if ( <big> isin %rdv ) {
        if ( homer isin %ln. [ $+ [ %snfq ] ] ) var %whospeak Homer
        if ( bart isin %ln. [ $+ [ %snfq ] ] ) var %whospeak Bart
        if ( <font face="Comic Sans MS"> isin %rdv ) set %fqcont. [ $+ [ %snfq ] ] 8,1 " $+ $nohtml( %rdv ) $+ " 13,1:: 
        if ( </font> isin %rdv ) {
          msg %chan. [ $+ [ %snfq ] ] 13,1 ::11,1 %nick. [ $+ [ %snfq ] ] 13,1:: 11,1 $+ %whospeak says $+ %fqcont. [ $+ [ %snfq ] ]
          unset %chan. [ $+ [ %snfq ] ] %nick. [ $+ [ %snfq ] ] %fqcont. [ $+ [ %snfq ] ] %rd. [ $+ [ %snfq ] ] %hs. [ $+ [ %snfq ] ] %ln. [ $+ [ %snfq ] ]
          sockclose %snfq
        }
      }
    }
    elseif ( www.fortunecookiemessage.com isin %hs. [ $+ [ %snfq ] ] ) {
      if ( <a href="cookie/ isin %rdv ) set %fqcont. [ $+ [ %snfq ] ] 8,1 " $+ $nohtml( $remove( %rdv,<p>,</p>) ) $+ " 13,1:: 
      if ( <strong>daily numbers isin %rdv ) {
        msg %chan. [ $+ [ %snfq ] ] 13,1 ::11,1 %nick. [ $+ [ %snfq ] ] 13,1::11,1 your Fortune Cookie is $+ %fqcont. [ $+ [ %snfq ] ]
        unset %chan. [ $+ [ %snfq ] ] %nick. [ $+ [ %snfq ] ] %fqcont. [ $+ [ %snfq ] ] %rd. [ $+ [ %snfq ] ] %hs. [ $+ [ %snfq ] ] %ln. [ $+ [ %snfq ] ]
        sockclose %snfq
      }
    }
  }
}

alias alay {
  if ( $me == %botnick ) {
    var %idal $right( $ticks,8)
    var %snal tkal. [ $+ [ %idal ] ]
    set %chan. [ $+ [ %snal ] ] $chan
    set %nick. [ $+ [ %snal ] ] $nick
    var %alay $replace( $1- ,ui,uwi,it,id,ck,cek,ance,ences,ng,nk,z,c,i,ee,y,ii,p,ph,f,p,v,p,w,u,q,kw,u,oo,r,L,kh,h,g,6,st,cet,da,tha,sa,tha,s,c,sh,c,sp,sep,x,ks, $( k $+ $chr(32)), $( gh $+ $chr(32) ),ku,qu,ed,ett,ya,eaph) 
    msg %chan. [ $+ [ %snal ] ] %nick. [ $+ [ %snal ] ] $+ : %alay 
  }
  else halt
}

on *:text:.alay*:#: {
  alay $2-
}

on *:text:.hc*:#: {
  if ( $me == %botnick ) {
    var %idhc $right($ticks,8)
    var %snhc sockhc. [ $+ [ %idhc ] ]
    set %chan. [ $+ [ %snhc ] ] $chan
    set %nick. [ $+ [ %snhc ] ] $nick
    set %zod. [ $+ [ %snhc ] ] $2
    var %tok $findtok(aries.taurus.gemini.cancer.leo.virgo.libra.scorpio.sagittarius.capricorn.aquarius.pisces,$2,1,46)
    if ( %tok == $null ) {
      msg %chan. [ $+ [ %snhc ] ] tidak ada zodiak $2 dalam database
      unset %chan. [ $+ [ %snhc ] ] %nick. [ $+ [ %snhc ] ] %zod. [ $+ [ %snhc ] ]
      halt
    }
    else {
      echo 3 -a %tok
      var %zod $replace( $left($2,1),$left($2,1),$upper( $left($2,1) )) $+ $mid( $2,2,$calc( $len($2)-1 ) )
      sockclose %snhc
      set %ln. [ $+ [ %snhc ] ] /ViewSignDaily $+ %zod $+ .php
      set %hs. [ $+ [ %snhc ] ] www.weeklyhoroscope.com
      echo 3 -a %hs. [ $+ [ %snhc ] ] $+ %ln. [ $+ [ %snhc ] ]
      sockopen %snhc www.weeklyhoroscope.com 80
    }
  }
  else halt
}

on *:SOCKOPEN:sockhc*: {
  sockwrite -nt $sockname GET %ln. [ $+ [ $sockname ] ] HTTP/1.1
  sockwrite -nt $sockname Host: %hs. [ $+ [ $sockname ] ]
  sockwrite -nt $sockname $crlf
  set %horcount. [ $+ [ %snhc ] ] 0
}

on *:SOCKREAD:sockhc*: {
  var %snhc $sockname
  if ($sockerr) {
    msg %chan. [ $+ [ %snhc ] ] Socket Error: %snhc $+ . Error code: $sockerr Please inform $me of this error message.
    unset %chan. [ $+ [ %snhc ] ] %nick. [ $+ [ %snhc ] ] %zod. [ $+ [ %snhc ] ] %hs. [ $+ [ %snhc ] ] %ln. [ $+ [ %snhc ] ]
    sockclose %snhc
  }
  else {
    set %rd. [ $+ [ %snhc ] ]
    var %rdv %rd. [ $+ [ %snhc ] ]
    sockread %rdv
    if ( </body> isin %rdv ) {
      msg %chan. [ $+ [ %snhc ] ] 13,1 ::11,1 %zod. [ $+ [ %snhc ] ] 13,1 $+ ::8,1 %horr. [ $+ [ %snhc ] ] 13,1:: 
      msg %chan. [ $+ [ %snhc ] ] 13,1 ::11,1 %zod. [ $+ [ %snhc ] ] 13,1 $+ :: $+ %horpts. [ $+ [ %snhc ] ] 
      unset %chan. [ $+ [ %snhc ] ] %nick. [ $+ [ %snhc ] ] %zod. [ $+ [ %snhc ] ] %hs. [ $+ [ %snhc ] ] %ln. [ $+ [ %snhc ] ] %rd. [ $+ [ %snhc ] ]
      unset %horcount. [ $+ [ %snhc ] ] %horr. [ $+ [ %snhc ] ] %horpts. [ $+ [ %snhc ] ]
      sockclose %snhc
    }
    if ( <div align=JUSTIFY class=H90Text isin %rdv ) {
      set %horcount. [ $+ [ %snhc ] ] 1
      set %horr. [ $+ [ %snhc ] ] $remove( $nohtml( %rdv ), $chr(9) )
    }
    if ( %horcount. [ $+ [ %snhc ] ] == 1 ) {
      if ( <tr bgcolor=dddddd> isin %rdv ) set %horcount. [ $+ [ %snhc ] ] 2
    }
    if ( %horcount. [ $+ [ %snhc ] ] == 2 ) {
      if ( <td width=100> isin %rdv ) {
        var %light 4,1 $str(♥, $count( %rdv, <img src=http://weeklyhoroscope.com/images/redbar.gif> ))
        var %off 14,1 $+ $str(♥, $calc( 6 - $count( %rdv, <img src=http://weeklyhoroscope.com/images/redbar.gif> )))
        if ( %horpts. [ $+ [ %snhc ] ] == $null ) set %horpts. [ $+ [ %snhc ] ] 11,1 $remove( $nohtml( %rdv ), $chr(9), $chr(32) ) %light $+ %off 13,1::
        elseif ( %horpts. [ $+ [ %snhc ] ] != $null ) {
          if ( sex/inti isin %rdv ) set %horpts. [ $+ [ %snhc ] ] %horpts. [ $+ [ %snhc ] ] $+ 11,1 Sex %light $+ %off 13,1::
          elseif ( home isin %rdv ) return
          else set %horpts. [ $+ [ %snhc ] ] %horpts. [ $+ [ %snhc ] ] $+ 11,1 $remove( $nohtml( %rdv ), $chr(9), $chr(32) ) %light $+ %off 13,1::
        }
      }
    }
  }
}

Comments

Sign in to comment.
napa182   -  Apr 14, 2011

to be honest this snippet is a horrid mess sorry to say. =/
why rely on a socket maker to run this? you should really as Jethro_ said " understand how it works instead of getting a program" .
but keep at it an get to understand sockets so you don't have to rely on a program to make them for you.
2/10

so are you saying to use the socket maker program to run this cuz of the $nohtml alias? if so why don't you include the alias in the snippet.

 Respond  
Jethro   -  Apr 14, 2011

I read the description and saw "simple socket creator." What does this snippet have to do with the "Simple Socket Creator?" I never believed in any of the socket creators out there. The only way to learn of a socket is to understand how it works instead of getting a program that gives you the bare-bone layout...

 Respond  
Elbarto   -  Apr 14, 2011

i think they meant Olay :)

 Respond  
Raicho Ichisada   -  Apr 14, 2011

alay?

 Respond  
Jethro   -  Apr 14, 2011

You meant "use at your own risk."

 Respond  
ipewannasay   -  Apr 14, 2011

Use it wifh your own risk :P

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.