Advertisement
glacier_rat

Untitled

Mar 13th, 2011
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.72 KB | None | 0 0
  1. alias greet {
  2. if ($1 == update) {
  3. var %name $hget(greet,name)
  4. sockopen greet hiscore.runescape.com 80
  5. sockmark greet %name
  6. }
  7. elseif ($1 == set) {
  8. if (!$2) || (!$3) { echo -a Error: you must specify something to set and a value! | halt }
  9. if ($2 == name) {
  10. hadd -m greet name $3
  11. echo -a You have updated your name to $3 $+ !
  12. }
  13. elseif ($2 == timer) {
  14. hadd -m greet timer $calc($3 *60)
  15. .timergreet 9999 $calc($3 *60) greet update
  16. echo -a You have updated the timer to $3 minute intervals!
  17. }
  18. elseif ($2 == notice) {
  19. hadd -m greet notice $iif($3 == on,on,off)
  20. echo -a You have turned notices $iif($3 == on,on,off) $+ !
  21. }
  22. elseif ($2 == start) {
  23. hadd -m greet start $3
  24. echo -a You have set the start to $3
  25. }
  26. elseif ($2 == end) {
  27. hadd -m greet end $3
  28. echo -a You have set the end to $3
  29. }
  30. hsave greet greet.hsh
  31. }
  32. }
  33. alias gret { if ($prop == s) { return $hget(greet,start) } | elseif ($prop == e) { return $hget(greet,end) } }
  34. alias -l hs { tokenize 44 $hget(greet,$skill($1)) | if ($prop == r) { return $1 } | elseif ($prop == x) { return $3 } | else { return $2 } }
  35. alias -l na { return $iif($len($1) isnum 4-6,$bytes($calc($1 /1000),3d) $+ K,$iif($len($1) isnum 7-9,$bytes($calc($1 /1000000),3d) $+ M,$iif($len($1) isnum 10-12,$bytes($calc($1 /1000000000),3d) $+ B,$1))) }
  36. alias -l skill { var %a = Overall,Attack,Defence,Strength,Hitpoints,Ranged,Prayer,Magic,Cooking,Woodcutting,Fletching,Fishing,Firemaking,Crafting,Smithing,Mining,Herblore,Agility,Thieving,Slayer,Farming,Runecrafting,Hunter,Construction,Summoning) | return $gettok(%a,$1,44) }
  37. alias -l cmb {
  38. tokenize 32 $1
  39. if ($calc($1 + $2) > $calc($6 *1.5)) && ($calc($1 + $2) > $calc($7 *1.5)) { var %type = melee }
  40. else { var %type $iif($6 < $7,magic,range) }
  41. var %a = $calc(100 * $3)
  42. var %b = $calc(100 * $4)
  43. var %c = $calc($iif(2 // $5,50 * $5,50 * $calc($5 -1)))
  44. var %d = $iif($prop = p2p,$calc($iif(2 // $8,50 * $8,$iif($8 != 1,50 * $calc($8 -1),50))),0)
  45. var %base = $calc((%a + %b + %c + %d)/400)
  46. if (%type == melee) return $calc(($1 * 130 + $2 * 130)/400 + %base)
  47. elseif (%type == range) return $calc($iif(2 // $6,$6 * 195,$calc($6 * 195 - 65))/400 + %base)
  48. elseif (%type == magic) return $calc($iif(2 // $7,$7 * 195,$calc($7 * 195 - 65))/400 + %base)
  49. }
  50. on *:SOCKOPEN:greet:{
  51. var %s $sockname
  52. sockwrite -nt %s GET $+(/index_lite.ws?player=,$sock(%s).mark)
  53. sockwrite -nt %s Host: hiscore.runescape.com
  54. sockwrite -nt %s $crlf
  55. }
  56. On *:START:{
  57. hmake greet 30
  58. hload greet greet.hsh
  59. }
  60. on *:SOCKREAD:greet:{
  61. var %s = $sockname
  62. if ($sockerr) {
  63. echo -a SOCKET ERROR! greet has failed with -> $sock(%s).wsmsg | sockclose %s | halt
  64. }
  65. var %g
  66. sockread %g
  67. if (404 - Page not found isin %g) {
  68. echo -a $sock(%s).mark isn't in the highscores! | sockclose %s | halt
  69. }
  70. elseif (*,*,* iswm %g) {
  71. var %a 1
  72. while (%a <= 26) {
  73. hadd -m greet $skill(%a) %g
  74. sockread %g
  75. inc %a
  76. }
  77. if (%a == 27) {
  78. goto end
  79. }
  80. :end
  81. var %cmb1 = $cmb($hs(2) $hs(4) $hs(3) $hs(5) $hs(7) $hs(6) $hs(8) $hs(25)).p2p
  82. var %cmb2 = $cmb($hs(2) $hs(4) $hs(3) $hs(5) $hs(7) $hs(6) $hs(8) $hs(25))
  83. var %greet $gret().s $hs(1) $+ /2496 : $na($hs(1).x) $+ /417,099,511. total %cmb1 $+ / $+ %cmb2 $+ /138.35 $gret().e
  84. ns set greet %greet
  85. hadd -m greet last %greet
  86. .timergreet 9999 $hget(greet,timer) greet update
  87. sockclose greet
  88. }
  89. }
  90. on ^*:NOTICE:*:?:{
  91. if ($nick == Nickserv) && ($hget(greet,last) isin $1-) {
  92. if ($hget(greet,notice) == on) {
  93. haltdef
  94. echo -a Greet has been updated!
  95. }
  96. else {
  97. haltdef
  98. }
  99. }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement