- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register








The script repo is an archive of historical scripts. For modern scripts, or to post your own, please use the Scripts forum section.





dScript Help Command


By BloodEko
Created: 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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
13700

#---------------------------------------------+
#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
  linkhttp://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 <&lt>page<&gt>
  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><&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 <&lt><&7>page<&f><&gt>"






View History