Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local list "refresh" issue #1649

Closed
Olyno opened this issue Oct 31, 2018 · 5 comments
Closed

Local list "refresh" issue #1649

Olyno opened this issue Oct 31, 2018 · 5 comments
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

Comments

@Olyno
Copy link
Contributor

Olyno commented Oct 31, 2018

Description:

When a list is "refresh", the data inside is not well taken into account, and some values remain.

Code to reproduce:

The code below will not work, because when you broadcast "&aYEP! (%{_addons::*}%)" SkUtilities will remain:

on load:
	set {_addons::*} to "skUtilities", "skript-yaml" and "skript-mirror"
	loop addons list:
		loop {_addons::*}:
			loop-value-1 is loop-value-2
			remove loop-value-2 from {_addons::*}
			broadcast "&aYEP! (%{_addons::*}%)"
			exit loop

But in this code, I "refresh" the var at the beginning, and it will tell me correctly "none" at the end (and "SkUtilities" will not remain):

on load:
	set {_addons::*} and {_addonscheck::*} to "skUtilities", "skript-yaml" and "skript-mirror"
	loop addons list:
		loop {_addons::*}:
			loop-value-1 is loop-value-2
			remove loop-value-2 from {_addons::*}
			broadcast "&aYEP! (%{_addons::*}%)"
			exit loop

Skript: tested with dev37c and 2.3-beta1
Addons: skript-yaml, skUtilities and skript-mirror (latest of each)
Server: git-Spigot-2cf50f0-2b93d83 (MC: 1.12.2) and git-Spigot-2440e18-4228a56 (MC: 1.13.1)

@Blueyescat
Copy link
Contributor

Blueyescat commented Oct 31, 2018

I couldn't understand your issue, probably your first code works just as it should. But, i see a problem with the second code, it will broadcast only &aYEP! (<none>) because there is a problem with the set variables line.

set {_addons::*} and {_addonscheck::*} to "skUtilities", "skript-yaml" and "skript-mirror"

You would think this will do the same with

set {_addons::*} to "skUtilities", "skript-yaml" and "skript-mirror"
set {_addonscheck::*} to "skUtilities", "skript-yaml" and "skript-mirror"

but unfortunately no, it works like this:

{_addons::*} = skUtilities
{_addonscheck::*} = skript-yaml

More details:

on load:
	set {_a::*}, {_b::*} and {_c::*} to 1, 2 and 3
	broadcast "%{_a::*}%"
	broadcast "%{_b::*}%"
	broadcast "%{_c::*}%"

Output:

1
2
3

Works the same way with 1 or 2 lists, but if amount of the lists is greater than amount of the change values (1, 2 and 3):

on load:
	set {_a::*}, {_b::*}, {_c::*} and {_d::*} to 1, 2 and 3
	broadcast "%{_a::*}%"
	broadcast "%{_b::*}%"
	broadcast "%{_c::*}%"
	broadcast "%{_d::*}%"

Output:

1, 2 and 3
1, 2 and 3
1, 2 and 3
1, 2 and 3

When i try the same way with non-list variables:

Spoiler
on load:
	set {_a}, {_b} and {_c} to 1, 2 and 3
	broadcast "%{_a}%"
	broadcast "%{_b}%"
	broadcast "%{_c}%"

On 1.12.2 with Skript 2.2-dev37c it says ({_a}, {_b} and {_c}) can only be set to one object, not more
But on 1.13.2 with Skript 2.3-beta1 it crashes the server: https://gist.github.com/Blueyescat/535f01f2dc84db9b9780e13cbb2a6d43 (with /sk reload, it freezes the console when i try on startup)

on load:
	set {_a} and {_b} to 1 and 2

Parsed in 7 seconds on 2.3-beta1 but instant on 2.2-dev37c.

@Snow-Pyon Snow-Pyon added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: high Issues with potentially high impact that could be harmful to users. labels Oct 31, 2018
@Snow-Pyon
Copy link

Marked as high since it could potentially crash the server, even if setting multiple values at once isn't used as much as for worrying about it.

@Blueyescat
Copy link
Contributor

Blueyescat commented Oct 31, 2018

@Snow-Pyon sorry, I tried without addons and it appears to be addon issue with skript-mirror and MundoSK, but only on Skript 2.3-beta1.

Note to addon devs: @TlatoaniHJ @btk5h tried with MundoSK 1.8.6-BETA.55 - skript-mirror 0.19.1


But still the setting multiple variables (list or single) to a list doesn't work as excepted ^^

@Snow-Pyon Snow-Pyon added priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation). and removed priority: high Issues with potentially high impact that could be harmful to users. labels Oct 31, 2018
@Snow-Pyon
Copy link

If that's the case, I'm lowering the priority, gotta find out what could addons make for this to happen.

@bensku
Copy link
Member

bensku commented Oct 31, 2018

Would be nice to know what causes this, indeed.

@TPGamesNL TPGamesNL added the PR available Issues which have a yet-to-be merged PR resolving it label Mar 23, 2021
@APickledWalrus APickledWalrus added completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).
Projects
None yet
Development

No branches or pull requests

7 participants