Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;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 horoscope telah aktif }
- else {
- Set %HoroscopeChanList $addtok(%HoroscopeChanList,$+($network,$chan),32)
- .msg $chan $nick telah mengaktifkan fitur horoscope di $chan .
- }
- }
- else {
- if (!$istok(%HoroscopeChanList,$+($network,$chan),32)) { .msg $chan $nick $+ , $chan tidak mengaktifkan fitur horoscope }
- else {
- Set %HoroscopeChanList $remtok(%HoroscopeChanList,$+($network,$chan),1,32)
- .msg $chan $nick telah mematikan fitur horoscope di $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 05Ok $nick $+ . Please wait05...
- var %sockname $+(Horoscope,$network,$2,$ticks)
- sockopen %sockname uk.astrology.yahoo.com 80
- sockmark %sockname $1-2 $+(/channels/horoscopes_astrology/horoscopes.php?sign=,%sign)
- }
- else { $1-2 05Ketik zodiak kamu setelah !horo, contoh: !horo gemini }
- }
- 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 (Location:* iswm %horoscope) {
- tokenize 32 $sock($sockname).mark
- sockclose $sockname
- var %sockname $+(Horoscope,$network,$2,$ticks),
- sockopen %sockname uk.astrology.yahoo.com 80
- sockmark %sockname $1-2 $+(/horoscopes/,$gettok(%horoscope,4,47),/)
- }
- elseif ($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 %s
- else { return 0 }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement