Guest User

Untitled

a guest
Sep 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. on *:text:*:#: {
  2. if (.h == $1) {
  3. if ($2) {
  4. if ($2 == set) {
  5. if ($3) {
  6. if ($3 == aries || $3 == taurus || $3 == gemini || $3 == cancer || $3 == leo || $3 == virgo || $3 == libra || $3 == scorpio || $3 == sagittarius || $3 == capricorn || $3 == aquarius || $3 == pisces) {
  7. write -ds [ $+ [ $nick ] ] horousers.txt
  8. write horousers.txt $nick $3
  9. msg # $nick your horoscope preset is now set to: $3
  10. set %horosign $3
  11. }
  12. else { msg # You must specify an astrological sign to set it as a preset! | halt }
  13. }
  14. }
  15. else {
  16. if ($2 == aries || $2 == taurus || $2 == gemini || $2 == cancer || $2 == leo || $2 == virgo || $2 == libra || $2 == scorpio || $2 == sagittarius || $2 == capricorn || $2 == aquarius || $2 == pisces) {
  17. set %horosign $2
  18. set %horourl /horoscopes/details/ $+ $date(yyyy-mm-dd) $+ / $+ $2 $+ -daily-horoscope
  19. }
  20. else { msg # You must specify a proper astrological sign (aries, taurus, gemini, cancer, leo, virgo, libra, scorpio, sagittarius, capricorn, aquarius, pisces) or use ".h set sign" to set a preset. | halt }
  21. }
  22. }
  23. else {
  24. set %horosign $read(horousers.txt,s,$nick)
  25. if (!%horosign) { msg # To use ".h" command without any sign specified you must set a preset using ".h set sign" | halt }
  26. }
  27. set %horourl /horoscopes/details/ $+ $date(yyyy-mm-dd) $+ / $+ %horosign $+ -daily-horoscope
  28. if ($sock(horo)) .sockclose horo
  29. set %horochan $chan
  30. set %horonick $nick
  31. sockopen horo m.astrology.com 80
  32. }
  33. }
  34. on *:SOCKOPEN:horo: {
  35. sockwrite -nt $sockname GET %horourl HTTP/1.1
  36. sockwrite -nt $sockname Host: m.astrology.com
  37. sockwrite -nt $sockname $crlf
  38. }
  39. on *:SOCKREAD:horo: {
  40. if ($sockerr) {
  41. msg %chan Socket Error: $sockname $+ . Error code: $sockerr Please inform $me of this error message.
  42. halt
  43. }
  44. else {
  45. var %sockreader
  46. sockread %sockreader
  47. if (*<p>* iswm %sockreader && *</a>* !iswm %sockreader ) {
  48. set %horo $nohtml($nohtml(%sockreader))
  49. msg %horochan /horoscope/ $+ %horosign $+ / 3= %horo
  50. unset %horo*
  51. sockclose horo
  52. }
  53. }
  54. }
Add Comment
Please, Sign In to add comment