#loop 'continue'
1 messages · Page 1 of 1 (latest)
Do you know what continue does?
should skip to the next loop ?
mhmm
am I dumb haha ?
doesn't continue do that ?
also it seems to work using continue loop - but why ?
honestly I think your formatting is distracting--try looking at this```effect open GUI %object% value %object% of %object%:
trigger:
loop file of "plugins/Skript/scripts/File.json":
if loop-value contains "Menu":
add loop-value to {_N::*}
continue
if loop-value contains "Name":
set {_T} to "_Name"
continue
if loop-value contains "Lore":
set {_T} to "_Lore"
continue
if loop-value contains "NBTs":
set {_T} to "_NBTs"
continue
# Continue
if loop-value contains "-":
add loop-value to {%{_T}%::*}
# Results
loop {_N::*}:
broadcast loop-value```
same result
yes, thats your code--i just cleaned it up a bit so its easier to read
oh yea, sorry about that - but about the continue thing ? why doesn't it work
well, which parts of your code would be reached if a continue is hit? which parts wouldnt be reached?
This part
add loop-value to {%{_T}%::*}```
But it doesn't, also it works with using continue loop but not with continue ? what's the difference
walk me through what is supposed to happen
Trigger:
delete {Name::*}
delete {Lore::*}
delete {NBTs::*}
loop file of "plugins/Skript/scripts/File.json":
IF loop-value contains "Name:":
set {_T} to "Name"
continue loop
IF loop-value contains "Lore:":
set {_T} to "Lore"
continue loop
IF loop-value contains "NBTs:":
set {_T} to "NBTs"
continue loop
else:
IF loop-value contains "-":
add loop-value to {%{_T}%::*}
# </> Results
Print ""
Print "Name"
Print ""
loop {Name::*}:
Print loop-value
# set {} to parsed loop-value by "Name"
Print ""
Print "Lore"
Print ""
loop {Lore::*}:
Print loop-value
# set {} to parsed loop-value by "Lore"
Print ""
Print "NBTs"
Print ""
loop {NBTs::*}:
Print loop-value
# set {} to parsed loop-value by "NBTs"```
I updated the code a bit, now it works - I was using _ as the T variable and when it goes out of scope of the loop it's no longer valid and when looping the list at the end, it was empty
all tho again the keyword continue doesn't seem to work nothing happens, but continue loop works ?
also is my code that hard to read ? I feel like it's easier now - Not sure why my brain likes it that way ....
- You have too many empty lines. The ones directly under opening a section (like under
Trigger:) are especially useless IMO - You have capitalisation for the start of some lines--but only some. They should all be lowercase
- Skript uses
broadcast, notPrint - what the heck is
parsed loop-value by "..."? - you use
%object%thrice, instead of specifying what you are working with
oh haha, the print are an custom broadcast I made, the parsed thing not implemented yet but some sort of abstraction to get the right values out of a string. The object are just placeholders for now, I was too lazy to create an command to test it..
why would you make a custom effect that just redirects to an already existing skript effect
it's not meant to use in the effect, I just had it bind to an command already so I was just testing the code with it