Hello, I was thinking of using skript to make a quick feature on my server which saves a variable for every single user who joins the server. Essentially, I'm aiming to make a script wherein it saves how many times every player uses a certain command.
Now, I realize this is fairly easy to do, with something similar to:
However, my question was if this would be feasible to do, as I fear that it would not be very scalable, in that it would start causing some problems once a lot of players join the server. With this in mind, would this be something feasible to do, and if not, are there any alternatives?
I was also thinking it would be much better if this system could self-moderate itself, so-to-speak, by removing data from inactive players on server startup. How would one loop through a potentially 1000+ size array and delete inactive data efficiently? I was considering trying it out myself, as I'm fairly certain there's a server start event, but I'm unsure if there's a way to check for inactivity, and the docs seem to be down right now.
Thank you so much for your time.
EDIT: I put this in off-topic since it's not really to do with skript moreso than it is to do with it's performance, but looking further I believe it might be more suited for the help subforum, oops
Now, I realize this is fairly easy to do, with something similar to:
code_language.skript:
on command:
"%command%" is "hello!":
if {counter::%uuid%} exists:
set {counter::%uuid%} to {counter::%uuid%} + 1
else:
set {counter::%uuid%} to 1
However, my question was if this would be feasible to do, as I fear that it would not be very scalable, in that it would start causing some problems once a lot of players join the server. With this in mind, would this be something feasible to do, and if not, are there any alternatives?
I was also thinking it would be much better if this system could self-moderate itself, so-to-speak, by removing data from inactive players on server startup. How would one loop through a potentially 1000+ size array and delete inactive data efficiently? I was considering trying it out myself, as I'm fairly certain there's a server start event, but I'm unsure if there's a way to check for inactivity, and the docs seem to be down right now.
Thank you so much for your time.
EDIT: I put this in off-topic since it's not really to do with skript moreso than it is to do with it's performance, but looking further I believe it might be more suited for the help subforum, oops
Last edited: