#Help

1 messages · Page 1 of 1 (latest)

wide otter
#
    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
mystic epoch
#

loop-index

wide otter
#

wait fr?

mystic epoch
#

no need for the outer loop

#

oh wait what's going on w/ that variable

#

is queue a list of lists?

wide otter
#

yes

mystic epoch
#

ok yeah then outer loop is fine

wide otter
#

theres is queue::secondqueue::thirdqueue

mystic epoch
#

why

wide otter
#

i need it

mystic epoch
#

i mean ok

#

but yeah you're fine

wide otter
#

also

#

whats an outer loop? i assume its loop indexes of {queue::*}:?

#

im very rusty and sleepy

mystic epoch
#

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

wide otter
#

and also

#

{queue::seconqueue::*}

#

is secondqueue an indice

#

im learning list vars

mystic epoch
#

can you explain exactly what these queues are meant to do

#

because this is a really unwieldy way to structure lists

wide otter
#

im very new

#

im trying out shit

#

seeing how it wokkrs

mystic epoch
#

ok i would very much advise against lists in lists

#

skript isn't great with that

wide otter
mystic epoch
#

doing {var::something::list::*} is great and fine
but trying to loop everything all the time is not so great and fine

wide otter
#

ik i just wanted to see how i could loop the whole thing without needing multiple commands

#

tysm

mystic epoch
#

np

wide otter
#

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

mystic epoch
#

also stop parsing as integer

#

there's no point

#

mhm

wide otter
#

i didnt mean as integer

#

i ment as offline player

mystic epoch
#

again, what are you doing with these queues

wide otter
#

i want it so that one command can list the whole variable

mystic epoch
#

i'm not asking about the command

#

i'm asking about the queues themselves

wide otter
#

wdym

mystic epoch
#

what's their point

#

what are they storing

#

what are they used for

wide otter
#
    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

mystic epoch
#

ok yeah i highly advise against that

wide otter
#

why

mystic epoch
#

because you're putting player's uuids and then index secondqueue in the same list

wide otter
#

so what should i do

mystic epoch
#

it'll look like

1 - player1
2 - player2
3 - player3
secondqueue - <none>
#

you should just do {secondqueue::*}

#

OR

#
{queue::1::*}
{queue::2::*}
{queue::3::*}
wide otter
#

but would this display the whole thing?

#

like everyone in queue and second queue

mystic epoch
#

this isn't relevant to displaying yet

#

this is just talking about how to structure lists

#

however, it would make displaying easier

mystic epoch
wide otter
mystic epoch
#

yep!

wide otter
#

how?

#

also, what differnece does it make the numbers are just another way of saying secondqueue

mystic epoch
#

because they're now all on their own

#

previously they were on the same layer as player uuids

wide otter
#

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
mystic epoch
#
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."
wide otter
#

lemme test thsi out

mystic epoch
#

edited it slightly

wide otter
#

this isnt relevant to list vars

#

but

#

where can i find expressions like %health%%max health% these type of stuff

mystic epoch
#

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.

wide otter
#

i looked it there before i coudlve swornd i didnt find them, anyways thanks

mystic epoch
#

yeah that's cuz you still have the bad list setup from before

#

clear your queues

wide otter
#

ima just delte queue

mystic epoch
#

exactly

wide otter
#

still shows the uuid

#

rather than the name

mystic epoch
#

well duh

#

you're adding the player's uuid to the list

#

so you're getting the uuid back out

wide otter
#

how can it be a players name

mystic epoch
#

just add player

#

instead of player's uuid

wide otter
#

tyvm

#

one last thing, ik this stupid, but i never really understood what stop does

#

stop

#

i couldnt find it on docs

mystic epoch
#

it stops things

wide otter
#

i dont rly get it

mystic epoch
#

it either stops all execution

#

or just a few of the loops/conditionals

wide otter
#

ok ty

#

very much appreciated

wide otter
#

@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::*}:?

mystic epoch
#

use \* to avoid italics in your message

#

but yes, loop-value is the indices there, so you can think of it as being 1, or 2, or 3 as needed