Resource icon

Script MirrorUtils 1.1.2

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Supported Minecraft Versions
  1. 1.8
  2. 1.9
  3. 1.10
  4. 1.11
  5. 1.12
  6. 1.13
MirrorUtils

This resource has a bunch of useful expressions that you might need, mostly related to texts and numbers.


Addons required:
- skript-mirror, skript-mirror and skript-mirror (1.0.0)

Examples:
code_language.skript:
on chat:
   message regex matches "((http|ftp|https):\/\/)?[-a-zA-Z0-9@:%%._\+~##=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%%_\+.~##?&//=]*)"
   cancel event
   send "You cannot send URLs in chat!"

code_language.skript:
on command:
   argument at 2 of full command = "forbidden"
   send "You cannot use such argument in position 2!"

code_language.skript:
on load:
   set {test} to yaml value "message.setmoney" from "config"
 
command /money [<text>] [<text>]:
   trigger:
       set (arg 1 parsed as offlineplayer)'s balance to (arg 2 parsed as number)
       send replacer "<player>" and "<value>" with "%arg 1 parsed as offlineplayer%" and "%arg 2 parsed as number%" in {test}

Expressions:
String
code_language.skript:
# NEW LINE
# Used to add a new line to tab headers/footers and messages.
(newline|nl|cr)

# REGEX REPLACE
# Replaces a regular expression in a string with another string.
regex replace %text% with %text% in %texts%

# REGEX SPLIT
# Splits a string using a regular expression.
regex split %texts% at %text%

# MATCHER OF STRING
# Gets the regular expression matcher in a string.
match[er] %text% (to|in|of|with) %text%

# REGEX GROUPS OF MATCHER
# Gets the regular expression groups from a matcher.
# A matcher is obtained from the expression above.
[regex] group[s] %integer% of [matcher] %object%

# SUBTEXT
# Gets the subtext of a string. Exactly like Skript's, but for a single argument
sub(text|string) of %text% (from|char[racter][s]) %integer%

# EXACTLY EQUALS
# Checks if a string is equal to another.
# Case sentitive (only reason for it to be here).
%text% exactly equals [to] %text%

# ARGUMENT AT
# Gets the nth element of texts separated by spaces.
# Useful for on command events.
argument [at] %integer% of %text%

# REPLACER
# Allows you to replace multiple values at once in a string.
# Most useful expression around.
(multi[ple] replace|replacer) [(elements|values)] %texts% with %texts% in %text%

# RANDOM STRING
# Generates a random string with the length specified.
random (1¦alphanumeric|2¦alphabetic|3¦numeric|4¦ascii|5¦graph) [(text|string)] [with] (size|length) %integer%

Numbers
code_language.skript:
# SPACED NUMBER
# Returns a string with formatted number.
spaced %numbers%

# ORDINAL NUMBER
# Gives you the number with proper formatting (1st, 2nd, 3rd... 22nd, 24th)
ordinal [of] %integer%

# SUM PREVIOUS
# Sums all the integers smaller than a number N.
# Useful for shops that increase the price and allow multiple items bought at once.
sum prev[ious] [numbers] of %integer%

# ROUND TO
# Rounds a number to N decimal places.
round %number% to %number% [decimal] [places]

# TOP/LAST ELEMENTS
# Sorts a variable directly and returns a list of texts with the format used.
# Considerably more efficient than any other methods of sorting available in Skript.
(1¦(top|first)|2¦(last)) %integer% (values|elements) of %objects% [formatted] as %text%

# NUMBER TO ROMAN NUMERAL
# Converts a number to a roman numeral.
%number% (to|in) roman [numeral]

# NUMBER TO WORDS
# Converts a number into words.
number %number% (to|in) words

# FORMATTED NUMBER
# Formats a number using symbols to indicate base 10 exponents (k, M, B).
formatted %number% [round[ed] to %-integer%]

# PI
# pi
pi

Time
code_language.skript:
# TIME SINCE
# Returns the time (seconds) since a unix timestamp.
time since %number%

# TEXT TO SECONDS
# Parses timespans like 1d10h10s.
# Incredibly useful for temporary bans/mutes...
%text% (to|in) seconds

# FORMAT SECONDS
# Uses an util to change seconds into any format you want.
# Check https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/time/DurationFormatUtils.html.
format %number% (into|as) %text%

