Guest User

Untitled

a guest
Mar 2nd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.94 KB | None | 0 0
  1. ;; idleRPG Script by Casper-TH
  2. ;; Version 1.21
  3. ;; First Release: 01 July, 2008
  4. ;;;;;;;;;;;;;;;
  5. ;;; ALIASES ;;;
  6. ;;;;;;;;;;;;;;;
  7. alias idlerpg {
  8. if ($server) {
  9. dialog $iif($dialog(idlerpg),-v,-m) idlerpg idlerpg
  10. }
  11. else {
  12. echo -a Error; Not connected to server
  13. }
  14. }
  15. alias title.idlerpg {
  16. titlebar $iif($calc(%idle.nl - $gmt) >= 0,$duration($calc(%idle.nl - $gmt),1) until next level,)
  17. if ($calc(%idle.nl - $gmt) == %idle.titlewarn) {
  18. echo -a 4NOTICE! YOU LEVEL UP IN 30 MINUTES
  19. }
  20. }
  21. alias idlerpgset {
  22. if ($2) {
  23. var %idle.days = $calc($1 * 86400), %idle.tot = $remove($2,.,:,;), %idle.hrs = $calc($mid(%idle.tot,1,2) * 60 * 60), %idle.mins = $calc($mid(%idle.tot,3,2) * 60), %idle.secs = $mid(%idle.tot,5,2)
  24. set %idle.nl $calc($gmt + %idle.days + %idle.hrs + %idle.mins + %idle.secs)
  25. }
  26. }
  27. alias idlerpgadd {
  28. if ($2) {
  29. var %idle.days = $calc($1 * 86400), %idle.tot = $remove($2,.,:,;), %idle.hrs = $calc($mid(%idle.tot,1,2) * 60 * 60), %idle.mins = $calc($mid(%idle.tot,3,2) * 60), %idle.secs = $mid(%idle.tot,5,2)
  30. set %idle.nl $calc(%idle.nl + %idle.days + %idle.hrs + %idle.mins + %idle.secs)
  31. }
  32. }
  33. alias idlerpgrem {
  34. if ($2) {
  35. var %idle.days = $calc($1 * 86400), %idle.tot = $remove($2,.,:,;), %idle.hrs = $calc($mid(%idle.tot,1,2) * 60 * 60), %idle.mins = $calc($mid(%idle.tot,3,2) * 60), %idle.secs = $mid(%idle.tot,5,2)
  36. set %idle.nl $calc(%idle.nl - %idle.days - %idle.hrs - %idle.mins - %idle.secs)
  37. }
  38. }
  39. alias idlerpgds {
  40. if ($2) {
  41. var %idle.days = $calc($1 * 86400), %idle.tot = $remove($2,.,:,;), %idle.hrs = $calc($mid(%idle.tot,1,2) * 60 * 60), %idle.mins = $calc($mid(%idle.tot,3,2) * 60), %idle.secs = $mid(%idle.tot,5,2)
  42. set %idle.ti $calc((%idle.days + %idle.hrs + %idle.mins + %idle.secs) - $gmt)
  43. }
  44. }
  45. alias idle.login {
  46. if (%idle.me && %idle.pass && $address(Raver-Bot,0)) {
  47. .msg Raver-Bot login %idle.me %idle.pass
  48. }
  49. }
  50. alias idle.sync {
  51. if (%idle.me && !%idle.sync) {
  52. idlerpg
  53. did -b idlerpg 107-112
  54. did -ra idlerpg 108,110,112 Sending for Data ..
  55. set %idle.sync $calc($gmt + $iif($1,$1,10))
  56. set %idle.syncx 1
  57. closemsg Raver-Bot
  58. .msg Raver-Bot status %idle.me
  59. }
  60. }
  61. alias idlerpg.init {
  62. did -ra idlerpg 102 %idle.me
  63. did -ra idlerpg 104 $iif($me ison #THGames,$iif($calc(%idle.nl - $gmt) >= 0,$duration($calc(%idle.nl - $gmt),1),-),-)
  64. did -ra idlerpg 106 $iif(%idle.level,%idle.level,-)
  65. did - $+ $iif(!%idle.me || !%idle.pass,ub,e) $+ $iif(%idle.autol,c,u) idlerpg 205
  66. set %idle.me $did(idlerpg,202).text
  67. set %idle.pass $did(idlerpg,204).text
  68. if (!$me ison #THGames) {
  69. did -b idlerpg 206
  70. }
  71. if ($calc(%idle.sync - $gmt) <= 0) {
  72. unset %idle.sync
  73. }
  74. did $iif(%idle.syncx,-b,-e) idlerpg 107-112
  75. did $iif(%idle.sync,-rab,-rae) idlerpg 113 $iif(%idle.sync,Please Wait .. $calc(%idle.sync - $gmt),Re-Sync)
  76. did -ra idlerpg 110 $iif(!%idle.syncx,$duration($calc($gmt + %idle.ti)),Sending for Data ..)
  77. }
  78. alias fight {
  79. if ($1) {
  80. set %idle.fight.nick $1
  81. closemsg Raver-Bot
  82. .msg Raver-Bot status $1
  83. .msg Raver-Bot status %idle.me
  84. dialog $iif($dialog(idle.fight),-v,-m) idle.fight idle.fight
  85. }
  86. }
  87.  
  88. ;;;;;;;;;;;;;
  89. ;;; TRIGS ;;;
  90. ;;;;;;;;;;;;;
  91. on *:JOIN:#THGames: {
  92. if (%idle.title) {
  93. .timerrpgtitle 0 1 title.idlerpg
  94. }
  95. if ($nick == $me && %idle.me && %idle.pass && %idle.autol) {
  96. idle.login
  97. }
  98. }
  99. on *:PART:#THGames: {
  100. if ($nick == $me) {
  101. set %idle.nl -
  102. .timerrpgtitle off
  103. titlebar
  104. }
  105. }
  106. on *:DISCONNECT: {
  107. set %idle.nl -
  108. .timerrpgtitle off
  109. titlebar
  110. }
  111. on *:TEXT:*, the *, has attained level *! Next level in * days, *:#THGames: {
  112. if ($remove($1,$chr(44)) == %idle.me) {
  113. idlerpgset $gettok($1-,$calc($0 - 2),32) $gettok($1-,$0,32)
  114. set %idle.level $remove($gettok($1-,$calc($0 - 7),32),!)
  115. $tip(idleRPG,idleRPG,You have gained level $remove($gettok($1-,$calc($0 - 7),32),!),idlerpg)
  116. }
  117. }
  118. on *:TEXT:Penalty of * days, * added to *'s timer for LOGOUT command.:#THGames: {
  119. if ($mid($8,1,$calc($len($8) - 2)) == %idle.me) {
  120. idlerpgadd $3 $gettok($1-,5,32)
  121. }
  122. }
  123. on *:TEXT:* has been set upon by a * and gets savagely beaten! * days, * is added to *'s clock.:#THGames: {
  124. if ($1 == %idle.me) {
  125. idlerpgadd $gettok($1-,$calc($0 - 8),32) $gettok($1-,$calc($0 - 6),32)
  126. }
  127. }
  128. on *:TEXT:* [*/*] has been set upon by a * [*/*] and fights it off! * day, * is removed from *'s clock.:#THGames: {
  129. if ($mid($calc($0 - 1),1,$calc($len($calc($0 - 1)) - 2)) == %idle.me) {
  130. idlerpgrem $gettok($1-,$calc($0 - 8),32) $gettok($1-,$calc($0 - 6),32)
  131. }
  132. }
  133. on *:TEXT:*, the level *, is now online from nickname *. Next level in * days, *.:#THGames: {
  134. if ($remove($1,$chr(44)) == %idle.me) {
  135. idlerpgset $gettok($1-,$calc($0 - 2),32) $gettok($1-,$0,32)
  136. set %idle.level $remove($gettok($1-,4,32),$chr(44))
  137. $tip(idlerpglogin,idleRPG,You have logged on as %idle.me $+ !,10,,,idlerpg)
  138. }
  139. }
  140. on *:TEXT:* reaches next level in * days, *.:#THGames: {
  141. if ($1 == %idle.me) {
  142. idlerpgset $gettok($1-,$calc($0 - 2),32) $gettok($1-,$0,32)
  143. }
  144. }
  145. on ^*:OPEN:?:*: {
  146. if ($nick == Raver-Bot) {
  147. if ($mid($1,1,$calc($len($1) - 1)) == %idle.me) {
  148. if (%idle.fight.nick && $dialog(idle.fight)) {
  149. set %idle.level $3
  150. did -rae idle.fight 5 $3
  151. }
  152. else {
  153. idlerpg
  154. set %idle.level $3
  155. idlerpgset $gettok($1-,$calc($0 - 9),32) $gettok($1-,$calc($0 - 7),32)
  156. did -ra idlerpg 108 $remove($gettok($1-,4- $calc($0 - 13),32),;)
  157. idlerpgds $gettok($1-,$calc($0 - 5),32) $remove($gettok($1-,$calc($0 - 3),32),;)
  158. did -ra idlerpg 112 $gettok($1-,$0,32)
  159. did -e idlerpg 107-112
  160. did $iif($remove($gettok($1-,$calc($0 - 11),32),;) == Online,-b,-e) idlerpg 206
  161. unset %idle.syncx
  162. }
  163. halt
  164. }
  165. elseif ($mid($1,1,$calc($len($1) - 1)) == %idle.fight.nick) {
  166. if ($dialog(idle.fight)) {
  167. did -rae idle.fight 7 $3
  168. did -e idle.fight 8
  169. did -ra idle.fight 3 $mid($1,1,$calc($len($1) - 1))
  170. }
  171. halt
  172. }
  173. elseif ($1- == No Such User. && %idle.fight.nick) {
  174. did -b idle.fight 8
  175. did -ra idle.fight 3 No such user
  176. halt
  177. }
  178. elseif ($1- == You are not logged in*) {
  179. if (!$me ison #THGames) {
  180. j #THGames
  181. }
  182. if (!%idle.autol) {
  183. idle.login
  184. }
  185. }
  186. idle.sync
  187. }
  188. }
  189.  
  190. ;;;;;;;;;;;;;
  191. ;;; MENUS ;;;
  192. ;;;;;;;;;;;;;
  193. menu * {
  194. -
  195. idleRPG {
  196. idlerpg
  197. }
  198. }
  199. menu channel,server {
  200. IdleRPG Fight {
  201. fight $$?="Enter a username to fight"
  202. }
  203. -
  204. }
  205. menu nicklist,query {
  206. IdleRPG Fight {
  207. fight $1
  208. }
  209. }
  210.  
  211. ;;;;;;;;;;;;;;
  212. ;;; DIALOG ;;;
  213. ;;;;;;;;;;;;;;
  214. dialog idlerpg {
  215. title "idleRPG Script By Casper"
  216. size -1 -1 200 100
  217. option dbu
  218. tab "General", 100, 0 0 200 100
  219. text "My Username", 101, 5 18 60 9, tab 100
  220. edit %idle.me, 102, 66 17 126 10, tab 100 read
  221. text "Time until next level", 103, 4 29 60 9, tab 100
  222. edit "", 104, 66 28 126 10, tab 100 read
  223. text "Level", 105, 4 40 60 9, tab 100
  224. edit %idle.level, 106, 66 39 126 10, tab 100 read
  225. text "Class", 107, 4 55 60 9, tab 100
  226. edit "Sending for Data ...", 108, 66 55 126 10, tab 100 read
  227. text "Total Idle Time", 109, 4 66 60 9, tab 100
  228. edit "Sending for Data ...", 110, 66 66 126 10, tab 100 read
  229. text "Item Sum", 111, 4 77 60 9, tab 100
  230. edit "Sending for Data ...", 112, 66 77 126 10, tab 100 read
  231. button "Re-Sync", 113, 66 88 126 10, tab 100
  232. tab "Options", 200
  233. text "Username", 201, 5 18 60 9, tab 200
  234. edit %idle.me, 202, 66 17 126 10, tab 200
  235. text "Password", 203, 5 29 60 9, tab 200
  236. edit %idle.pass, 204, 66 28 126 10, tab 200 pass
  237. check "Auto Login", 205, 66 38 126 10, tab 200
  238. button "Login Now", 206, 65 48 126 10, tab 200
  239. box "Options", 207, 4 65 190 30, tab 200
  240. check "Next level shown in titlebar", 208, 9 73 126 10, tab 200
  241. check "Notice", 209, 9 83 23 10, tab 200
  242. edit %idle.titlewarn, 210, 33 83 14 10, tab 200
  243. text "minutes before next level up", 211, 49 85 100 9, tab 200
  244. }
  245. dialog idle.fight {
  246. title IdleRpg - Fight Confirm
  247. option dbu
  248. size -1 -1 150 70
  249. box "Confirm Fight" , 1, 2 2 146 66
  250. text "Attacking", 2, 7 11 30 10
  251. edit %idle.fight.nick, 3, 35 10 110 10, read
  252. text "Your Level", 4, 7 26 30 10
  253. edit %idle.level, 5, 35 24 110 10, read
  254. text "Their Level", 6, 7 37 30 10
  255. edit "Waiting for data ..", 7, 35 35 110 10, read
  256. button "Fight!", 8, 35 50 55 12
  257. button "Back Out", 9, 90 50 55 12
  258. }
  259.  
  260. ;;;;;;;;;;;;;;;;;;;;
  261. ;;; DIALOG TRIGS ;;;
  262. ;;;;;;;;;;;;;;;;;;;;
  263. on *:DIALOG:idle.fight:init:*: {
  264. if (%idle.level !isnum) {
  265. did -rab idle.fight 5 Waiting for data ..
  266. }
  267. did -b idle.fight 7,8
  268. }
  269. on *:DIALOG:idle.fight:sclick:*: {
  270. if ($did == 8) {
  271. .msg Raver-Bot fight $did(3).text
  272. }
  273. if ($did == 9) {
  274. unset %idle.fight.nick
  275. dialog -x idle.fight
  276. }
  277. }
  278. on *:DIALOG:idlerpg:init:*: {
  279. idlerpg.init
  280. idle.sync
  281. .timeridlerpg 0 0 idlerpg.init
  282. did $iif(%idle.title,-c,-u) idlerpg 208
  283. did $iif(!%idle.title,-b,-e $+ $iif(%idle.titlewarn,c,u)) idlerpg 209-211
  284. }
  285. on *:DIALOG:idlerpg:sclick:*: {
  286. if ($did == 205) {
  287. set %idle.autol $did(205).state
  288. }
  289. if ($did == 206) {
  290. idle.login
  291. }
  292. if ($did == 113) {
  293. idle.sync
  294. }
  295. if ($did == 208) {
  296. did $iif($did(208).state == 1,-e,-bu) idlerpg 209-211
  297. if ($did(208).state == 0) {
  298. unset %idle.timewarn
  299. }
  300. set %idle.title $did(208).state
  301. .timerrpgtitle $iif($did(208).state == 1,0 1 title.idlerpg,off)
  302. titlebar $iif($did(208).state == 1,$iif($calc(%idle.nl - $gmt) >= 0,$duration($calc(%idle.nl - $gmt),1) until next level,),)
  303. }
  304. if ($did == 209) {
  305. if ($did(209).state == 1) {
  306. set %idle.titlewarn $calc($iif($did(210).text isnum,$did(210).text,30) * 60)
  307. did -ra idlerpg 210 %idle.titlewarn
  308. }
  309. else {
  310. unset %idle.titlewarn
  311. }
  312. }
  313. }
  314. on *:DIALOG:idlerpg:close:*: {
  315. idlerpg.init
  316. .timeridlerpg off
  317. }
Add Comment
Please, Sign In to add comment