DUL_colorcode_message: type: procedure debug: false DUL: author: - BlackCoyote description: - Encodes your message into a colour code string and back. - only works with characters from a-z, 0-9, and _ ! usage: - ]> example: - encode: a: '&0&0' b: '&0&1' c: '&0&2' d: '&0&3' e: '&0&4' f: '&0&5' g: '&0&6' h: '&0&7' i: '&0&8' j: '&0&9' k: '&1&0' l: '&1&1' m: '&1&2' n: '&1&3' o: '&1&4' p: '&1&5' q: '&1&6' r: '&1&7' s: '&1&8' t: '&1&9' u: '&2&0' v: '&2&1' w: '&2&2' x: '&2&3' y: '&2&4' z: '&2&5' 0: '&2&6' 1: '&2&7' 2: '&2&8' 3: '&2&9' 4: '&3&0' 5: '&3&1' 6: '&3&2' 7: '&3&3' 8: '&3&4' 9: '&3&5' _: '&3&6' decode: '&0&0': a '&0&1': b '&0&2': c '&0&3': d '&0&4': e '&0&5': f '&0&6': g '&0&7': h '&0&8': i '&0&9': j '&1&0': k '&1&1': l '&1&2': m '&1&3': n '&1&4': o '&1&5': p '&1&6': q '&1&7': r '&1&8': s '&1&9': t '&2&0': u '&2&1': v '&2&2': w '&2&3': x '&2&4': y '&2&5': z '&2&6': 0 '&2&7': 1 '&2&8': 2 '&2&9': 3 '&3&0': 4 '&3&1': 5 '&3&2': 6 '&3&3': 7 '&3&4': 8 '&3&5': 9 '&3&6': _ script: - if li@encode|decode !contains { - debug error "DUL - No valid action specified! Must be encode or decode!" - determine null } - if == "" { - debug error "DUL - No message specified to !" - determine null } - define result "" - if == encode { - define list } else { - define list li@ - define 2 - repeat { - define list ,]>]> } } - foreach : - define result ".]||->" - determine DUL_ColorList: type: procedure debug: false DUL: author: - Anthony name: - ColorList description: - Return colors from input or just list all colors usage: - ]> example: - narrate - narrate colors: black: 0 dark_blue: 1 dark_green: 2 dark_aqua: 3 dark_red: 4 dark_purple: 5 gold: 6 gray: 7 dark_gray: 8 blue: 9 green: a aqua: b red: c light_purple: d yellow: e white: f magic: k bold: l strikethrough: m underline: n italic: o reset: r script: - define colors '' - choose '': - case 'list': - define list 'li@' - foreach '': - define list ']> %value%]>' - determine '' - case 'match': - determine '|]>' DUL_find_best_match: type: procedure debug: false DUL: author: - BlackCoyote - Anthony description: - Returns the best search match out of a list. usage: - |]> example: - |]> script: - define l '' - define list 'li@' - foreach '': - define list ']>' - define match '' - define list ']>' - if { - debug error "DUL - No valid list specified!" - determine null } - if == null { - debug error "DUL - No valid value specified!" - determine null } - if ]> { - determine } else if ]].size||0> > 0 { - determine ]].sort_by_number[length].first||null> } else if ]].size||0> > 0 { - determine ]].sort_by_number[length].first||null> } else { - determine null } DUL_hidden_spawn_locations: type: procedure debug: false definitions: location|radius DUL: author: - BlackCoyote description: - Finds spawn locations within range that are out of line of sight. - If no locations out of line of sight are found, it will return valid spawn locations within line of sight. usage: - |]> example: - |15]> script: - if !matches location { - debug error "DUL - No valid location specified!" - determine null } - if !matches number { - debug error "DUL - No valid radius specified!" - determine null } - define radius - determine ].filter[y.sub[].abs.is[less].than[3]].filter[above.above.above.material.name.is[==].to[air]].filter[above.above.above.above.material.name.is[==].to[air]].filter[above.above.above.above.above.material.name.is[==].to[air]].filter[material.is_occluding].parse[above].filter[above.center.line_of_sight[].not]||]||li@>> DUL_rainbow_text: type: procedure debug: false DUL: author: - BlackCoyote description: - Turns the colour of a text into a rainbow format with a new colour per letter. usage: - ]> example: - ]> script: - if { - debug error "DUL - No valid text specified!" - determine null } - define colormap li@<&4>|<&6>|<&e>|<&a>|<&3>|<&9>|<&5> - define result "" - foreach : - define result "]>" - determine DUL_random_surface_block: type: procedure definitions: location|radius debug: false DUL: author: - BlackCoyote description: - Finds a random surface block within the provided radius more efficiently than conventional denizen tags. usage: - |]> example: - |5000]> script: - if !matches location { - debug error "DUL - No valid location specified!" - determine null } - if !matches number { - debug error "DUL - No valid radius specified!" - determine null } - while true: - define newloc ].to[]>,0,].to[]>].highest.find.surface_blocks.within[5].get[1]||null> - if != null && { - determine } else if >= 10 { - determine null } DUL_safeString: type: procedure debug: false DUL: author: - Anthony name: - Safe String description: - Boolean tag returns true if the string only contains lower case letters, numbers, and/or underscore _ usage: - example: - narrate script: - determine '' DUL_cleanString: type: procedure debug: false DUL: author: - Anthony name: - Clean String description: - Clean a string of any character that is not a lower case letter, number, or underscore _ usage: - example: - narrate script: - determine '' # DUL_script_tracker: type: world debug: false events: on system time hourly: - webget "http://morphanone.space/webizen.aspx/tracker?script=96&version=" DUL_text_progress_bar: type: procedure debug: false DUL: author: - BlackCoyote description: - Makes a text based progress bar based on the percentage you provide. usage: - (||||)]> example: - ]> script: - define percentage - if == none { - define percentage 0 } - if { - define max } - if == none { - define max 10 } - if { - define char } else { - define char = } - if { - define col1 } else { - define col1 &a } - if { - define col2 } else { - define col2 &7 } - define string ].with[]> - define split ].as_int> - determine "]>,]>" DUL_unique_queue_id_prefixed: type: procedure debug: false DUL: author: - BlackCoyote description: - Gives a unique queue ID for you to use, with a specified prefix. usage: - ]> example: - ]> script: - define prefix - define id - while ]>: - define id - determine DUL_version_script: type: version name: dUtilLib id: 96 description: A collection of dscript functions and utilities written by BlackCoyote and Anthony. version: 8 DUL_WRCG: type: procedure debug: false DUL: author: - Anthony name: - Weighted Random Choice Generator description: - Supply a list of weight/return values and have one of the values returned to you randomly based on weight. usage: - example: - give script: - define l 'li@' - foreach '': - define l ']>' - define w '0' - foreach '': - define w '' - define number '' - define hv '0' - foreach '%l%': - define ov '%hv%' - define lv '' - define hv ']>' - if %number% >= %lv% && %number% <= %hv% { - determine '' }