Closed weberlepecheur closed 7 years ago
Please check the system with debug messages. It doesn't look like a TuSKe issue.
It depends on content of {ecc::*}
list variable as it is {ecc::%loop-value%::loc}
, so just do this:
loop {ecc::*}:
send "{ecc::%loop-value%::loc}" #there are no missing percent signs
And see if output variable is what you want or not.
Oh, maybe you need loop-index
instead of loop-value
? I think yes.
For example if you do set {ecc::test} to 1
, then loop-value
is 1
and loop-index
is "test"
.
Note: Do not put open last gui to player
in create gui
codeblock
Okay i tried that and he answer me this:
[20:37:19] [Server thread/INFO]: [Skript] send "%0% §7- §r{ecc::%< none >%::loc}" to [player:WeBer_Le_Pecheur [location:(world:176.2135620981712,123.0,258.1550533327291|yaw=-16.019093/pitch=12.650196)]]
My code (updated with your note):
set {_slot} to 0
create a gui with virtual chest with 1 rows named "Ecc avr var":
loop {ecc::*}:
make gui slot {_slot} with player's skull named "%{ecc::%loop-value%::title}%" with lore "&r ||%{ecc::%loop-value%::lore}%":
send "%{_slot}% §7- §r{ecc::%loop-value%::loc}"
add 1 to {_slot}
# make gui slot 8 with oak door item named "Close":
# close player's inventory
open last gui to player
For your question, loop-index
doesn't work because i use offline player name
instead.
ecc::weber_le_pecheur::loc, string, 800A726567696F6E74657374
Complete debug log:
[20:37:17] [Server thread/INFO]: [Skript] create gui [20:37:17] [Server thread/INFO]: [Skript] loop [WeBer_Le_Pecheur] [20:37:17] [Server thread/INFO]: [Skript] -make a gui slot 0 of gui with lore [20:37:17] [Server thread/INFO]: [Skript] add [[long:1]] to 1 [20:37:17] [Server thread/INFO]: [Skript] -loop [WeBer_Le_Pecheur] [20:37:17] [Server thread/INFO]: [Skript] $ end section [20:37:17] [Server thread/INFO]: [Skript] open last gui to the player [20:37:17] [Server thread/INFO]: [Skript] # chest took 2.326413 milliseconds [20:37:19] [Server thread/INFO]: [Skript] make a gui slot 0 of gui with lore [20:37:19] [Server thread/INFO]: [Skript] send "%0% §7- §r{ecc::%< none >%::loc}" to [player:WeBer_Le_Pecheur [location:(world:176.2135620981712,123.0,258.1550533327291|yaw=-16.019093/pitch=12.650196)]]
[20:37:19] [Server thread/INFO]: [Skript] == org.bukkit.event.inventory.InventoryClickEvent == [20:37:19] [Server thread/INFO]: [Skript] -x- was cancelled
After your edit post, i tried loop-index but its the same result.
What? How can
send "%{_slot}% §7- §r{ecc::%loop-value%::loc}"
return
send "%0% §7- §r{ecc::%< none >%::loc}" to [player:WeBer_Le_Pecheur [location:(world:176.2135620981712,123.0,258.1550533327291|yaw=-16.019093/pitch=12.650196)]]
? And the "complete debug log".... Are you sure about what are you doing? Please try it with Skript 2.2-dev29 and Spigot 1.12
don't you want loop-index not loop-value
Skript: config.sk - line 109 - verbosity : debug
For debug log you prefer this ? https://pastebin.com/raw/Ta6G33dA I will go test with dev29
Edit: Same results with dev29 and 1.12.0
@Pikachu920 I tried loop-index and loop-value, the two gives me the same result
:slightly_frowning_face: Disable verbosity (set it to normal) and install dev29 and 1.12, and use this code:
set {_slot} to 0
create a gui with virtual chest with 1 rows named "Ecc avr var":
loop {ecc::*}:
send "&a{ecc::%loop-value%::loc}"
send "&c{ecc::%loop-index%::loc}"
make gui slot {_slot} with player's skull named "%{ecc::%loop-value%::title}%" with lore "&r ||%{ecc::%loop-value%::lore}%":
send "%{_slot}% §7- §r%{ecc::%loop-value%::loc}%"
add 1 to {_slot}
open last gui to player```
@Blueyescat I disable verbosity, paste your code and this :
Then, looks like there is no any problem. {ecc::weber_le_pecheur::loc}
variable is not set.
variable is set, since the beginning.
Run this code and type the command :thinking:
Sorry, try this: https://hastebin.com/eguwugoyig.vbs
Doesn't it send the "0 - <none>"
message after you click on item in gui?
Yes, of course
Before
After click (and close gui manually)
Then try this: https://hastebin.com/ecihoworiw.vbs
Error with :
send "&a{ecc::%loop-value%::loc}" to gui-player
[22:03:38] [Server thread/ERROR]: You can't use 'gui-player' outside of a 'make gui', 'format gui slot' or 'run when close' section. (test.sk, line 36: send "&a{ecc::%loop-value%::loc}" to gui-player') [22:03:38] [Server thread/ERROR]: You can't use 'gui-player' outside of a 'make gui', 'format gui slot' or 'run when close' section. (test.sk, line 37: send "&c{ecc::%loop-index%::loc}" to gui-player')
correct in :
send "&a{ecc::%loop-value%::loc}" to player
and results :
Interesting, then looks like a TuSKe problem... These codes are the same, but returns none in create gui part. (The two lines that gives error aren't important) We should wait @Tuke-Nuke...
All right, thank you for your time @Blueyescat despite the difficulties to communicate my problem at the beginning ^^
Hey, it is easy fixable by just seting a variable before make gui slot
effect
loop {eec::*}:
set {_value} to loop-value
set {_index} to loop-index
make gui slot {_slot} with player's skul....:
send "%{_index}%: %{_value}%"
Why it happens?
Well, because this current system is not properly supported by Skript, so there is some workaround to make it work. But, in Skript, loops works a bit different, the expression loop-index/value
only store the value while it is looping, so in the end of that, it will have the last loop index/value because when the gui action is executed, the loop is already finished.
So it is more a Skript "limitation", but it can be easily fixed with variables.
Let me know if afther that, it still not working. Thank's for reporting it.
@Tuke-Nuke it works as I wanted. Thanks you very much !
Shouldn’t this be closed @Tuke-Nuke ?
@HYPExMon5ter Sure, thank's.
Hi, i have a litte problem with that :
He returns a < none > for the variable %{ecc::%loop-value%::loc}%
Spigot 1.12.2 Skript 2.2-dev31c TuSke 1.8.2-dev6