TuSKe by Tuke_Nuke

A Skript addon which brings custom things to help you to improve your scripts.

Events

7

Expressions

62

Effects

14

Conditions

12

Types

5

Sections

0

Structures

0

Total

100

Internal Changes 2524 days, 18 hours and 46 minutes ago

  • Fixed conflicts with Skript dev32+.
  • Fixed issues from issues tacker.
  • Added support to use a list of permissions in execute command with permission effect.
    Example:

    execute player command "/cmd" with permissions "first.permission" and "second.permission"


Internal changes:
  • Changed documentation generator system, cleaned the code and added support for other types of files (markdown, json and yaml).
  • Added an ID field for docs generator, useful for external docs tools. (Thanks to @eyesniper2)
  • Fixes for gui manager system.
  • Using gradle as dependency manager.
  • Changed the package from me.tuke.sktuke to com.github.tukenuke.tuske.

View Update

Important bug fixes. 2638 days, 18 hours and 22 minutes ago

[+] Added:

  • Added support for on break event in effect cancel drops. It allows you to prevent the drops of event-block. (For 1.12+ only)

[+] Fixed:
  • Fixed a issue with Advanced GUIs caused by the last update. If you are in TuSKe 1.8 and use advanced guis, it's recommended that you update it.
  • Some final fixes for Recipe Manager: Shapeless recipe now works fully to accept custom ingredients.
  • Also some fixes for recipes for 1.11.2 and lower: Due to code mistake, it wasn't properly checking its version, causing some console errors when registering recipes. It affects if you are in 1.12 too, due to key change of recipes from bukkit:%random uuid% to tuske:%increasing number (See last update changelog about it).

Special thanks to @X0Freak for donating to TuSKe.

View Update

1.12 Recipes support, fixes and small additions. 2652 days, 7 hours and 20 minutes ago

[+] Added:

  • Expressions to create knowledge books containing recipes:
    #A list of recipes of a knowledge book. Can be edited.
    knowledge(s| recipes) of %itemstack%
    %itemstack%'[s] knowledge(s| recipes)

    #Returns a knowledge book with given recipes
    %itemstack% with [recipes] %recipes%


  • Added a syntax filter for evaluate effect. Read more about it at documentation or in TuSKe's config file.

  • Added support for version dependent stuffs (player data expression...).

  • Added support for 1.12 recipes:

    • It keeps the same if you are in 1.11.2 or lower, but now the recipes has ids and the recipes must be registered at server startup (in script/skript load event). Why? Because if a player joins a server and he has a recipe knowledge that was registered by TuSKe and it wasn't registered yet, it will spam your console saying that the recipe with id X couldn't be found. So to avoid it, you will need to register all your recipes at server startup.

    • Custom recipes doesn't show up in recipe book. Why? I don't know, maybe Bukkit forgot about it?

    • Since the recipes had some changes in 1.12 and they are supported now in TuSKe, if you used previous version in 1.12 server you might see some console spam saying that couldn't find a recipe X. This is because every TuSKe recipe will be registered with id tuske:%last recipe id + 1%, while previously bukkit registered them as bukkit:%random uuid%.
    • Added a simple expression to get the id and plugin owner of a recipe:
      recipe id of %recipe% #For TuSKe it will return as 'tuske:%number%' while for vanilla as 'minecraft:%result item name%'
      recipe owner of %recipe% #It returns the plugin that registered this (old plugins will return as 'Bukkit') or vanilla recipe




[=] Changed:
  • The slot parameter in effects from simple gui (format a gui slot ...) now is optional, which means it will format the next avaliable slot (not formatted yet).
    format gui slot of player with stone #It will set the slot 0
    format gui slot of player with stone #It will set the slot 1
    #And so on...

  • Also, just another option, if you use value -1 it will format last slot id + 1.
    • Why -1? Because this is the only avaliable id (since slot goes from 0 to ...), and to not gets more confusing adding more syntaxes and stuffs.
      format gui slot 10 of player with stone #Normal, slot 10
      format gui slot -1 of player with stone #It will get the last slot + 1, in this case, slot 11.




[#] Fixed:

  • Fixed issues for the effects with section, if the code inside of a section contains a delay effect (wait effect for example), it will wait the whole trigger instead of jumping to outside of section.
    • Currently only the create gui and evaluate effect was affected by this.

  • Fixed the expression rarity of %custom enchantment% not being registered.
  • Fixed some conflicts between types values.
  • Fixed ingredients of %recipe% not working for 1.12 due to API changes.
  • Fixed custom shapeless recipes not working properly in some cases.
  • Simple GUIs and Advanced GUIs shares the same new click listener: it disables itself and doesn't conflict with Skript when cancelling it.
  • Fixed local variables not working in run when close gui effect.
  • Fixed a long load time due to a issue while saving the config.

Wow, that's the hugest fixes list I've released. Just download it above or uses /tuske to update.

View Update

Fixed conflicts between types 2685 days, 11 hours and 35 minutes ago

[#] Fixed issue with conflicts between inventory type and gamemode (both had same value: creative). It's important to update it even if you didn't have that issue yet.

View Update

Fixed error from last update 2685 days, 16 hours and 37 minutes ago

[#] Fixed a console error with format a gui slot ... to run gui event from last update.

View Update

GUI Manager 2, Custom Recipe fixes, Performance increased, Documentation generator 2685 days, 18 hours and 14 minutes ago

[+] Added:

  • GUI Manager 2: New features, new syntaxes, faster and better. See the new tutorial
  • Option to remove a specific recipe.




    remove all recipes of {_tool} from all recipes
    loop all recipes of {_tool}:
    remove loop-recipe from all recipes
    -
    loop all recipes of {_tool}:
    delete loop-recipe #Remove from server
    reset loop-recipe #In case it is a custom recipe, it will delete only the custom recipe,
    #remainning the default vanilla recipe (where it only checks the id and data).



  • New evaluate effect: Some additions compared the one from SkQuery.



    Syntax:


    evaluate [logging [[the] error[s]] in %variable list%]: (%strings%|<.+>)


    Description:

    It allows you to parse a string as skript code and execute it. The main difference is that it does support multiple lines at once and can be parse a code from a section, examples:

    evaluate: "kill player"
    evaluate: "broadcast ""Hello""" #Using quotes
    evaluate: broadcast "Hello" #Quotes not needed, it can parse directly from it

    set {_effect} to "send"
    evaluate:
    if player is a op:
    %{_effect}% "True" #Before parsing the code, it will convert all expressions/variables to text

    evaluate logging errors in {_errors::*}: "this is not a valid Skript effect/condition"
    if {_errors::*} is set: #It will contains a skript error
    loop {_errors::*}:
    send loop-value
    # The error message format is:
    # <Error message>: <wrong expression> (TuSKe/evaluate.sk, line <line of code>, '<whole line>')
    # The file 'TuSKe/evaluate.sk' is fictitious, it doesn't create one.



  • Added documentation generator for all addons.

    • It will create a file containing everything from a addon separated.

    • Some useful informations like return type and changers of an expression, event values of an event and the possible values of a type. All types have its own file separated since is not possible to determine which addon it is from.

    • Also, there is a new online documentation at wiki page. This is a working progress of automatic documentation generator.


  • Added new event for SimpleClans:
    [on] clan chat:
    #It is called when a player say something in private clan chat.
    player: Who sent the message
    event-clan: The clan, the same as "player's clan"
    event-string: The message. Currently it can't be setted (I forgot about that). Next release I will make a expression for it
    cancellable


[=] Changed
  • Better performance changes.

    • More self triggable stuffs. What does it means? Some stuffs that are only enabled when they are beeing used.

      • The custom events (on anvil merge, on anvil rename, on inventory move ...) is one of example above. Before, those events were based of inventory click event, where it was checking this event even when you are not using the custom events. But now, the listener is disabled if you are not using them.

      • The GUI Manager also follow that rules: It will only use the inventory click event when there is a GUI open. How does it works?

        • A GUI is opened to a player > The inventory checking is enabled for a single the player > The player closes the GUI > The inventory checking is disabled.



      • Some internal stuffs that uses that idea.




[#] Fixed:
  • Fixes for Recipe Manager:

    • Throwing a console error when registering a shaped recipe.

    • Shapped recipes that are lower than 3x3 was returning missing air ingredients in ingredients of %recipe%.

    • Items with same ingredients (id an data) but with different nbt (name, lore ...) weren't working properly when crafting, now it does. But a warning

      • It has a visual bug when you have the condition above and you switch the ingredients to make 2 recipes different, sometimes the result item becomes invisible, but the item still there. I tried using update inventory of player but no success.



  • all commands was returning Skript commands as skript:<command>.
  • Fixed the updater, sometimes it doesn't check the version properly.


If you didn't have problems with the updater, just execute /tuske update plugin or install it manually.

View Update

Update 1.7.3: Update 1.7.3: Fixed effects with functions 2778 days, 19 hours and 26 minutes ago

[#] Fixed effects/expressions that was using a function in it (evaluate function and gui manager):

  • Throwing a error in case you were using new parser from Bensku's fork.
  • The function getting the last value in a loop.

View Update

Update 1.7.2: Fixed GUI function effect and new expression. 2780 days, 20 hours and 27 minutes ago

[#] Fixed effects/expressions related to functions:

Some effects was using a workaround to make possible to get a function (in GUI Manager specifically) and it was bugging sometimes when the function has complex parameters (more than one parameter or/and list parameters).
For GUI Manager: Now it's possible to run a function even if it wasn't loaded yet or is below the code.
So it's possible to make like this:

make gui slot 0 of player with stone to run function doSomething()
#Som lines below...
function doSomething(i: int = 1):
broadcast "Hello there!"

Or call the own function that the effect is inside:
function openGUI(p: Player, type: String):
if arg is "1":
open virtual chest inventory named "Example 1" to {_p}
make gui slot 0 of {_p} with stone named "Go to page 2" to run function openGUI({_p}, "2")
else if arg is "2":
open virtual chest inventory named "Example 2" to {_p}
make gui slot 0 of {_p} with stone named "Go back to page 1" to run function openGUI({_p}, "1")

[+] Added an expression to get the last attacker of a entity.
last attacker of %entity%
%entity%'[s] last attacker

Note: There is a possibility to this expression return a block, I tried some damages that is caused by blocks and I couldn't make it detect the Block. I'm not sure if it is normal or was fixed in new Spigot releases.
This expression returns null if the entity didn't get any damage yet or wasn't caused by a entity.
on damage:
send "%last attacker of victim%" to victim
wait a tick
send "%last attacker of victim%" to victim #The last attacker will be the 'attacker' because it is a tick later.

View Update

Update 1.7.1: Full recipe support, GUI Manager remade part one and general stuffs. 2789 days, 13 hours and 17 minutes ago

I was off for a few months ago, and I couldn't make weekly updates. But here I am.

Some of these things aren't new if you was using some beta releases. I plan to release some beta versions before release some big stuffs, so if you want to know what's new, just check there.

Tl;DR:

  • Recipe support.
  • Damage modifiers.
  • A regex type.
  • Added general stuffs.
  • Fixed lot of things.


[+] Added full recipe support. Minecraft doesn't check for name and lore of ingredients of a recipe. So, with that I decided to make some stuffs to make it possible
So far, check out this wiki to see some informations about it.
#Effects
(create|register) [new] [custom] shaped recipe with (return|result) %itemstack% using [ingredients] %itemstacks% [with shape %strings%]
(create|register) [new] [custom] shapeless recipe with (return|result) %itemstack% using [ingredients] %itemstacks%
(create|register) [new] [custom] furnace recipe with (return|result) %itemstack% using [source] %itemstack% [with experience %number%]

#Expressions:
[the] shape of %recipe%
[the] furnace level of %recipe% #This and the one above isn't too much necessary, just in case you want some recipe's info.
recipe from ingredients %itemstacks%


Note: Soonly, the expression result item of %itemstacks/recipe% won't accept the itemstacks anymore. Use recipe from ingredients %itemstacks% instead.
#Previously:
set {_resultItem} to result item of stone #will return a stone buttom
#Now:
set {_resultItem} to result item of recipe from ingredients stone


Note 2: In the effects to register a shaped or shapeless recipe, you need to include the custom in the pattern, so it will accept custom ingredients.

[#] Fixed the expression recipe from ingredients %itemstacks% (previously result item of %itemstacks%), not it can detect most of recipes easily only by its ingredients.

[+] Added a expression to get damage modifiers.
It is used in on death event.

damage [modifier] %damage modifier%


Type:
Damage modifier:
absorption - This represents the damage reduction caused by the absorption potion effect.
armor - This represents the damage reduction caused by wearing armor.
base - This represents the amount of damage being done.
blocking - This represents the damage reduction caused by blocking, only present for Players.
hard hat - This represents the damage reduced by a wearing a helmet when hit by a falling block.
magic - This represents the damage reduction caused by the combination of: Armor enchantments Witch's potion resistance
resistance - This represents the damage reduction caused by the Resistance potion effect.

Example:

on damage:
if damage magic is set:
clear damage magic #Will set the value to 0
else if damage armor is set:
add 10 to damage armor


You can add, remove and set values, clear/delete values is the same to set to 0 and reset will set the value to the first value before all changes.

[+] Added a type %regex%. It is used in regex expressions to parse the regex pattern. Also added an expression to check what was wrong on last pattern.

#Expression:
[last] regex [parser] error

#Example
set {_regex} to "(.*" parsed as regex
if last regex parser error is set:
send regex error to player #It will show that the pattern doesn't have a closing bracket.
set {_result} to regex replace "(.*)" with "$3" in "whatever"
if last regex parser error is set:
send regex error to player #It will send that there isn't any group 3 in the pattern.


So this include to make a little change in all stuffs related to regex. to accept %string/regex% in the pattern, like
%string% [regex] matches %string/regex%


[+] Added general stuffs.
#Expression:
file [location] of command %string%
command %string%'[s] file location

offline player from [uuid] %string% #Only necessary in case you don't have latest Bensku's fork.
[jukebox] record of %block% #Returns an itemstack, you can set it, but only the material, setting to air make the song stop

#Effect:
eject record [(of|from)] %block% #Stop the song and pull the record off


[=] Changes:
#From
[all] commands
#To
[all] [registered] [script] commands


If you use script in the pattern, the expression will return only the commands that came from Skript.

[#] Fixed the auto update since the previous source to check changed the link. Now it checks in the github.

Just update it with /tuske update plugin if you are 1.7-beta+.

View Update

TuSKe - Custom Enchantments, GUI Manager and more! 2827 days, 13 hours and 25 minutes ago


TuSKe is an addon for Skript, that brings integrations with some popular and useful plugins to Skript, and also, brings some new features to help server's admins.


Supported plugins:
- Marriage
- SimpleClans
- LegendChat
- ProtocolSupport / ViaVersion

Documentation: SkUnity's Doc.


Features:


To create a custom enchantment, is very simple and easy to do, let's start with a simple tutorial.
After 1.5.3, you can create custom enchantments using effects in your skript. All you have to do is register a enchantment with a name, this name will be used at your code to enchant items.
on skript load:
register a new custom enchantment with id name "Magic"


The id name is what you use in your code to enchants a item, in this example, we will use Magic as custom enchantment's name.

This is the basic of creating a custom enchantment, but it's not all. It has somethings that you can hide and the plugin will use a default value and there are values that are optional. The expressions that you don't need to set if you don't want are:

set max level of Magic to 10

The max level that a enchantment can have, it goes from 1 to 10, the default is 3.

set rarity of Magic to 3

The rarity of enchantment, it goes from 1 (rare) to 5 (common), the default is 3.

set accepted items for Magic to "Swords", "Bow" and "Armor"

The types of items that the enchantment accepts. This doesn't accept the ID or name of item, only especific values and they are:
Helmets, Chestplates, Leggings, Boots, Pickaxes, Axes, Shovels, Bow and Fishing Rod
And there are values that represents a group of groups above:
Tools: Pickaxes, Axes and Shovels
Armor: Helmets, Chestplates, Leggings and Boots
All: All groups above
If this option is not set, it will use the default value, All. You can use more than one value, it's just separate with "," or "and".

set enabled for Magic to true

If true, the enchantment can be gotten on enchantment table, else, only by skript. By default is false.

The optional value doesn't have a default value, so you don't need it if you don't want it.

set conflicts for Magic to Enchantment and Another_Enchantment

It will set a group of enchantments that is incompatible with the enchantment, it means that they won't be together at same item. The value is the ID name of other custom enchantments.

Here is a example of how it's should look like:
on skript load:
register a new custom enchantment with id name "Magic"
set {_enchantment} to "Magic" parsed as custom enchantment
set max level of {_enchantment} to 5
set rarity of {_enchantment} to 1
set accepted items for {_enchantment} to "Swords" and "Bow"
set lore name of {_enchantment} to "Magic Power"


After the configuration, you just have to reload the file: or you restart your server or you execute the skript effect:

reload all custom enchantments

If everything is right, you shouldn't see any errors on console. After that, you only have to create your custom effects for the enchantment by yourself. And to do that, you have some expressions to help you.

#You can specify the level or not.
%itemtype% has custom enchantment %custom enchantment%
level of custom enchantment %custom enchantment% of %itemstack%
#You can add or remove enchantments from it.
[all] custom enchantments of %itemstack%
...




To create a GUI, isn't that complex, we have these effects:

(format|create|make) [a] gui slot %numbers% of %players% with %itemstack% to [do] nothing

(format|create|make) [a] gui slot
%numbers% of %players% with %itemstack% to close [using %click action% [(button|click|action)]]

(format|create|make) [a] gui slot
%numbers% of %players% with %itemstack% to [close then] run %command sender% command %string% [as op] [using %click action% [(button|click|action)]] [with cursor [item] %itemstack%]

(format|create|make) [a] gui slot
%numbers% of %players% with %itemstack% to [close then] run function %function% [using %click action% [(button|click|action)]] [with cursor [item] %itemstack%]

The first one will do exactly nothing more than just nothing. The item won't peform any action.

The other 3 effects has [using %click action%], if you use that in the effect, it will run the command/function only if it is a specifc click action. and if you don't want, it will run with any click type. The supported click actions are:

left, right, shift left, shift right, double click, middle, number key, drop and control drop


If you have v2.2-dev16b or above from Bensku' Skript fork, you will have to search for click action in its documentation, because the values are different.

The second will close when you click on it.

The last two has [with cursor %item stack%]. It will only run if a player click on item, with another specific item.

The third will peform a command. You can execute with console or a player, and if it is a player, you can execute as op too.

And the last one is to execute a function.
Examples:
create a gui slot 0 of player with stone to do nothing
create a gui slot 1 of player with potato to close with left click
create a gui slot 2 of player with paper to run player command "CommandHere" as op
create a gui slot 3 of player with diamond to run console command "CommandHere"
create a gui slot 4 of player with gravel to run function giveItems(player) with cursor item stone

You can also use multiple action:
create a gui slot 2 of player with stone to run function subtract(1) with left click
create a gui slot 2 of player with stone to run function increase(1) with right click

If you want to change the item, you don't need to format the slot again, you can just change the item in slot:
function toggle(p: Player):
if {var} is true:
set slot 0 of current inventory of {_p} to red wool
else:
set slot 0 of current inventory of {_p} to green wool

#your code to open a inventory/virtual inventory
create a gui slot 0 of player with green wool to run function toggle(player)

And if you want to unformat the slot, it's just:
unformat the gui slot 1 of player
#or if you want the whole inventory
unformat all gui slots of player

And some conditions:
%player% has [a] gui #Check if has any gui in his open inventory
slot %number% of %player% is a gui #Check if a slot is a gui

Bug fixes from the old method, an another addon that it isn't update anymore:
- No wait a tick needed after open the inventory.
- It will only format the current open inventory of player (doesn't include the crafting slots).
- Doesn't conflicts with others slots of the same inventory.
- No loop problem, you can make loops and the command/function will have different values for each one.


Examples:


on anvil combine:
event-item-one is a diamond sword
event-item-two is a diamond sword
send "Oh, you combined two diamonds swords!"

on anvil rename:
event-string is "Awesome axe"
event-item-result is any axe
send "You've renamed your %event-item% from %event-item's name% to %event-string%"

command /players: #will send a list of players in alphabetic order
trigger:
set {_players::*} to alphabet order of all players
loop {_players::*}:
send "%loop-value%"

command /xp: #shows the amount of experiences orbs that player has
trigger:
send "You have %xp of player% experiences orbs."
on damage of player:
if attacker's tool has custom enchantment Vampire:
set {_AddHealth} to 1 * level of custom enchantment Vampire of attacker's tool
add {_AddHealth} to health of attacker



Requires:
- Skript
- (Optionally) the plugins listed above.

How to install:
- Place the Skript and TuSKe at plugins' folder. (If you already have Skript, place only the TuSKe).
- Restart your server. (You can't load the plugins while your server is running.)
- Done!
Now it's just start to code in Skript and use the features of TuSKe in your scripts.

Support:
If you have a problem to make some code, you can use the Skript's forum: SkUnity's Forum. If you have a especific problem with TuSKe, go to the post about TuSKe.

Suggestions and bugs:
Do you have any suggestions? Comment below.
Did you found some bug? Send me a PM or comment in discussion page.

View Update

© Copyright 2014-2024 skUnity

All rights reserved.