Saving data

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

inavir

Member
May 1, 2017
10
0
0
31
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:
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 :emoji_flushed:
 
Last edited: