Create Mysql database skript-db

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

    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.

MateoxPL

Active Member
Jan 27, 2018
116
0
16
code_language.skript:
script options:
    $ init com.mysql.jdbc.Driver
    $ db url jdbc:mysql://local:3306/base
    $ db username ***
    $ db password ***

options:
        table_prefix: stats_
       
On script load:
    update "CREATE TABLE IF NOT EXISTS `{@table_prefix}Player` (`Gracz` varchar(255),`Zabojstwa` varchar(255),`Zgony` varchar(255),`Poziom RPG` varchar(255),`Progres RPG` varchar(255),`Klasa` varchar(255),`Poziom Klasy` varchar(255),`Ranga` varchar(255),`Kiedy Dolaczyl` varchar(255))"

   
   
   
on join:  
    if {zgony.ilosc::%player%} is not set:
        set {zgony.ilosc::%player%} to 0
        set {zabojstwa.ilosc::%player%} to 0  
        update "INSERT INTO `{@table_prefix}Player` (`Gracz`, `Zabojstwa`, `Zgony`, `Poziom RPG`, `Progres RPG`, `Klasa`, `Poziom Klasy`, `Ranga`, `Kiedy Dolaczyl`) VALUES ('%player%', '0', '0', '0', '0', '0', '0', '%coloured player's prefix%', '%now%')"      
every 5 second:
    loop all players:
        update "UPDATE `{@table_prefix}Player` SET `{@table_prefix}Player`.`Poziom RPG` = '%{lv::%loop-player%}%' WHERE `{@table_prefix}Player`.`Gracz` = '%loop-player%'"
        update "UPDATE `{@table_prefix}Player` SET `{@table_prefix}Player`.`Klasa` = '%{RPGSkript.klasachat.%loop-player%}%' WHERE `{@table_prefix}Player`.`Gracz` = '%loop-player%'"
        update "UPDATE `{@table_prefix}Player` SET `{@table_prefix}Player`.`Poziom Klasy` = '%{Klasa.Poziom.Exp.%loop-player%}%' WHERE `{@table_prefix}Player`.`Gracz` = '%loop-player%'"
        update "UPDATE `{@table_prefix}Player` SET `{@table_prefix}Player`.`Progres RPG` = '%{xp::%loop-player%}%/%{mxp::%loop-player%}%' WHERE `{@table_prefix}Player`.`Gracz` = '%loop-player%'"
        update "UPDATE `{@table_prefix}Player` SET `{@table_prefix}Player`.`Zabojstwa` = '%{zabojstwa.ilosc::%loop-player%}%' WHERE `{@table_prefix}Player`.`Gracz` = '%loop-player%'"
        update "UPDATE `{@table_prefix}Player` SET `{@table_prefix}Player`.`Zgony` = '%{zgony.ilosc::%loop-player%}%' WHERE `{@table_prefix}Player`.`Gracz` = '%loop-player%'"
Hello
could anyone modify this script with the skquery mysql database to skript-db??
[doublepost=1526922316,1526741455][/doublepost]ref
[doublepost=1527010612][/doublepost]however, please change to Skellett Mysql
 
Status
Not open for further replies.