Solved Saving data to mysql for certain variables

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

MrGametop1

Member
Mar 10, 2017
36
0
6
24
Hello, i know you know alot about skripting, so here is my question.
Note : Thanks for all the help already

In the config it says this:
# #
MySQL example:
# A MySQL database example, with options unrelated to MySQL removed.

type: disabled# change to line below to enable this database
# type: MySQL

pattern: synced_.*# this pattern will save all variables that start with 'synced_' in this MySQL database.

host: localhost
port: 3306
user: root
password: pass
database: skript
table: variables21

monitor changes: true
monitor interval: 20 seconds
# #

So if i enable MySQL
Every variable named
{synced_*}
Will be saved to the MySQL database, and everything else will not be saved to the mysql put save to the CSV
[doublepost=1583468372,1581566072][/doublepost]Can somebody help me out with this?
 
Hello, i know you know alot about skripting, so here is my question.
Note : Thanks for all the help already

In the config it says this:
# #
MySQL example:
# A MySQL database example, with options unrelated to MySQL removed.

type: disabled# change to line below to enable this database
# type: MySQL

pattern: synced_.*# this pattern will save all variables that start with 'synced_' in this MySQL database.

host: localhost
port: 3306
user: root
password: pass
database: skript
table: variables21

monitor changes: true
monitor interval: 20 seconds
# #

So if i enable MySQL
Every variable named
{synced_*}
Will be saved to the MySQL database, and everything else will not be saved to the mysql put save to the CSV
[doublepost=1583468372,1581566072][/doublepost]Can somebody help me out with this?
Every variable that starts with synced_, so {synced_test}, {synced_var::%player%} etc will be saved in the MySQL database, the other variables will saved to the csv
 
Every variable that starts with synced_, so {synced_test}, {synced_var::%player%} etc will be saved in the MySQL database, the other variables will saved to the csv

Thanks for the help :emoji_slight_smile:)

Can there be more servers linked to the same database? With the same variables?
 
Thanks for the help :emoji_slight_smile:)

Can there be more servers linked to the same database? With the same variables?
Not really, Skript doesn't update the database for every variable changed, it does so with a constant interval, and Skript also saved all variables in memory, it doesn't read from the database every 20 seconds, it only saved them (I think). The variables are read from the database when the server starts.
 
Not really, Skript doesn't update the database for every variable changed, it does so with a constant interval, and Skript also saved all variables in memory, it doesn't read from the database every 20 seconds, it only saved them (I think). The variables are read from the database when the server starts.

This is not entirely true.

Code:
# Databases to store variables in. These can either be used as a simple one-server-storage
    # where variables are written constantly but only read at server start,
    # or as a connection between multiple servers by monitoring the database(s) for changes.

So it does work like u say except if u enable monitor chances on both servers put the both servers on the same interval and put the pattern the same then it does check for chances and if so update them.
 
This is not entirely true.

Code:
# Databases to store variables in. These can either be used as a simple one-server-storage
    # where variables are written constantly but only read at server start,
    # or as a connection between multiple servers by monitoring the database(s) for changes.

So it does work like u say except if u enable monitor chances on both servers put the both servers on the same interval and put the pattern the same then it does check for chances and if so update them.

So the monitor interval should be as low as possible so people cant abuse things?

For example a global money system
 
Status
Not open for further replies.