Advertisement
Guest User

Untitled

a guest
Jun 27th, 2014
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. //MISC
  2. on *:text:!calcinfo:#:{ msg $chan When this value is 'true', it means that calculcations from other regions nearby in the update order are calculcated due to lack of data on the region you querried. This will be less accurate then a straight up calculation. }
  3. //MAJOR
  4. on *:text:.approx &:#YOURREGION:{
  5. if !$sock(plusplus) { sockopen plusplus nationstatesplusplus.net 80 | set %regionplus $2 }
  6. set %yourchannel #YOURREGION
  7. else notice $nick Wait!
  8. }
  9. on *:sockopen:plusplus:{
  10. sockwrite -n $sockname GET /api/region/updatetime/?region= $+ %regionplus HTTP/1.0
  11. sockwrite -n $sockname $crlf
  12. }
  13.  
  14. on *:sockread:plusplus: {
  15. sockread &plus
  16. if $regex($bvar(&plus,1-).text,/"([^"]+)":("[^"]*"|[^"{][^,}]+)/g) {
  17. echo -ag 1 $regml(1)
  18. echo -ag 2 $regml(2)
  19. echo -ag 3 $regml(3)
  20. echo -ag 4 $regml(4)
  21. echo -ag 5 $regml(5)
  22. echo -ag 6 $regml(6)
  23. echo -ag 7 $regml(7)
  24. echo -ag 8 $regml(8)
  25. echo -ag 9 $regml(9)
  26. echo -ag 10 $regml(10)
  27. echo -ag 11 $regml(11)
  28. echo -ag 12 $regml(12)
  29. echo -ag 13 $regml(13)
  30. echo -ag 14 $regml(14)
  31. echo -ag 15 $regml(15)
  32. echo -ag 16 $regml(16)
  33. echo -ag 17 $regml(17)
  34. echo -ag 18 $regml(18)
  35. echo -ag 19 $regml(19)
  36. echo -ag 20 $regml(20)
  37. echo -ag 21 $regml(21)
  38. echo -ag 22 $regml(22)
  39. echo -ag 23 $regml(23)
  40. echo -ag 24 $regml(24)
  41. echo -ag 25 $regml(25)
  42. echo -ag 26 $regml(26)
  43. echo -ag 27 $regml(27)
  44. echo -ag 28 $regml(28)
  45. echo -ag 29 $regml(29)
  46. echo -ag 30 $regml(30)
  47. echo -ag 31 $regml(31)
  48. echo -ag 32 $regml(32)
  49. echo -ag 33 $regml(33)
  50. echo -ag 34 $regml(34)
  51. echo -ag 35 $regml(35)
  52. echo -ag 36 $regml(36)
  53. var %time = $calc($regml(20) / 1000 - 18000)
  54. if (%time < 0) %time = $calc(%time + 86400)
  55. msg %yourchannel Major Update Calculation:  $duration(%time,3) (+/-  $floor($calc($regml(30) /1000))  seconds ). Is this calculation using data calculated from other regions?  $regml(24)  (Confused what this means? !calcinfo)
  56. msg %yourchannel This is region $regml(36) of $regml(28) total regions in NationStates!
  57. }
  58. unset %regionplus
  59. }
  60.  
  61. //MINOR
  62.  
  63.  
  64. on *:text:.minor &:#YOURREGION:{
  65. if !$sock(pluspluss) { sockopen pluspluss nationstatesplusplus.net 80 | set %regionplus $2 }
  66. set %yourchannel #YOURREGION
  67. else notice $nick Wait!
  68. }
  69. on *:sockopen:pluspluss:{
  70. sockwrite -n $sockname GET /api/region/updatetime/?region= $+ %regionplus HTTP/1.0
  71. sockwrite -n $sockname $crlf
  72. }
  73.  
  74. on *:sockread:pluspluss: {
  75. sockread &plus
  76. if $regex($bvar(&plus,1-).text,/"([^"]+)":("[^"]*"|[^"{][^,}]+)/g) {
  77. echo -ag 1 $regml(1)
  78. echo -ag 2 $regml(2)
  79. echo -ag 3 $regml(3)
  80. echo -ag 4 $regml(4)
  81. echo -ag 5 $regml(5)
  82. echo -ag 6 $regml(6)
  83. echo -ag 7 $regml(7)
  84. echo -ag 8 $regml(8)
  85. echo -ag 9 $regml(9)
  86. echo -ag 10 $regml(10)
  87. echo -ag 11 $regml(11)
  88. echo -ag 12 $regml(12)
  89. echo -ag 13 $regml(13)
  90. echo -ag 14 $regml(14)
  91. echo -ag 15 $regml(15)
  92. echo -ag 16 $regml(16)
  93. echo -ag 17 $regml(17)
  94. echo -ag 18 $regml(18)
  95. echo -ag 19 $regml(19)
  96. echo -ag 20 $regml(20)
  97. echo -ag 21 $regml(21)
  98. echo -ag 22 $regml(22)
  99. echo -ag 23 $regml(23)
  100. echo -ag 24 $regml(24)
  101. var %time = $calc($regml(2) / 1000 - 18000)
  102. if (%time < 0) %time = $calc(%time + 86400)
  103. msg %yourchannel Minor Update Calculation:  $duration(%time,3) (+/-  $floor($calc($regml(10) /1000))  seconds ) Is this calculation using data calculated from other regions?  $regml(6)  (Confused what this means? !calcinfo)
  104. msg %yourchannel This is region $regml(18) of $regml(10) total regions in NationStates!
  105. }
  106. unset %regionplus
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement