Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; idleRPG Script by Casper-TH
- ;; Version 1.21
- ;; First Release: 01 July, 2008
- ;;;;;;;;;;;;;;;
- ;;; ALIASES ;;;
- ;;;;;;;;;;;;;;;
- alias idlerpg {
- if ($server) {
- dialog $iif($dialog(idlerpg),-v,-m) idlerpg idlerpg
- }
- else {
- echo -a Error; Not connected to server
- }
- }
- alias title.idlerpg {
- titlebar $iif($calc(%idle.nl - $gmt) >= 0,$duration($calc(%idle.nl - $gmt),1) until next level,)
- if ($calc(%idle.nl - $gmt) == %idle.titlewarn) {
- echo -a 4NOTICE! YOU LEVEL UP IN 30 MINUTES
- }
- }
- alias idlerpgset {
- if ($2) {
- 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)
- set %idle.nl $calc($gmt + %idle.days + %idle.hrs + %idle.mins + %idle.secs)
- }
- }
- alias idlerpgadd {
- if ($2) {
- 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)
- set %idle.nl $calc(%idle.nl + %idle.days + %idle.hrs + %idle.mins + %idle.secs)
- }
- }
- alias idlerpgrem {
- if ($2) {
- 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)
- set %idle.nl $calc(%idle.nl - %idle.days - %idle.hrs - %idle.mins - %idle.secs)
- }
- }
- alias idlerpgds {
- if ($2) {
- 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)
- set %idle.ti $calc((%idle.days + %idle.hrs + %idle.mins + %idle.secs) - $gmt)
- }
- }
- alias idle.login {
- if (%idle.me && %idle.pass && $address(Raver-Bot,0)) {
- .msg Raver-Bot login %idle.me %idle.pass
- }
- }
- alias idle.sync {
- if (%idle.me && !%idle.sync) {
- idlerpg
- did -b idlerpg 107-112
- did -ra idlerpg 108,110,112 Sending for Data ..
- set %idle.sync $calc($gmt + $iif($1,$1,10))
- set %idle.syncx 1
- closemsg Raver-Bot
- .msg Raver-Bot status %idle.me
- }
- }
- alias idlerpg.init {
- did -ra idlerpg 102 %idle.me
- did -ra idlerpg 104 $iif($me ison #THGames,$iif($calc(%idle.nl - $gmt) >= 0,$duration($calc(%idle.nl - $gmt),1),-),-)
- did -ra idlerpg 106 $iif(%idle.level,%idle.level,-)
- did - $+ $iif(!%idle.me || !%idle.pass,ub,e) $+ $iif(%idle.autol,c,u) idlerpg 205
- set %idle.me $did(idlerpg,202).text
- set %idle.pass $did(idlerpg,204).text
- if (!$me ison #THGames) {
- did -b idlerpg 206
- }
- if ($calc(%idle.sync - $gmt) <= 0) {
- unset %idle.sync
- }
- did $iif(%idle.syncx,-b,-e) idlerpg 107-112
- did $iif(%idle.sync,-rab,-rae) idlerpg 113 $iif(%idle.sync,Please Wait .. $calc(%idle.sync - $gmt),Re-Sync)
- did -ra idlerpg 110 $iif(!%idle.syncx,$duration($calc($gmt + %idle.ti)),Sending for Data ..)
- }
- alias fight {
- if ($1) {
- set %idle.fight.nick $1
- closemsg Raver-Bot
- .msg Raver-Bot status $1
- .msg Raver-Bot status %idle.me
- dialog $iif($dialog(idle.fight),-v,-m) idle.fight idle.fight
- }
- }
- ;;;;;;;;;;;;;
- ;;; TRIGS ;;;
- ;;;;;;;;;;;;;
- on *:JOIN:#THGames: {
- if (%idle.title) {
- .timerrpgtitle 0 1 title.idlerpg
- }
- if ($nick == $me && %idle.me && %idle.pass && %idle.autol) {
- idle.login
- }
- }
- on *:PART:#THGames: {
- if ($nick == $me) {
- set %idle.nl -
- .timerrpgtitle off
- titlebar
- }
- }
- on *:DISCONNECT: {
- set %idle.nl -
- .timerrpgtitle off
- titlebar
- }
- on *:TEXT:*, the *, has attained level *! Next level in * days, *:#THGames: {
- if ($remove($1,$chr(44)) == %idle.me) {
- idlerpgset $gettok($1-,$calc($0 - 2),32) $gettok($1-,$0,32)
- set %idle.level $remove($gettok($1-,$calc($0 - 7),32),!)
- $tip(idleRPG,idleRPG,You have gained level $remove($gettok($1-,$calc($0 - 7),32),!),idlerpg)
- }
- }
- on *:TEXT:Penalty of * days, * added to *'s timer for LOGOUT command.:#THGames: {
- if ($mid($8,1,$calc($len($8) - 2)) == %idle.me) {
- idlerpgadd $3 $gettok($1-,5,32)
- }
- }
- on *:TEXT:* has been set upon by a * and gets savagely beaten! * days, * is added to *'s clock.:#THGames: {
- if ($1 == %idle.me) {
- idlerpgadd $gettok($1-,$calc($0 - 8),32) $gettok($1-,$calc($0 - 6),32)
- }
- }
- on *:TEXT:* [*/*] has been set upon by a * [*/*] and fights it off! * day, * is removed from *'s clock.:#THGames: {
- if ($mid($calc($0 - 1),1,$calc($len($calc($0 - 1)) - 2)) == %idle.me) {
- idlerpgrem $gettok($1-,$calc($0 - 8),32) $gettok($1-,$calc($0 - 6),32)
- }
- }
- on *:TEXT:*, the level *, is now online from nickname *. Next level in * days, *.:#THGames: {
- if ($remove($1,$chr(44)) == %idle.me) {
- idlerpgset $gettok($1-,$calc($0 - 2),32) $gettok($1-,$0,32)
- set %idle.level $remove($gettok($1-,4,32),$chr(44))
- $tip(idlerpglogin,idleRPG,You have logged on as %idle.me $+ !,10,,,idlerpg)
- }
- }
- on *:TEXT:* reaches next level in * days, *.:#THGames: {
- if ($1 == %idle.me) {
- idlerpgset $gettok($1-,$calc($0 - 2),32) $gettok($1-,$0,32)
- }
- }
- on ^*:OPEN:?:*: {
- if ($nick == Raver-Bot) {
- if ($mid($1,1,$calc($len($1) - 1)) == %idle.me) {
- if (%idle.fight.nick && $dialog(idle.fight)) {
- set %idle.level $3
- did -rae idle.fight 5 $3
- }
- else {
- idlerpg
- set %idle.level $3
- idlerpgset $gettok($1-,$calc($0 - 9),32) $gettok($1-,$calc($0 - 7),32)
- did -ra idlerpg 108 $remove($gettok($1-,4- $calc($0 - 13),32),;)
- idlerpgds $gettok($1-,$calc($0 - 5),32) $remove($gettok($1-,$calc($0 - 3),32),;)
- did -ra idlerpg 112 $gettok($1-,$0,32)
- did -e idlerpg 107-112
- did $iif($remove($gettok($1-,$calc($0 - 11),32),;) == Online,-b,-e) idlerpg 206
- unset %idle.syncx
- }
- halt
- }
- elseif ($mid($1,1,$calc($len($1) - 1)) == %idle.fight.nick) {
- if ($dialog(idle.fight)) {
- did -rae idle.fight 7 $3
- did -e idle.fight 8
- did -ra idle.fight 3 $mid($1,1,$calc($len($1) - 1))
- }
- halt
- }
- elseif ($1- == No Such User. && %idle.fight.nick) {
- did -b idle.fight 8
- did -ra idle.fight 3 No such user
- halt
- }
- elseif ($1- == You are not logged in*) {
- if (!$me ison #THGames) {
- j #THGames
- }
- if (!%idle.autol) {
- idle.login
- }
- }
- idle.sync
- }
- }
- ;;;;;;;;;;;;;
- ;;; MENUS ;;;
- ;;;;;;;;;;;;;
- menu * {
- -
- idleRPG {
- idlerpg
- }
- }
- menu channel,server {
- IdleRPG Fight {
- fight $$?="Enter a username to fight"
- }
- -
- }
- menu nicklist,query {
- IdleRPG Fight {
- fight $1
- }
- }
- ;;;;;;;;;;;;;;
- ;;; DIALOG ;;;
- ;;;;;;;;;;;;;;
- dialog idlerpg {
- title "idleRPG Script By Casper"
- size -1 -1 200 100
- option dbu
- tab "General", 100, 0 0 200 100
- text "My Username", 101, 5 18 60 9, tab 100
- edit %idle.me, 102, 66 17 126 10, tab 100 read
- text "Time until next level", 103, 4 29 60 9, tab 100
- edit "", 104, 66 28 126 10, tab 100 read
- text "Level", 105, 4 40 60 9, tab 100
- edit %idle.level, 106, 66 39 126 10, tab 100 read
- text "Class", 107, 4 55 60 9, tab 100
- edit "Sending for Data ...", 108, 66 55 126 10, tab 100 read
- text "Total Idle Time", 109, 4 66 60 9, tab 100
- edit "Sending for Data ...", 110, 66 66 126 10, tab 100 read
- text "Item Sum", 111, 4 77 60 9, tab 100
- edit "Sending for Data ...", 112, 66 77 126 10, tab 100 read
- button "Re-Sync", 113, 66 88 126 10, tab 100
- tab "Options", 200
- text "Username", 201, 5 18 60 9, tab 200
- edit %idle.me, 202, 66 17 126 10, tab 200
- text "Password", 203, 5 29 60 9, tab 200
- edit %idle.pass, 204, 66 28 126 10, tab 200 pass
- check "Auto Login", 205, 66 38 126 10, tab 200
- button "Login Now", 206, 65 48 126 10, tab 200
- box "Options", 207, 4 65 190 30, tab 200
- check "Next level shown in titlebar", 208, 9 73 126 10, tab 200
- check "Notice", 209, 9 83 23 10, tab 200
- edit %idle.titlewarn, 210, 33 83 14 10, tab 200
- text "minutes before next level up", 211, 49 85 100 9, tab 200
- }
- dialog idle.fight {
- title IdleRpg - Fight Confirm
- option dbu
- size -1 -1 150 70
- box "Confirm Fight" , 1, 2 2 146 66
- text "Attacking", 2, 7 11 30 10
- edit %idle.fight.nick, 3, 35 10 110 10, read
- text "Your Level", 4, 7 26 30 10
- edit %idle.level, 5, 35 24 110 10, read
- text "Their Level", 6, 7 37 30 10
- edit "Waiting for data ..", 7, 35 35 110 10, read
- button "Fight!", 8, 35 50 55 12
- button "Back Out", 9, 90 50 55 12
- }
- ;;;;;;;;;;;;;;;;;;;;
- ;;; DIALOG TRIGS ;;;
- ;;;;;;;;;;;;;;;;;;;;
- on *:DIALOG:idle.fight:init:*: {
- if (%idle.level !isnum) {
- did -rab idle.fight 5 Waiting for data ..
- }
- did -b idle.fight 7,8
- }
- on *:DIALOG:idle.fight:sclick:*: {
- if ($did == 8) {
- .msg Raver-Bot fight $did(3).text
- }
- if ($did == 9) {
- unset %idle.fight.nick
- dialog -x idle.fight
- }
- }
- on *:DIALOG:idlerpg:init:*: {
- idlerpg.init
- idle.sync
- .timeridlerpg 0 0 idlerpg.init
- did $iif(%idle.title,-c,-u) idlerpg 208
- did $iif(!%idle.title,-b,-e $+ $iif(%idle.titlewarn,c,u)) idlerpg 209-211
- }
- on *:DIALOG:idlerpg:sclick:*: {
- if ($did == 205) {
- set %idle.autol $did(205).state
- }
- if ($did == 206) {
- idle.login
- }
- if ($did == 113) {
- idle.sync
- }
- if ($did == 208) {
- did $iif($did(208).state == 1,-e,-bu) idlerpg 209-211
- if ($did(208).state == 0) {
- unset %idle.timewarn
- }
- set %idle.title $did(208).state
- .timerrpgtitle $iif($did(208).state == 1,0 1 title.idlerpg,off)
- titlebar $iif($did(208).state == 1,$iif($calc(%idle.nl - $gmt) >= 0,$duration($calc(%idle.nl - $gmt),1) until next level,),)
- }
- if ($did == 209) {
- if ($did(209).state == 1) {
- set %idle.titlewarn $calc($iif($did(210).text isnum,$did(210).text,30) * 60)
- did -ra idlerpg 210 %idle.titlewarn
- }
- else {
- unset %idle.titlewarn
- }
- }
- }
- on *:DIALOG:idlerpg:close:*: {
- idlerpg.init
- .timeridlerpg off
- }
Add Comment
Please, Sign In to add comment