Advertisement
Guest User

Untitled

a guest
May 28th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. on $*:TEXT:/^[!@.]top10/Si:#: {
  2. if (!$skl($2)) && ($2) { notice $nick skill not found | halt }
  3. if (!$2) {
  4. var %b $right($ticks,6)
  5. set %n $nick
  6. set %top.num $+ %b $chr(48)
  7. set %top.msg $+ %b $iif($left($1,1) == @,msg #,.notice $nick)
  8. sockopen top10 $+ %b rscript.org 80
  9. }
  10. elseif ($2 != $null) {
  11. var %b $right($ticks,6)
  12. set %n $nick
  13. set %top.num $+ %b $replace($2-,$chr(32),_)
  14. set %top.msg $+ %b $iif($left($1,1) == @,msg #,.notice $nick)
  15. sockopen top10 $+ %b rscript.org 80
  16. }
  17. }
  18. on *:sockopen:top10*: {
  19. sockwrite -nt $sockname GET $iif(%top.num [ $+ [ $right($sockname,6) ] ] == 0,/lookup.php?type=top10&table=0,/lookup.php?type=top10&table= $+ $skilnum(%top.num [ $+ [ $right($sockname,6) ] ])) HTTP/1.1
  20. sockwrite -nt $sockname Host: rscript.org
  21. sockwrite -nt $sockname $crlf
  22. }
  23. on *:sockread:top10*: {
  24. var %read
  25. var %a = 0
  26. while ($sock($sockname).rq > 0) {
  27. sockread %read
  28. echo -a %read
  29. set %x [ $+ [ $right($sockname,6) ] ] %x [ $+ [ $right($sockname,6) ] ] $gettok(%read,4,32) $chr(40) $+ $gettok(%read,3,32) $+ $chr(41) $chr(124) %a $+ :
  30. inc %a
  31. }
  32. %top.msg [ $+ [ $right($sockname,6) ] ] $chr(40) $+ $upper($iif(%top.num [ $+ [ $right($sockname,6) ] ] == 0, Overall top10,$skl(%top.num [ $+ [ $right($sockname,6) ] ]) top10)) $+ $chr(41) $left($right(%x [ $+ [ $right($sockname,6) ] ],-61),-15)
  33. sockclose $sockname
  34. }
  35. alias skilnum {
  36. if ($regex($1,/(all|overal(l)?)/i)) return $chr(48)
  37. if ($regex($1,/att(a(c)?k)?/i)) return 1
  38. if ($regex($1,/(def(en[sc]e)?)/i)) return 2
  39. if ($regex($1,/str(ength)?$/i)) return 3
  40. if ($regex($1,/(h(it)?p(oint[sz])?)/i)) return 4
  41. if ($regex($1,/^(constitution|cns)/Si)) return 4
  42. if ($regex($1,/(rang(e|ing)?)/i)) return 5
  43. if ($regex($1,/(Pray(er)?)/i)) return 6
  44. if ($regex($1,/(mag(ic|e))/i)) return 7
  45. if ($regex($1,/(cook(ing)?)/i)) return 8
  46. if ($regex($1,/(w(ood)?c(utting)?)/i)) return 9
  47. if ($regex($1,/(fletch(ing)?)/i)) return 10
  48. if ($regex($1,/fish(ing)?/i)) return 11
  49. if ($regex($1,/f(ire)?m(aking)?/i)) return 12
  50. if ($regex($1,/craft(ing)?/i)) return 13
  51. if ($regex($1,/smith(ing)?/i)) return 14
  52. if ($regex($1,/(mine|mining)/i)) return 15
  53. if ($regex($1,/herb(lore)?/i)) return 16
  54. if ($regex($1,/agil(ity)?/i)) return 17
  55. if ($regex($1,/thie[fv](ing)?/i)) return 18
  56. if ($regex($1,/slay(er)?/i)) return 29
  57. if ($regex($1,/farm(ing)?/i)) return 20
  58. if ($regex($1,/r(une)?c(raft)?/i)) return 21
  59. if ($regex($1,/hunt(er|ing)?/i)) return 22
  60. if ($regex($1,/con(struc(tion)?)/i)) return 23
  61. if ($regex($1,/summ(on(ing)?)?/i)) return 24
  62. }
  63. alias skl {
  64. if ($regex($1,/^(overall|total)/Si)) { Return Overall }
  65. if ($regex($1,/^(att|atk|attack)/Si)) { Return Attack }
  66. if ($regex($1,/^(str|strenth|strength)/Si)) { Return Strength }
  67. if ($regex($1,/^(def|defence)/Si)) { Return Defence }
  68. if ($regex($1,/^(hp|hits|hitpoints|hit)/Si)) { Return Constitution }
  69. if ($regex($1,/^(cn|cns|constitution)/Si)) { Return Constitution }
  70. if ($regex($1,/^(range|ranged|ranging)/Si)) { Return Ranged }
  71. if ($regex($1,/^(pray(er)?)/Si)) { Return Prayer }
  72. if ($regex($1,/^(mage|magic)/Si)) { Return Magic }
  73. if ($regex($1,/^(cook|cooking)/Si)) { Return Cooking }
  74. if ($regex($1,/^(wc|wood(cut(ting)?))/Si)) { Return Woodcutting }
  75. if ($regex($1,/^(fletch|fletching)/Si)) { Return Fletching }
  76. if ($regex($1,/^(fishing|fish)/Si)) { Return Fishing }
  77. if ($regex($1,/^(fm|fire|firemaking)/Si)) { Return Firemaking }
  78. if ($regex($1,/^(craft|crafting)/Si)) { Return Crafting }
  79. if ($regex($1,/^(smithing|smith)/Si)) { Return Smithing }
  80. if ($regex($1,/^(mine|mining)/Si)) { Return Mining }
  81. if ($regex($1,/^(herb|Herblore)/Si)) { Return Herblore }
  82. if ($regex($1,/^(agil|agility)/Si)) { Return Agility }
  83. if ($regex($1,/^(theif|theiv|thiev|theiving|thieving)/Si)) { return Thieving }
  84. if ($regex($1,/^(slay|slayer)/Si)) { Return Slayer }
  85. if ($regex($1,/^(farm|farming)/Si)) { Return Farming }
  86. if ($regex($1,/^(rune|rc|runecrafting|runecraft)/Si)) { Return Runecrafting }
  87. if ($regex($1,/^(hunt|hunting|hunter)/Si)) { return Hunter }
  88. if ($regex($1,/^(con|construction)/Si)) { return Construction }
  89. if ($regex($1,/^(sum|summ|summon|summoning)/Si)) { return Summoning }
  90. if ($regex($1,/^(dun|dungeon|dungeoneering|dung)/Si)) { return Dungeoneering }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement