hyhy123455 0 Opublikowano 2 marca 2021 Udostępnij Opublikowano 2 marca 2021 dało by połączyć ten skrypt z mysql tak zeby co jakiś czas lub zmianę zmiennej tokeny sie zapisywało a gdy gracz wejdzie to wczytywały Wstawiam kod w code.skript.pl Notatka dodana przez Glicz Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 Kormic 1925 Opublikowano 2 marca 2021 Udostępnij Opublikowano 2 marca 2021 6 minut temu, hyhy123455 napisał: dało by połączyć ten skrypt z mysql tak zeby co jakiś czas lub zmianę zmiennej tokeny sie zapisywało a gdy gracz wejdzie to wczytywały Tak, da się. Możesz to połączyć w pliku konfiguracyjnym Skripta. Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 hyhy123455 0 Opublikowano 2 marca 2021 Autor Udostępnij Opublikowano 2 marca 2021 1 minutę temu, Kormic napisał: Tak, da się. Możesz to połączyć w pliku konfiguracyjnym Skripta. pomożesz? Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 Kormic 1925 Opublikowano 2 marca 2021 Udostępnij Opublikowano 2 marca 2021 Teraz, hyhy123455 napisał: pomożesz? A w czym mam pomóc? Na forum ludzie mieli podobny problem. Poszukaj sobie jak to rozwiązywali. Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 hyhy123455 0 Opublikowano 2 marca 2021 Autor Udostępnij Opublikowano 2 marca 2021 7 minut temu, Kormic napisał: A w czym mam pomóc? Na forum ludzie mieli podobny problem. Poszukaj sobie jak to rozwiązywali. znalazłem ale nwm jak to sie zapisuje czy to samo sie zapisuje Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 Kormic 1925 Opublikowano 2 marca 2021 Udostępnij Opublikowano 2 marca 2021 (edytowane) 8 minut temu, hyhy123455 napisał: znalazłem ale nwm jak to sie zapisuje czy to samo sie zapisuje Jeżeli mamy podobnego Skripta, od 221. linijki w configu masz przykład oraz opis jak należy skonfigurować MySQL w Skript'cie. Jak nie masz, proszę. Spoiler # == MySQL configuration == host: localhost# Where the database server is located at, e.g. 'example.com', 'localhost', or '192.168.1.100' port: 3306# 3306 is MySQL's default port, i.e. you likely won't need to change this value user: root password: pass database: skript# The database to use, the table will be created in this database. table: variables21# The name of the table to create. 'variables21' is the default name, if this was to be omitted. # (If the table exists but is defined differently that how Skript expects it to be you'll get errors and no variables will be saved and/or loaded) # == SQLite/CSV configuration == file: ./plugins/Skript/variables.db # Where to save the variables to. For a CSV file, the file extension '.csv' is recommended, but not required, but SQLite database files must end in '.db' (SQLibrary forces this). # The file path can either be absolute (e.g. 'C:\whatever\...' [Windows] or '/usr/whatever/...' [Unix]), or relative to the server directory (e.g. './plugins/Skript/...'). #table: variables21 # The name of the table to create. 'variables21' is the default name, if this was to be omitted. # (If the table exists but is defined differently that how Skript expects it to be you'll get errors and no variables will be saved and/or loaded) # This is generally not required as the the .db file will only be used by Skript, unless you want to split different variables into different tables backup interval: 2 hours # Creates a backup of the file every so often. This can be useful if you ever want to revert variables to an older state. # Variables are saved constantly no matter what is set here, thus a server crash will never make you loose any variables. # Set this to 0 to disable this feature. EDIT: Jeszcze masz jedną, ważną informację na początku sekcji konfigurowania baz danych (o pluginie SQLibrary). Edytowane 2 marca 2021 przez Kormic Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 hyhy123455 0 Opublikowano 2 marca 2021 Autor Udostępnij Opublikowano 2 marca 2021 12 minut temu, Kormic napisał: Jeżeli mamy podobnego Skripta, od 221. linijki w configu masz przykład oraz opis jak należy skonfigurować MySQL w Skript'cie. Jak nie masz, proszę. Pokaż ukrytą zawartość # == MySQL configuration == host: localhost# Where the database server is located at, e.g. 'example.com', 'localhost', or '192.168.1.100' port: 3306# 3306 is MySQL's default port, i.e. you likely won't need to change this value user: root password: pass database: skript# The database to use, the table will be created in this database. table: variables21# The name of the table to create. 'variables21' is the default name, if this was to be omitted. # (If the table exists but is defined differently that how Skript expects it to be you'll get errors and no variables will be saved and/or loaded) # == SQLite/CSV configuration == file: ./plugins/Skript/variables.db # Where to save the variables to. For a CSV file, the file extension '.csv' is recommended, but not required, but SQLite database files must end in '.db' (SQLibrary forces this). # The file path can either be absolute (e.g. 'C:\whatever\...' [Windows] or '/usr/whatever/...' [Unix]), or relative to the server directory (e.g. './plugins/Skript/...'). #table: variables21 # The name of the table to create. 'variables21' is the default name, if this was to be omitted. # (If the table exists but is defined differently that how Skript expects it to be you'll get errors and no variables will be saved and/or loaded) # This is generally not required as the the .db file will only be used by Skript, unless you want to split different variables into different tables backup interval: 2 hours # Creates a backup of the file every so often. This can be useful if you ever want to revert variables to an older state. # Variables are saved constantly no matter what is set here, thus a server crash will never make you loose any variables. # Set this to 0 to disable this feature. EDIT: Jeszcze masz jedną, ważną informację na początku sekcji konfigurowania baz danych (o pluginie SQLibrary). czyli musze mieć ten plugin SQLibrary aby działało? Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 Kormic 1925 Opublikowano 2 marca 2021 Udostępnij Opublikowano 2 marca 2021 Teraz, hyhy123455 napisał: czyli musze mieć ten plugin SQLibrary aby działało? Jeżeli chcesz podłączyć bazę danych (a chcesz), to tak. Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 hyhy123455 0 Opublikowano 2 marca 2021 Autor Udostępnij Opublikowano 2 marca 2021 7 minut temu, Kormic napisał: Jeżeli chcesz podłączyć bazę danych (a chcesz), to tak. plugin wgrany , config chyba dobrze zrobiony co teraz Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 Kormic 1925 Opublikowano 2 marca 2021 Udostępnij Opublikowano 2 marca 2021 14 minut temu, hyhy123455 napisał: plugin wgrany , config chyba dobrze zrobiony co teraz No i masz napisane przy konfiguracji jaki jest wzór dla zmiennych zapisywanych w tej twojej bazie danych. 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 Dałem ci strzałkę, abyś wiedział o czym mówię. Możesz sobie to oczywiście zmienić. Musi zostać jedynie ta kropka i gwiazdka na końcu nazwy. Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 hyhy123455 0 Opublikowano 2 marca 2021 Autor Udostępnij Opublikowano 2 marca 2021 4 minuty temu, Kormic napisał: No i masz napisane przy konfiguracji jaki jest wzór dla zmiennych zapisywanych w tej twojej bazie danych. 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 Dałem ci strzałkę, abyś wiedział o czym mówię. Możesz sobie to oczywiście zmienić. Musi zostać jedynie ta kropka i gwiazdka na końcu nazwy. np pattern: tokeny_.* ? Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 Kormic 1925 Opublikowano 2 marca 2021 Udostępnij Opublikowano 2 marca 2021 2 minuty temu, hyhy123455 napisał: np pattern: tokeny_.* ? Jak najbardziej, może tak być. Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 hyhy123455 0 Opublikowano 2 marca 2021 Autor Udostępnij Opublikowano 2 marca 2021 10 minut temu, Kormic napisał: No i masz napisane przy konfiguracji jaki jest wzór dla zmiennych zapisywanych w tej twojej bazie danych. 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 Dałem ci strzałkę, abyś wiedział o czym mówię. Możesz sobie to oczywiście zmienić. Musi zostać jedynie ta kropka i gwiazdka na końcu nazwy. a gdy jest monitor changes: true monitor interval: 20 seconds to co tyle bedzie sie zapisywać Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 hyhy123455 0 Opublikowano 2 marca 2021 Autor Udostępnij Opublikowano 2 marca 2021 no i jak załadować zmienną Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 Kormic 1925 Opublikowano 2 marca 2021 Udostępnij Opublikowano 2 marca 2021 6 minut temu, hyhy123455 napisał: a gdy jest monitor changes: true monitor interval: 20 seconds to co tyle bedzie sie zapisywać Nie, nie. To jest od monitorowania zmian w bazie danych. W tym przypadku będzie to sprawdzane co 20 sekund. Jak chcesz backupy sobie robić, możesz albo spróbować tam dopisać pod 'table' wartość 'backup interval: 2 hours', albo zrobić sobie to jakimś zewnętrznym programem. Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 hyhy123455 0 Opublikowano 2 marca 2021 Autor Udostępnij Opublikowano 2 marca 2021 2 minuty temu, Kormic napisał: Nie, nie. To jest od monitorowania zmian w bazie danych. W tym przypadku będzie to sprawdzane co 20 sekund. Jak chcesz backupy sobie robić, możesz albo spróbować tam dopisać pod 'table' wartość 'backup interval: 2 hours', albo zrobić sobie to jakimś zewnętrznym programem. no ok to jak teraz zmienną zapisać w MySQL i jak ją wczytać gdy gracz wejdzie na server Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 Kormic 1925 Opublikowano 2 marca 2021 Udostępnij Opublikowano 2 marca 2021 (edytowane) 40 minut temu, hyhy123455 napisał: no ok to jak teraz zmienną zapisać w MySQL i jak ją wczytać gdy gracz wejdzie na server Masz napisane tam gdzie zaznaczyłem ci strzałką. Czyli każda zmienna, która będzie się zaczynać w ten sposób, będzie zmienną zapisywaną w tej bazie MySQL. EDIT: Co do wczytywania coinów, robisz to w 'on join'. # Przykład: pattern: test_.* on load: set {test_variable} to true Edytowane 2 marca 2021 przez Kormic Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 hyhy123455 0 Opublikowano 2 marca 2021 Autor Udostępnij Opublikowano 2 marca 2021 2 minuty temu, Kormic napisał: Masz napisane tam gdzie zaznaczyłem ci strzałką. Czyli każda zmienna, która będzie się zaczynać w ten sposób, będzie zmienną zapisywaną w tej bazie MySQL. tylko ze w MySQL nic sie nie tworzy Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 Kormic 1925 Opublikowano 2 marca 2021 Udostępnij Opublikowano 2 marca 2021 Teraz, hyhy123455 napisał: tylko ze w MySQL nic sie nie tworzy No to źle coś zapisałeś. Spróbuj od nowa. Podążaj za wskazówkami, które są zapisane w configu, a będziesz w stanie to zrobić. Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 hyhy123455 0 Opublikowano 2 marca 2021 Autor Udostępnij Opublikowano 2 marca 2021 9 minut temu, Kormic napisał: No to źle coś zapisałeś. Spróbuj od nowa. Podążaj za wskazówkami, które są zapisane w configu, a będziesz w stanie to zrobić. database 1: # An example database to describe all possible options. type: MySQL # The type of this database. Allowed values are 'CSV', 'SQLite', 'MySQL' and 'disabled'. # CSV uses a text file to store the variables, while SQLite and MySQL use databases, and 'disabled' makes Skript ignore the database as if it wasn't defined at all. pattern: tokeny_.* # Defines which variables to save in this database. # This pattern uses Regex syntax, e.g. use 'db_.*' (without the quotes) to store all variables prefixed with 'db_' in this database, # or use '.*' (the default value) to store all variables here (recommended for the last database in this list, as otherwise some variables might not be saved). # Please note that variables are only stored in one database, and databases are checked from top to bottom, # e.g. if a variable matches the topmost database's pattern it will be saved there and nowhere else. # BTW: Patterns are checked in a separate thread, i.e. your server likely won't run slower when using complicated patterns. monitor changes: true monitor interval: 15 seconds # If 'monitor changes' is set to true, variables will repeatedly be checked for updates in the database (in intervals set in 'monitor interval'). # ! Please note that you should set 'pattern', 'monitor changes' and 'monitor interval' to the same values on all servers that access the same database! # == MySQL configuration == host: mysql.titanaxe.com# Where the database server is located at, e.g. 'example.com', 'localhost', or '192.168.1.100' port: 3306 # 3306 is MySQL's default port, i.e. you likely won't need to change this value user: srv141303 password: tutaj haslo database: skript # The database to use, the table will be created in this database. table: variables21# The name of the table to create. 'variables21' is the default name, if this was to be omitted. # (If the table exists but is defined differently that how Skript expects it to be you'll get errors and no variables will be saved and/or loaded) # == SQLite/CSV configuration == file: ./plugins/Skript/variables.db # Where to save the variables to. For a CSV file, the file extension '.csv' is recommended, but not required, but SQLite database files must end in '.db' (SQLibrary forces this). # The file path can either be absolute (e.g. 'C:\whatever\...' [Windows] or '/usr/whatever/...' [Unix]), or relative to the server directory (e.g. './plugins/Skript/...'). #table: variables21 # The name of the table to create. 'variables21' is the default name, if this was to be omitted. # (If the table exists but is defined differently that how Skript expects it to be you'll get errors and no variables will be saved and/or loaded) # This is generally not required as the the .db file will only be used by Skript, unless you want to split different variables into different tables backup interval: 2 hours # Creates a backup of the file every so often. This can be useful if you ever want to revert variables to an older state. # Variables are saved constantly no matter what is set here, thus a server crash will never make you loose any variables. # Set this to 0 to disable this feature. 10 razy to robiłem i nie działa Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 hyhy123455 0 Opublikowano 2 marca 2021 Autor Udostępnij Opublikowano 2 marca 2021 25 minut temu, Kormic napisał: No to źle coś zapisałeś. Spróbuj od nowa. Podążaj za wskazówkami, które są zapisane w configu, a będziesz w stanie to zrobić. no wez pomóż to zrobić XD bo ja jakiś ułomny i nie potrafe Cytuj Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Pytanie
hyhy123455 0
dało by połączyć ten skrypt z mysql tak zeby co jakiś czas lub zmianę zmiennej tokeny sie zapisywało a gdy gracz wejdzie to wczytywały
Wstawiam kod w code.skript.pl
Notatka dodana przez Glicz
Odnośnik do komentarza
Udostępnij na innych stronach
28 odpowiedzi na to pytanie
Rekomendowane odpowiedzi
Dołącz do dyskusji
Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.