# CURRENT MILLISECONDS
# Returns the current time, in milliseconds.
[current] m[illi]s[econds]

Location
code_language.skript:
# DIRECTION NAME
# Returns the first letter of the direction of a location. (N, S, E, W)
# Use "with cardinals" to include SW, NW, NE and SE.
direction name of %location% [(1¦with cardinals)]

# BLOCKS FROM A TO B
# Gets the blocks between two locations.
blocks from %location% (to|and) %location%

Item
code_language.skript:
# ITEM WITH LORE
# Returns an item with the lore specified.
%item% with lore %text%

# HIDE FLAGS
# Hides flags of an item.
%item% with [(item|hidden|hide)][ ]flags %texts%

# ITEM OF ENCHANTMENTS
# Exactly like Skript's expression, but works for variables.
%item% of %enchantmenttypes%

# GLOWING ITEM
# Returns a glowing item (glows like it's enchanted, but doesn't show any).
glowing %items%

# ITEM'S META
# Returns the meta of an item.
meta of %item%
%item%'s meta

Player
code_language.skript:
# DURATION OF POTION
# Returns the duration (in seconds) of that potion in an entity.
duration of [potion] [effect] %potiontype% (on|of) %livingentity%

# TIER OF POTION
# Returns the level of the potion applied to an entity.
tier of [potion] [effect] %potiontype% (on|of) %livingentity%

Conditions
Text
code_language.skript:
# REGEX MATCHES
# Checks if a string matches a regular expression.
%texts% [regex] matches %text%

Number
code_language.skript:
# IMPROVED BETWEEN
# Checks if a number is between two others.
# Allows < and <=.
%number% (1¦\<|2¦\<=) %number% (3¦\<|4¦\<=) %number%

Player
code_language.skript:
# ENTITY HAS POTIONS
# Continues if the entity has those enchants in their respective levels.
%livingentity% has [potion] [effect[s]] %potiontypes% [level[s]] [%-integers%]

Effects:
Variables
code_language.skript:
# i++
# Basically a shortcut for lazy people who don't like to use "set {_n} to {_n} + 1"
# Can also add/remove values that are not 1.
%object%(1¦++|2¦--)[%-number%]

There are full descriptions in the file, if you need them.

EWS (TrademarkTM)​
Author
EWS
Downloads
2,437
Views
2,437
First release
Last update
Rating
5.00 star(s) 6 ratings

More resources from EWS

Latest updates

  1. Bug fixes

    Bug fixes: - changed the enchant expression to %itemstack% enchanted with %enchantmenttypes% to...
  2. Fixed enchant & formatted number expressions

    Bug fixes: - changed the enchant expression to %itemstack% enchanted with %enchantmenttypes% to...
  3. Fixes for 2.3.1 and minor changes

    Fixes: - MirrorUtils now supports 2.3.1. - Fixed condition comments where it was showing as...

Latest reviews

