Skript

Skript

743k Downloads

Sorted indexes of string lists not comparing strings

ShaneBeee opened this issue · 1 comments

commented

Skript/Server Version

[13:42:58 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[13:42:58 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[13:42:58 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[13:42:58 INFO]: [Skript] Server Version: git-Paper-450 (MC: 1.20.4)
[13:42:58 INFO]: [Skript] Skript Version: 2.8.2 (selfbuilt-unknown)
[13:42:58 INFO]: [Skript] Installed Skript Addons: 
[13:42:58 INFO]: [Skript]  - skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
[13:42:58 INFO]: [Skript]  - SkBee v3.4.1 (https://github.com/ShaneBeee/SkBee)
[13:42:58 INFO]: [Skript]  - SkBriggy v1.2.0
[13:42:58 INFO]: [Skript] Installed dependencies: 
[13:42:58 INFO]: [Skript]  - Vault v1.7.3-b131

Bug Description

When using the sorted indexes expression, strings are not getting sorted, whereas numbers are.

Expected Behavior

That they're sorted by string.

Steps to Reproduce

test code:

on load:
	set {-test::a} to "Bob"
	set {-test::b} to "Donald"
	set {-test::c} to "Zeffer"
	set {-test::d} to "Angus"
	set {-test::e} to "Kevin"

	set {_indexes::*} to sorted indices of {-test::*} in ascending order

	send {_indexes::1}
	send {-test::%{_indexes::1}%}

output:

[13:44:16 INFO]: a
[13:44:16 INFO]: Bob

"Angus" should be first

Testing with numbers:

on load:
	set {-test::a} to 99
	set {-test::b} to 1
	set {-test::c} to 100
	set {-test::d} to -50
	set {-test::e} to 777

	set {_indexes::*} to sorted indices of {-test::*} in ascending order

	send {_indexes::1}
	send {-test::%{_indexes::1}%}

output:

[13:44:50 INFO]: d
[13:44:50 INFO]: -50

This is correct

Errors or Screenshots

no errors

Other

I like turtles! 🐢

Agreement

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

Yes.. a very troubling issue, indeed. Been struggling with this for two days, now.