dScript Help Command
By
BloodEkoCreated: 2016/08/29 04:34:13 UTC-07:00 (8 years and 117 days ago)
Edited: 2017/08/10 18:01:53 UTC-07:00 (7 years and 136 days ago)
Likes: 0
Denizen Version: build 623 ( 1.10 ) (theoretically also older versions)
Script Version: 0.4
Description:
This simple script is a powerful organisation script for your denizen-running minecraft server.
You know that feeling if you install/write scripts to your server and forget the names of the commands, or the links where you got them after some time ?
This script changes that !
Just create a simple hooking scripts which deliver all informations to the "/shelp" command, that you can find all important informations about your scripts on one place.
--------------------------------
Description how to use it properly can be found in the head of the script
Download script |
View raw script#---------------------------------------------+
#Created 29.08.16 - 29.08.16 |
#Script-Help by BloodEko |
# |
#Easy way to add a help command for dScripts |
# |
#Permission: scripthelp.use |
# Access to the /shelp command |
# |
#---------------------------------------------+
# Usage: /shelp |
#---------------------------------------------+
# Just create a yaml data/version script, |
# like the example script to hook it. |
# Note: |
# The name of the script must look like |
# shelp_<replace-with-your-name> |
#---------------------------------------------+
#Use only 'type: version' for repo-scripts |
#for proper use with the |
#'/denizen scriptversions' command |
#For all other/custom scripts use |
#'type: yaml data' like shown below. |
#---------------------------------------------+
shelp_examplescript_for_reposcripts:
type: version
author: BloodEko
name: Script Help
usage: /shelp syntax
version: 0.4
id: 105
link: http://old.mcmonkey.org/denizen/repo/entry/105
#-----[Example Script for custom scripts]-----
#shelp_examplescript_for_customscripts:
# type: yaml data
# author: BloodEko
# name: Script Help
# usage: /shelp syntax
# version: 0.1
# link: https://www.google.com/
#
#--------------------------------------------+
# |
# Internal Scripts |
# |
#--------------------------------------------+
sh_command_handler:
type: command
name: shelp
usage: /shelp | author|version|link|usage <<>page<>>
description: Shows informations about hooked scripts
permission: scripthelp.use
permission message: You don't have the permission for using this command.
script:
#
# /shelp
#
- choose <context.args.size>:
- case 0:
- define scripts_amount "<server.list_scripts.filter[starts_with[s@shelp_]].size||0>"
- if <def[scripts_amount]> < 1 { - narrate "no scripts found" - queue clear }
#
- if <def[scripts_amount]> <= 10 {
- narrate "-----[<&6>Scripts page <&f>1/1 ]-----"
}
else {
- define pages_amount "<def[scripts_amount].div[10].round_up>"
- narrate "-----[<&6>Scripts page <&f>1/<def[pages_amount]> ]-----"
}
- foreach <server.list_scripts.filter[starts_with[s@shelp_]].get[1].to[10]> {
- narrate " <&a><def[value].yaml_key[name]||unkown> <&f>- <&7><def[value].yaml_key[usage]||unkown>"
}
#
# /shelp author|version|link
#
- case 1:
- define scripts_amount "<server.list_scripts.filter[starts_with[s@shelp_]].size||0>"
- if <def[scripts_amount]> < 1 { - narrate "no scripts found" - queue clear }
- if !<li@author|version|link|usage.contains[<context.args.get[1]>]> {
- inject locally sh_false_syntax
- queue clear
}
#
- if <def[scripts_amount]> <= 10 {
- narrate "-----[<&6>Scripts page <&f>1/1 ]-----"
}
else {
- define pages_amount "<def[scripts_amount].div[10].round_up>"
- narrate "-----[<&6>Scripts page <&f>1/<def[pages_amount]> ]-----"
}
- foreach <server.list_scripts.filter[starts_with[s@shelp_]].get[1].to[10]> {
- narrate " <&a><def[value].yaml_key[name]||unkown> <&f>- <&7><def[value].yaml_key[<context.args.get[1]>]||unkown>"
}
#
# /shelp author|version|link <page>
#
- case 2:
- define scripts_amount "<server.list_scripts.filter[starts_with[s@shelp_]].size||0>"
- if <def[scripts_amount]> < 1 { - narrate "no scripts found" - queue clear }
- if !<li@author|version|link|usage.contains[<context.args.get[1]>]> {
- inject locally sh_false_syntax
- queue clear
}
- if <context.args.get[2]> !matches number {
- narrate "<&4>ERROR <&6><context.args.get[2]> <&4>is no valid number."
- queue clear
}
- define pages_amount "<def[scripts_amount].div[10].round_up>"
- define page "<context.args.get[2].as_int>"
- if <def[pages_amount]> < <context.args.get[2]> {
- narrate "<&6>There are only <&f><def[pages_amount]> <&6>pages. Showing page <&f>1 <&6>instead."
- define page "1"
}
#
- if <def[scripts_amount]> <= 10 {
- narrate "-----[<&6>Scripts page <&f>1/1 ]-----"
}
else {
- narrate "-----[<&6>Scripts page <&f><def[page]>/<def[pages_amount]> ]-----"
}
- define page_from "<el@val[1].add[<el@val[<def[page]>].sub[1].mul[10]>]>"
- define page_to "<def[page].mul[10]>"
- foreach <server.list_scripts.filter[starts_with[s@shelp_]].get[<def[page_from]>].to[<def[page_to]>]> {
- narrate " <&a><def[value].yaml_key[name]||unkown> <&f>- <&7><def[value].yaml_key[<context.args.get[1]>]||unkown>"
}
- default:
- inject locally sh_false_syntax
sh_false_syntax:
- narrate "<&7>Command Syntax"
- narrate "<&7>[1] <&f>/shelp"
- narrate "<&7>[2] <&f>/shelp author | version | link | usage"
- narrate "<&7>[3] <&f>/shelp author | version | link | usage <<><&7>page<&f><>>"
View History