glacier_rat

Glacier_Rat

May 10th, 2010
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.51 KB | None | 0 0
  1. on *:SOCKOPEN:m.check:{
  2. sockwrite -nt $sockname GET /results.ws?query=magic+logs&price=all&members=yes HTTP/1.1
  3. sockwrite -nt $sockname Host: itemdb-rs.runescape.com
  4. sockwrite -nt $sockname $crlf
  5. }
  6. on *:SOCKREAD:m.check:{
  7. if ($sockerr) { sockclose m.check | sockopen m.check itemdb-rs.runescape.com 80 }
  8. else {
  9. var %xx
  10. sockread %xx
  11. if (<td><a href="http://itemdb-rs.runescape.com/Magic_logs/viewitem.ws?obj=1513"> Magic logs</a></td> == %xx) {
  12. sockread %xx | did -ra logs 2 $htmlfree(%xx) | if ($len($did(logs,6))) { did -ra logs 4 $xcalc($did(logs,6) * $htmlfree(%xx)) }
  13. sockclose $sockname
  14. }
  15. }
  16. }
  17. alias htmlfree {
  18. return $remove($1-,td,/span,",span class=,>,<,/,rise,stay,drop)
  19. }
  20. menu * {
  21. -
  22. WoodCutting:{ mlog }
  23. }
  24. alias mlog {
  25. if ($sock(m.check)) { .sockclose m.check }
  26. if ($sock(l.check)) { .sockclose l.check }
  27. if ($dialog(logs)) { dialog -x logs }
  28. dialog -mdo logs logs logs
  29. sockopen m.check itemdb-rs.runescape.com 80
  30. sockopen l.check rscript.org 80
  31. }
  32. dialog logs {
  33. title "Woodcutting"
  34. size 639 77 128 45
  35. option dbu
  36. text "Price:", 1, 71 9 14 8
  37. edit "", 6, 85 18 41 10
  38. text "", 4, 70 28 54 7, center
  39. text "Bank:", 5, 71 19 14 8
  40. button "+27", 3, 109 6 15 10
  41. box "Magics", 7, 67 1 60 36
  42. text "Level:", 8, 11 3 18 8, right
  43. text "Exp:", 9, 15 12 14 8, right
  44. text "Rank:", 10, 12 20 17 8, right
  45. text "Exp Left:", 11, 2 28 27 8, right
  46. text "Logs Left:", 12, 2 36 27 8, right
  47. text "", 13, 31 3 10 8
  48. text "", 14, 31 12 35 8
  49. text "", 15, 31 20 35 8
  50. text "", 16, 31 28 35 8
  51. text "", 17, 31 36 35 8
  52. button "Update", 18, 42 1 24 10
  53. text "", 2, 86 9 22 8
  54. }
  55.  
  56. on *:DIALOG:logs:sclick:18:{
  57. did -r logs 2,4,13-17
  58. if ($sock(m.check)) { .sockclose m.check }
  59. if ($sock(l.check)) { .sockclose l.check }
  60. sockopen m.check itemdb-rs.runescape.com 80
  61. sockopen l.check rscript.org 80
  62. }
  63. on *:DIALOG:logs:edit:6:{
  64. var %price $did(logs,2)
  65. tokenize 32 $did(logs,6)
  66. did -ra logs 4 $xcalc($1 * %price)
  67. }
  68. on *:DIALOG:logs:sclick:3:{
  69. var %price $did(logs,2)
  70. tokenize 32 $did(logs,6)
  71. did -ra logs 6 $calc($1 + 27)
  72. did -ra logs 4 $xcalc($did(logs,6) * %price)
  73. }
  74. on *:SOCKOPEN:l.check:{
  75. sockwrite -nt $sockname GET /lookup.php?type=stats&user=Glacier+Rat HTTP/1.1
  76. sockwrite -nt $sockname Host: rscript.org
  77. sockwrite -nt $sockname $crlf
  78. }
  79. on *:SOCKREAD:l.check:{
  80. if ($sockerr) { .sockclose l.check | sockopen l.check rscript.org 80 }
  81. else {
  82. var %xx
  83. sockread %xx
  84. if (woodcutting isin %xx) {
  85. tokenize 32 $gettok(%xx,2-,32)
  86. did -ra logs 13 $2
  87. did -ra logs 14 $bytes($3,bd)
  88. did -ra logs 15 $bytes($1,bd)
  89. did -ra logs 16 $xcalc(13034431- $3)
  90. did -ra logs 17 $bytes($ceil($calc((13034431- $3)/250)),bd)
  91. sockclose l.check
  92. }
  93. }
  94. }
  95. alias xcalc { var %x $replace($remove($1-,$chr(44),a,c,d,e,f,g,h,i,j,l,n,o,p,q,r,s,u,v,w,x,y,z),k,*1000,m,*1000000,b,*1000000000,t,*1000000000000) | return $bytes($calc(%x),bd) }
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102. ===================================B == R== E== A ===K ==============
  103.  
  104.  
  105.  
  106.  
  107. menu * {
  108. -
  109. Slayer
  110. .Slayer Settings
  111. ..Set task nr.:/set %tasknr $?="Please enter the number of tasks completed:"
  112. ..Set slay exp.:/set %slayexp $?="Enter current slayer exp:"
  113. .Aberrant spectres:/set %hp 90 | /set %monstername Aberrant spectres | /ksc
  114. .Abyssal demons:/set %hp 150 | /set %monstername Abyssal demons | /ksc
  115. .Aquanite:/set %hp 125 | /set %monstername Aquanite | /ksc
  116. .Black demons:/set %hp 157 | /set %monstername Black demons | /ksc
  117. .Black dragons
  118. ..Baby black dragons:/set %hp 80 | /set %monstername Baby black dragons | /ksc
  119. ..Black dragons:/set %hp 190 | /set %monstername Black dragons | /ksc
  120. .Bloodvelds
  121. ..Bloodvelds:/set %hp 120 | /set %monstername Bloodvelds | /ksc
  122. ..Mutated bloodvelds:/set %hp 178 | /set %monstername Mutated bloodvelds | /ksc
  123. .Dagannoths:/set %hp 120 | /set %monstername Dagannoths | /ksc
  124. .Dark beasts:/set %hp 220 | /set %monstername Dark Beasts | /ksc
  125. .Dust devils:/set %hp 105 | /set %monstername Dust devils | /ksc
  126. .Fire giants:/set %hp 111 | /set %monstername Fire giants | /ksc
  127. .Gargoyles:/set %hp 105 | /set %monstername Gargoyles | /ksc
  128. .Goraks:/set %hp 112 | /set %monstername Goraks | /ksc
  129. .Greater demons:/set %hp 87 | /set %monstername Greater demons | /ksc
  130. .Hellhounds:/set %hp 116 | /set %monstername Hellhounds | /ksc
  131. .Iron dragons:/set %hp 165 | /set %monstername Iron dragons | /ksc
  132. .Kalphites
  133. ..Workers:/set %hp 40 | /set %monstername Kalphite workers | /ksc
  134. ..Soldiers:/set %hp 90 | /set %monstername Kalphite Soldiers | /ksc
  135. .Mithril Dragons:/set %hp 254 | /set %monstername Mithril Dragons | /ksc
  136. .Nechryael:/set %hp 105 | /set %monstername Nechryael | /ksc
  137. .Steel dragons:/set %hp 210 | /set %monstername Steel Dragons | /ksc
  138. .Spiritual mages
  139. ..Zammy:/set %hp 75 | /set %monstername Spiritual mages | /ksc
  140. ..Sara:/set %hp 85 | /set %monstername Spiritual mages | /ksc
  141. .Suqahs:/set %hp 106 | /set %monstername Suqahs | /ksc
  142. .Waterfiends:/set %hp 128 | /set %monstername Waterfiends | /ksc
  143. .Scabarbites:/set %hp 90 | /set %monstername Scabarites | /ksc
  144. .Warped:/set %hp 150 | /set %monstername Warped Terrorbirds | /ksc
  145. .Jungle Strykwyrm:/set %hp 110 | /set %monstername Jungle Strykewurm | /ksc
  146. .Desert Strykeyurm:/set %hp 120 | /set %monstername Desert Strykewurm | /ksc
  147. .Ice Strykewyrm:/set %hp 210 | /set %monstername Ice Strywurm | /ksc
  148. .Cave Horror:/set %hp 55 | /set %monstername Cave Horror | /ksc
  149. .Banshee:/set %hp 22 | /set %monstername Banshee | /ksc
  150. }
  151.  
  152.  
  153. alias ksc {
  154. set %amount $?="Amount of monsters:"
  155. inc %tasknr
  156. inc %slayexp $calc(%amount * %hp)
  157. msg # I'm on task $c2(no. $+ $bytes(%tasknr,bd)) $+ $c1(:) $c2(%amount %monstername) $+ $c1(; that's) $c2($bytes($calc(%amount * %hp * 4),bd)) $c1(cmb XP,) $c2($bytes($floor($calc(%amount * 4/3 * %hp)),bd)) $c1(HP XP &) $c2($bytes($calc(%amount * %hp),bd)) $c1(Slay XP; I will have) $c2($bytes(%slayexp,bd)) $+ $chr(15) $c1(Slayer exp)
  158. }
  159.  
  160. alias slayer {
  161. msg # I have done $c2($bytes(%tasknr,bd) tasks) $+ $c1(. My last known) $c2(slayer task) $c1(was) $c2(%amount %monstername) $+ $c1(. I gained) $c2($bytes($calc(%amount * %hp * 4),bd) Combat Exp) $+ $c1(;) $c2($bytes($floor($calc(%amount * 4/3 * %hp)),bd) HP Exp) $+ $c1(;) $c2($bytes($calc(%amount * %hp),bd) Slay XP) $c1(Wich also got me a total of) $c2($bytes(%slayexp,bd) Slayer exp)) $+ $c1(!)
  162. }
  163.  
  164. alias c1 return $+($chr(3),10,$1,$chr(3))
  165. alias c2 return $+($chr(3),07,$1,$chr(3))
Add Comment
Please, Sign In to add comment