Advertisement
pony

Horoscope new

Aug 31st, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.87 KB | None | 0 0
  1. ;Horoscope script by Ford_Lawnmower irc.Geekshed.net #Script-Help
  2. menu Channel,Status {
  3. .$iif($group(#Horoscope) == On,$style(1)) Horoscope Trigger
  4. ..$iif($group(#Horoscope) == On,$style(2)) On: .enable #Horoscope
  5. ..$iif($group(#Horoscope) == Off,$style(2)) Off: .disable #Horoscope
  6. }
  7. #Horoscope ON
  8. On $*:Text:/^(\+|-|!|@)Horo/Si:#: {
  9. ;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.
  10. var %CommandChar !
  11. var %action $regml(1)
  12. if (%action isin +-) && ($regex($nick($chan,$nick).pnick,/(!|~|&|@)/)) {
  13. if (%action == +) {
  14. if ($istok(%HoroscopeChanList,$+($network,$chan),32)) { .msg $chan $nick $+ , $chan horoscope telah aktif }
  15. else {
  16. Set %HoroscopeChanList $addtok(%HoroscopeChanList,$+($network,$chan),32)
  17. .msg $chan $nick telah mengaktifkan fitur horoscope di $chan .
  18. }
  19. }
  20. else {
  21. if (!$istok(%HoroscopeChanList,$+($network,$chan),32)) { .msg $chan $nick $+ , $chan tidak mengaktifkan fitur horoscope }
  22. else {
  23. Set %HoroscopeChanList $remtok(%HoroscopeChanList,$+($network,$chan),1,32)
  24. .msg $chan $nick telah mematikan fitur horoscope di $chan .
  25. }
  26. }
  27. }
  28. elseif (!$timer($+(Horoscope,$network,$nick))) && ($istok(%HoroscopeChanList,$+($network,$chan),32)) {
  29. .timer $+ $+(Horoscope,$network,$nick) 1 6 noop
  30. var %method $iif(%action == %CommandChar,.notice $nick,$iif($regex($nick($chan,$nick).pnick,/(!|~|&|@|%)/),.msg $chan,.notice $nick))
  31. GetHoroscope %method $2-
  32. }
  33. }
  34. #Horoscope END
  35. alias Horoscope { GetHoroscope echo -a $1- }
  36. alias -l GetHoroscope {
  37. if ($signcheck($3)) {
  38. var %sign $v1
  39. $1-2 05Ok $nick $+ . Please wait05...
  40. var %sockname $+(Horoscope,$network,$2,$ticks)
  41. sockopen %sockname uk.astrology.yahoo.com 80
  42. sockmark %sockname $1-2 $+(/channels/horoscopes_astrology/horoscopes.php?sign=,%sign)
  43. }
  44. else { $1-2 05Ketik zodiak kamu setelah !horo, contoh: !horo gemini }
  45. }
  46. On *:sockopen:Horoscope*: {
  47. if (!$sockerr) {
  48. sockwrite -nt $sockname GET $gettok($sock($sockname).mark,3,32) HTTP/1.1
  49. sockwrite -n $sockname Host: $sock($sockname).addr
  50. sockwrite -n $sockname $crlf
  51. }
  52. else { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
  53. }
  54. On *:sockread:Horoscope*: {
  55. if ($sockerr) { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
  56. else {
  57. var %Horoscope | sockread %Horoscope
  58. if (Location:* iswm %horoscope) {
  59. tokenize 32 $sock($sockname).mark
  60. sockclose $sockname
  61. var %sockname $+(Horoscope,$network,$2,$ticks),
  62. sockopen %sockname uk.astrology.yahoo.com 80
  63. sockmark %sockname $1-2 $+(/horoscopes/,$gettok(%horoscope,4,47),/)
  64. }
  65. elseif ($regex(%Horoscope,<div class="astro-tab-body">(.*?)<\/div>)) {
  66. put $gettok($sock($sockname).mark,1-2,32) $+($regml(1),.)
  67. sockclose $sockname
  68. return
  69. }
  70. }
  71. }
  72. alias -l Put {
  73. if (!$regex($1,/(\.|^)(msg|notice|echo)$/Si)) || (!$3) { echo -st **Put error** Syntax /Put msg #channel text - or - /Put notice nickname text | return }
  74. var %tokens $0, %Tstart 3, %Dtimer 1500
  75. if ($timer($+(Put,$2,$network)).secs) { %Dtimer = $calc($v1 * 1000) }
  76. while ($len($($+($,%Tstart,-,%tokens),2)) > 350) {
  77. dec %tokens
  78. if ($len($($+($,%Tstart,-,%tokens),2)) <= 350) {
  79. .timer -m 1 %Dtimer $1-2 05H14oroscope0504 $($+($,%Tstart,-,%tokens),2))
  80. inc %Dtimer 1500
  81. %Tstart = $calc(%tokens + 1)
  82. %tokens = $0
  83. }
  84. }
  85. .timer -m 1 %Dtimer $1-2 05H14oroscope0504 $($+($,%Tstart,-,%tokens),2))
  86. .timer $+ $+(Put,$2,$network) -m 1 $calc(%Dtimer + 1500) noop
  87. }
  88. alias -l SignCheck {
  89. var %s $lower($left($strip($1),3))
  90. if ($istok(ari tau gem can leo vir lib sco sag cap aqu pis,%s,32)) return %s
  91. else { return 0 }
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement