top_balance_sign_cmd: type: command debug: false name: topbalancesign description: Makes a sign display the user with the highest balance (money). usage: /topbalancesign (help #|set #|remove|update|list|togglenick) aliases: - tbs - topbalsign allowed help: - determine >> tab complete: - if >> { - define argList li@help|set|remove|update|list|togglenick - if == 0 { - determine } else if == 1 && !]> { - determine ]]> } } script: - if { - narrate '<&c>You must use this command in-game!' 'format:top_balance_sign_format' - queue clear } - if !> { - queue clear } - if !]> && !]> { - narrate '<&c>You must be looking at a sign to run this command!' 'format:top_balance_sign_format' - queue clear } - if > 1 && ]> { - narrate '<&c>Too many arguments!' 'format:top_balance_sign_format' - queue clear } else if > 2 && !]> { - narrate '<&c>Too many arguments!' 'format:top_balance_sign_format' - queue clear } - define loc_display - run top_balance_sign_task 'def:true|||' 'player:' top_balance_sign_task: type: task debug: false speed: 0 definitions: rfc|act|loc|page script: - choose '': - case 'help': - narrate '<&6><&l>TopBalanceSign Help<&r><&nl><&e>/topbalancesign help<&7><&co> Displays this help page.<&r><&nl><&e>/topbalancesign set #<&7><&co> Sets a sign to display the #th highest balance.<&r><&nl><&e>/topbalancesign remove<&7><&co> Removes a TopBalanceSign.<&r><&nl><&e>/topbalancesign update<&7><&co> Updates all TopBalanceSigns.<&r><&nl><&e>/topbalancesign list #<&7><&co> Lists current TopBalanceSigns.<&r><&nl><&e>/topbalancesign togglenick<&7><&co> Toggles whether to display nicknames or usernames.' - case 'remove': - define loc_retrieve ]||null> - if /]> { - flag server 'top_balance_sign.locations:<-:/' - if { - narrate '<&a>Removed TopBalanceSign sign at !' 'format:top_balance_sign_format' - sign '|||' } } - queue clear - case 'update': - if == 0 { - if { - narrate '<&c>There are no TopBalanceSigns!' 'format:top_balance_sign_format' } - queue clear } - if { - define name_type name.display } else { - define name_type name } - foreach { - define tb_player ]> - sign '<&6><&l>[Top Balance]<&r>|<&e>= # <&e>=<&r>|<&a><&r>|<&2>Right click to see balance!<&r>' '' } - if { - narrate '<&a>Updated all TopBalanceSigns!' 'format:top_balance_sign_format' } - case 'list': - define disp_list - if == 0 { - narrate '<&c>There are no TopBalanceSigns!' 'format:top_balance_sign_format' - queue clear } - if == null { - define page 1 } else if != 0 || <= 0 { - define page 1 } - define disp_list ].to[]||null> - if == null { - define page 1 - define disp_list } - narrate '<&e>== <&6><&l>List of TopBalanceSigns (/)<&r> <&e>==<&r><&nl>- - ]><&nl><&7>To see more locations, use /topbalancesign list #' - queue clear - case 'togglenick': - if { - flag server 'top_balance_sign.toggle_nick:false' - define stat Disabled } else { - flag server 'top_balance_sign.toggle_nick:true' - define stat Enabled } - if { - narrate '<&a> nicknames for all TopBalanceSigns.' 'format:top_balance_sign_format' } - default: - if == null { - define page 1 } else if != 0 || <= 0 { - define page 1 } - if > { - narrate '<&c>You can<&sq>t create a TopBalanceSign for a user who doesn<&sq>t exist!' 'format:top_balance_sign_format' - queue clear } - if /]> { - narrate '<&c>This is already a TopBalanceSign for #!' 'format:top_balance_sign_format' - queue clear } - if ]> { - define rem_loc ']>' - flag server 'top_balance_sign.locations:<-:]>' } - if { - define name_type name.display } else { - define name_type name } - define tb_player ]> - flag server 'top_balance_sign.locations:->:/' - if { - narrate '<&a>Set a sign at as a TopBalanceSign!' 'format:top_balance_sign_format' } - sign '<&6><&l>[Top Balance]<&r>|<&e>= # <&e>=<&r>|<&a><&r>|<&2>Right click to see balance!<&r>' '' - queue clear top_balance_sign_format: type: format debug: false format: '<&a>[<&2><&l>TopBalanceSigns<&r><&a>]<&r> ' top_balance_sign_events: type: world debug: false events: on system time minutely: - repeat 14 { - run top_balance_sign_task 'def:false|update' - wait '4s' } on player breaks sign_post: - inject locally 'events.on player breaks wall_sign' on player breaks wall_sign: - run top_balance_sign_task 'def:true|remove|' 'player:' on player right clicks sign_post: - inject locally 'events.on player right clicks wall_sign' on player right clicks wall_sign: - if ]> { - define tb_player - narrate '<&f> has $.' 'format:top_balance_sign_format' }