[18:56:30] [Server thread/INFO]: TheHallowed [812bf960-0c17-3770-b82b-0b50b7b2b9d5]: /cash adicionar TheHallowed 20000
[18:56:30] [Server thread/ERROR]: #!#!
[18:56:30] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[18:56:30] [Server thread/ERROR]: #!#!
[18:56:30] [Server thread/ERROR]: #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
[18:56:30] [Server thread/ERROR]: #!#! If you're a server admin however please go to http://dev.bukkit.org/server-mods/skript/tickets/
[18:56:30] [Server thread/ERROR]: #!#! and check whether this error has already been reported.
[18:56:30] [Server thread/ERROR]: #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it,
[18:56:30] [Server thread/ERROR]: #!#! and describe what you did before it happened and/or what you think caused the error.
[18:56:30] [Server thread/ERROR]: #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
[18:56:30] [Server thread/ERROR]: #!#! By following this guide fixing the error should be easy and done fast.
[18:56:30] [Server thread/ERROR]: #!#!
[18:56:30] [Server thread/ERROR]: #!#! Stack trace:
[18:56:30] [Server thread/ERROR]: #!#! java.lang.UnsupportedOperationException: '%objects% while %boolean%' should only be used in loops!!
[18:56:30] [Server thread/ERROR]: #!#! at com.pie.tlatoani.Miscellaneous.ExprLoopWhile.get(ExprLoopWhile.java:27)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.util.SimpleExpression.check(SimpleExpression.java:162)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.util.SimpleExpression.check(SimpleExpression.java:157)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.conditions.CondCompare.check(CondCompare.java:239)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.Condition.run(Condition.java:58)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:63)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:91)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.Trigger.execute(Trigger.java:53)
[18:56:30] [Server thread/ERROR]: #!#! at com.btk5h.skriptmirror.skript.custom.condition.CustomCondition.checkByStandard(CustomCondition.java:46)
[18:56:30] [Server thread/ERROR]: #!#! at com.btk5h.skriptmirror.skript.custom.condition.CustomCondition.check(CustomCondition.java:40)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.Condition.run(Condition.java:58)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.Conditional.walk(Conditional.java:53)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:91)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.Trigger.execute(Trigger.java:53)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:222)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:184)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.command.Commands.handleCommand(Commands.java:269)
[18:56:30] [Server thread/ERROR]: #!#! at ch.njol.skript.command.Commands$1.onPlayerCommand(Commands.java:164)
[18:56:30] [Server thread/ERROR]: #!#! at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[18:56:30] [Server thread/ERROR]: #!#! at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[18:56:30] [Server thread/ERROR]: #!#! at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[18:56:30] [Server thread/ERROR]: #!#! at java.lang.reflect.Method.invoke(Unknown Source)
[18:56:30] [Server thread/ERROR]: #!#! at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306)
[18:56:30] [Server thread/ERROR]: #!#! at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[18:56:30] [Server thread/ERROR]: #!#! at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
[18:56:30] [Server thread/ERROR]: #!#! at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487)
[18:56:30] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1154)
[18:56:30] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:997)
[18:56:30] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45)
[18:56:30] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1)
[18:56:30] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13)
[18:56:30] [Server thread/ERROR]: #!#! at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[18:56:30] [Server thread/ERROR]: #!#! at java.util.concurrent.FutureTask.run(Unknown Source)
[18:56:30] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44)
[18:56:30] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715)
[18:56:30] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
[18:56:30] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
[18:56:30] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
[18:56:30] [Server thread/ERROR]: #!#! at java.lang.Thread.run(Unknown Source)
[18:56:30] [Server thread/ERROR]: #!#!
[18:56:30] [Server thread/ERROR]: #!#! Version Information:
[18:56:30] [Server thread/ERROR]: #!#! Skript: 2.2-SNAPSHOT
[18:56:30] [Server thread/ERROR]: #!#! Bukkit: 1.8.8-R0.1-SNAPSHOT
[18:56:30] [Server thread/ERROR]: #!#! Minecraft: 1.8.8
[18:56:30] [Server thread/ERROR]: #!#! Java: 1.8.0_251 (Java HotSpot(TM) 64-Bit Server VM 25.251-b08)
[18:56:30] [Server thread/ERROR]: #!#! OS: Windows 7 amd64 6.1
[18:56:30] [Server thread/ERROR]: #!#!
[18:56:30] [Server thread/ERROR]: #!#! Running CraftBukkit: false
[18:56:30] [Server thread/ERROR]: #!#!
[18:56:30] [Server thread/ERROR]: #!#! Current node: null
[18:56:30] [Server thread/ERROR]: #!#! Current item: 'continue' while com.btk5h.skriptmirror.skript.reflect.ExprJavaCall@7ec359a8 is equal to [[boolean:true]] (comparator: null)
[18:56:30] [Server thread/ERROR]: #!#!
[18:56:30] [Server thread/ERROR]: #!#! Thread: Server thread
[18:56:30] [Server thread/ERROR]: #!#!
[18:56:30] [Server thread/ERROR]: #!#! End of Error.
[18:56:30] [Server thread/ERROR]: #!#!

using "if arg 3 regex matches "[0-9a-zA-Z]+":"
This has a lot of cool features, like regex which are useful. I only see one issue with it though, EWS.

It's in the [Script] section even though it should be even the [API] section since it's more like an API over a script. That's it, thanks! Have a good day.
amazing work, author is very professional and supportive ~dad
This is a very nice mirror resource, I'd probably use it a lot lol
I think that's a must-have for every skript Server! Works just fine as it should, really fast support... It's just nice. Keep up your work c:
This is EPIC! Great work mate, this is truly helpful. Keep it up <3
EWS
EWS
Thanks for you support.
If you have new ideas for syntaxes, please send me a PM!