trigger:
send "&7Here's the entire queue:"
loop indexes of {queue::*}:
loop {queue::%loop-value%::*}:
send "&7- &f%loop-value parsed as integer%"```
how to make this work, i want the command /listqueue to show everything in {queue::*}
basically i want all the indices to show when doing the command not just listqueue, ive alr figured that part out but idk how to send it as a message
#Help
1 messages · Page 1 of 1 (latest)
loop-index
wait fr?
no need for the outer loop
oh wait what's going on w/ that variable
is queue a list of lists?
yes
ok yeah then outer loop is fine
theres is queue::secondqueue::thirdqueue
why
i need it
also
whats an outer loop? i assume its loop indexes of {queue::*}:?
im very rusty and sleepy
just use loop-value-1 for the first index, loop-index for the second index, loop-value-2 for the value
yes outer loop is the one on the outside
can you explain exactly what these queues are meant to do
because this is a really unwieldy way to structure lists
to help me experiment and learn more about list vars
im very new
im trying out shit
seeing how it wokkrs
they can be useful sometimes
doing {var::something::list::*} is great and fine
but trying to loop everything all the time is not so great and fine
ik i just wanted to see how i could loop the whole thing without needing multiple commands
tysm
np
wait
it dont wokr
trigger:
send "&7Here's the entire queue:"
loop indexes of {queue::*}:
loop {queue::%loop-value%::*}:
send "&7- &f%loop-index parsed as integer%"```
it says 1
when i do listqueue
read
also stop parsing as integer
there's no point
mhm
again, what are you doing with these queues
i want it so that one command can list the whole variable
wdym
trigger:
if {queue::*} contains player's uuid:
remove player's uuid from {queue::*}
send "&7You've left the queue."
stop
else:
add player's uuid to {queue::*}
send "&7You've joined the queue."
command queuesecond:
trigger:
if {queue::secondqueue::*} contains player's uuid:
remove player's uuid from {queue::secondqueue::*}
send "&7You've left the queue."
stop
else:
add player's uuid to {queue::secondqueue::*}
send "&7You've joined the queue."```
theyre pointless and do nothing i just wanna learn list variables and im experimenting and reading tutorials and stuff
ok yeah i highly advise against that
why
because you're putting player's uuids and then index secondqueue in the same list
so what should i do
it'll look like
1 - player1
2 - player2
3 - player3
secondqueue - <none>
you should just do {secondqueue::*}
OR
{queue::1::*}
{queue::2::*}
{queue::3::*}
this isn't relevant to displaying yet
this is just talking about how to structure lists
however, it would make displaying easier
here you have 3 different queues, they don't conflict, and it's easy to add more
can u have one command that displays everyone in those 3 queues
yep!
how?
also, what differnece does it make the numbers are just another way of saying secondqueue
because they're now all on their own
previously they were on the same layer as player uuids
theyre in the same list
trigger:
if {queue::*} contains player's uuid:
remove player's uuid from {queue::*}
send "&7You've left the queue."
stop
else:
add player's uuid to {queue::*}
send "&7You've joined the queue."
command queuesecond:
trigger:
if {queue::secondqueue::*} contains player's uuid:
remove player's uuid from {queue::secondqueue::*}
send "&7You've left the queue."
stop
else:
add player's uuid to {queue::secondqueue::*}
send "&7You've joined the queue."
command listqueue:
trigger:
send "&7Here's the entire queue:"
loop indexes of {queue::*}:
loop {queue::%loop-value%::*}:
send "&7- &f%loop-index parsed as offlineplayer%"``` this was my full thing before
command /list:
trigger:
# get each queue (1, 2, 3, and so on)
loop indices of {queue::*}:
send "List ##%loop-value%: %{queue::%loop-value%::*}%"
command queue <integer>:
trigger:
# here we can just use arg-1 because we structured our list well.
if {queue::%arg-1%::*} contains player's uuid:
remove player's uuid from {queue::%arg-1%::*}
send "&7You've left the queue."
stop
else:
add player's uuid to {queue::%arg-1%::*}
send "&7You've joined the queue."
lemme test thsi out
edited it slightly
this isnt relevant to list vars
but
where can i find expressions like %health%%max health% these type of stuff
Now we have a simple list
{queue::*}, which has the indices of all the various queues we made.
For Queue 1, we have {queue::1::*}, which is all the list vars in queue 1.
Same w/ Queue 2 and {queue::2::*}, and so on.
Much simpler.
ima just delte queue
exactly
well duh
you're adding the player's uuid to the list
so you're getting the uuid back out
how can it be a players name
tyvm
one last thing, ik this stupid, but i never really understood what stop does
stop
i couldnt find it on docs
it stops things
i dont rly get it
@mystic epoch
trigger:
# get each queue (1, 2, 3, and so on)
loop indices of {queue::*}:
send "List ##%loop-value%: %{queue::%loop-value%::*}%"
command /queue <integer>:
trigger:
# here we can just use arg-1 because we structured our list well.
if arg-1 is smaller than or equal to 10:
if arg-1 is greater than or equal to 1:
if {queue::%arg-1%::*} contains player:
remove player from {queue::%arg-1%::*}
send "&7You've left the queue."
stop
else:
add player to {queue::%arg-1%::*}
send "&7You've joined the queue."
else:
send "You can only join the queues 1-10"
else:
send "You can only join the queues 1-10"``` Why is putting %loop-value% necessary in %{queue::%loop-value%::*}%
is it because the loop value is the indice, so loop value would replace like {queue::1::*} so instead of putting that ten times, the loop value would just put it accordingly to the loop indices of {queue::*}:?