Advertisement
Guest User

Untitled

a guest
Apr 8th, 2014
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. SerinApprox 0.97
  2. ~~~~~~~~~~~~~Minor~~~~~~~~~~~~~~~~~~~~
  3. on *:text:.minor &:#YOURREGION:{
  4. if !$sock(pluspluss) { sockopen pluspluss nationstatesplusplus.net 80 | set %regionplus $2 }
  5. set %yourchannel #YOURREGION
  6. else notice $nick Wait!
  7. }
  8. on *:sockopen:pluspluss:{
  9. sockwrite -n $sockname GET /api/region/updatetime/?region= $+ %regionplus HTTP/1.0
  10. sockwrite -n $sockname $crlf
  11. }
  12.  
  13. on *:sockread:pluspluss: {
  14. sockread &plus
  15. if $regex($bvar(&plus,1-).text,/"([^"]+)":("[^"]*"|[^"{][^,}]+)/g) {
  16. echo -ag 1 $regml(1)
  17. echo -ag 2 $regml(2)
  18. echo -ag 3 $regml(3)
  19. echo -ag 4 $regml(4)
  20. echo -ag 5 $regml(5)
  21. echo -ag 6 $regml(6)
  22. echo -ag 7 $regml(7)
  23. echo -ag 8 $regml(8)
  24. echo -ag 9 $regml(9)
  25. echo -ag 10 $regml(10)
  26. echo -ag 11 $regml(11)
  27. echo -ag 12 $regml(12)
  28. echo -ag 13 $regml(13)
  29. echo -ag 14 $regml(14)
  30. echo -ag 15 $regml(15)
  31. echo -ag 16 $regml(16)
  32. echo -ag 17 $regml(17)
  33. echo -ag 18 $regml(18)
  34. echo -ag 19 $regml(19)
  35. echo -ag 20 $regml(20)
  36. echo -ag 21 $regml(21)
  37. echo -ag 22 $regml(22)
  38. echo -ag 23 $regml(23)
  39. echo -ag 24 $regml(24)
  40. var %time = $calc($regml(2) / 1000 - 18000)
  41. if (%time < 0) %time = $calc(%time + 86400)
  42. msg %yourchannel Minor Update Calculation:  $duration(%time,3) (+/-  $floor($calc($regml(8) /1000))  seconds )
  43. }
  44. unset %regionplus
  45. }
  46. ~~~~~~~~~~~~~~Major~~~~~~~~~~~~~~~~~~~~~
  47. on *:text:.approx &:#YOURREGION:{
  48. if !$sock(plusplus) { sockopen plusplus nationstatesplusplus.net 80 | set %regionplus $2 }
  49. set %yourchannel #YOURREGION
  50. else notice $nick Wait!
  51. }
  52. on *:sockopen:plusplus:{
  53. sockwrite -n $sockname GET /api/region/updatetime/?region= $+ %regionplus HTTP/1.0
  54. sockwrite -n $sockname $crlf
  55. }
  56.  
  57. on *:sockread:plusplus: {
  58. sockread &plus
  59. if $regex($bvar(&plus,1-).text,/"([^"]+)":("[^"]*"|[^"{][^,}]+)/g) {
  60. echo -ag 1 $regml(1)
  61. echo -ag 2 $regml(2)
  62. echo -ag 3 $regml(3)
  63. echo -ag 4 $regml(4)
  64. echo -ag 5 $regml(5)
  65. echo -ag 6 $regml(6)
  66. echo -ag 7 $regml(7)
  67. echo -ag 8 $regml(8)
  68. echo -ag 9 $regml(9)
  69. echo -ag 10 $regml(10)
  70. echo -ag 11 $regml(11)
  71. echo -ag 12 $regml(12)
  72. echo -ag 13 $regml(13)
  73. echo -ag 14 $regml(14)
  74. echo -ag 15 $regml(15)
  75. echo -ag 16 $regml(16)
  76. echo -ag 17 $regml(17)
  77. echo -ag 18 $regml(18)
  78. echo -ag 19 $regml(19)
  79. echo -ag 20 $regml(20)
  80. echo -ag 21 $regml(21)
  81. echo -ag 22 $regml(22)
  82. echo -ag 23 $regml(23)
  83. echo -ag 24 $regml(24)
  84. var %time = $calc($regml(14) / 1000 - 18000)
  85. if (%time < 0) %time = $calc(%time + 86400)
  86. msg %yourchannel Major Update Calculation:  $duration(%time,3) (+/-  $floor($calc($regml(20) /1000))  seconds )
  87. }
  88. unset %regionplus
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement