Skript

Skript

743k Downloads

Using a function as a permission message throws an invalid warning

MinecraftMan1013number2 opened this issue ยท 8 comments

commented

Skript/Server Version

> skript info
[15:40:03 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[15:40:03 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[15:40:03 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[15:40:03 INFO]: [Skript] Server Version: git-Paper-496 (MC: 1.20.4)
[15:40:03 INFO]: [Skript] Skript Version: 2.9.0 (skriptlang-github)
[15:40:03 INFO]: [Skript] Installed Skript Addons:
[15:40:03 INFO]: [Skript]  - Skent v3.3.0
[15:40:03 INFO]: [Skript]  - skript-yaml v1.5
[15:40:03 INFO]: [Skript]  - skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
[15:40:03 INFO]: [Skript] Installed dependencies:
[15:40:03 INFO]: [Skript]  - Vault v1.7.3-b131

Bug Description

When you use a function as a permission message, it throws an incorrect warning.

Expected Behavior

No warning is thrown while reloading since it is all valid

Steps to Reproduce

The code that I am using is as follows:

command /mycommand:
	permission: my.permission
	permission message: %getPermissionMessage()%
	trigger:
		send "Command executed!"

function getPermissionMessage() :: text:
	return "&4No permission!"

Errors or Screenshots

With %% around the function on the permission message, this is the output
image

image

Without it, this is the output
image

image

Other

While I understand that this is a very small bug, its still kind of annoying (especially when the warning pops up a ton since I'm using a function for a bunch of commands).

For anyone also having this issue, here are two ways to avoid it:

  1. Put &r in front of your permission message (so like permission message: &r%function()%
  2. Disable the warning in the config

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
commented

Have you tried with skript-reflect 2.5.1?

commented

Have you tried with skript-reflect 2.5.1?

That's completely unrelated.

commented

I tried it without any addons and it was the same,

commented

It's a perfectly valid warning, as what's happening is the same as doing "%function()%", but since the user has no control over the " in this situation, disabling the warning would be a slight enhancement.

commented

The only way to get it to work is with the %%, so shouldn't there be no error?

commented

The only way to get it to work is with the %%, so shouldn't there be no error?

That's why I said the user has no control over the ". The warning is doing exactly what it's meant to do, but since the user can't actually follow its directions due to how the input is set up, it'd be an enhancement to turn it off.

commented

You may be able to use permission message: "%getPermissionMessage()%" for the moment

commented

That shows the quotes unfortunately.
image

I'm doing permission message: &r%getPermissionMessage()%, which is working fine for the time being. Thank you for the suggestion though!