Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script options:
- $ db url jdbc:mysql://172.16.0.1:3306/kitpvp_stats # // Host, Port (default: 3306), database
- $ db username kitpvp_stats # // username for login
- $ db password SIfZE1iiQRpUzzjk # // password for login
- command /freset:
- trigger:
- delete file "plugins/GG-KitPvP/NPC/Data.yml"
- update "DROP table npc"
- wait 1 second
- update "CREATE TABLE IF NOT EXISTS `npc` (`UUID` varchar(255),`kills` mediumint(255))"
- set {_num} to 0
- loop all players:
- update "INSERT INTO `npc` (`uuid`, `kills`) VALUES ('%uuid of loop-player%', '%{_num}%')"
- set yaml value "mysql.%uuid of loop-player%" from file "../../GG-KitPvP/NPC/Data.yml" to true
- set {npc::1d.sec} to 59
- set {npc::1d.min} to 59
- set {npc::1d.tim} to 23
- every 1 second:
- if {npc::1d.min} is 0:
- set {npc::1d.min} to 59
- remove 1 from {npc::1d.tim}
- if {npc::1d.sec} is 0:
- set {npc::1d.sec} to 60
- remove 1 from {npc::1d.min}
- remove 1 from {npc::1d.sec}
- set {_loc} to yaml value "skilt" from file "../../GG-KitPvP/NPC/1d.yml"
- set line 2 of block at {_loc} to "&c%{npc::1d.tim}%&8:&c%{npc::1d.min}%&8:&c%{npc::1d.sec}%"
- every 30 minute:
- set {_clock} to hour
- if {_clock} is 1:
- delete file "plugins/GG-KitPvP/NPC/Data.yml"
- update "DROP table npc"
- wait 1 second
- set {_num} to 0
- update "CREATE TABLE IF NOT EXISTS `npc` (`UUID` varchar(255),`kills` mediumint(255))"
- loop all players:
- update "INSERT INTO `npc` (`uuid`, `kills`) VALUES ('%uuid of loop-player%', '%{_num}%')"
- set yaml value "mysql.%uuid of loop-player%" from file "../../GG-KitPvP/NPC/Data.yml" to true
- set {npc::1d.sec} to 59
- set {npc::1d.min} to 59
- set {npc::1d.tim} to 23
- on join:
- delete {_mysql}
- set {_mysql} to yaml value "mysql.%uuid of player%" from file "../../GG-KitPvP/NPC/Data.yml"
- if {_mysql} is true:
- stop
- else:
- set {_num} to 0
- update "INSERT INTO `npc` (`uuid`, `kills`) VALUES ('%uuid of player%', '%{_num}%')"
- set yaml value "mysql.%uuid of player%" from file "../../GG-KitPvP/NPC/Data.yml" to true
- on death:
- if victim is a pig:
- stop
- victim is a player
- if attacker is a player:
- set {_kills} to yaml value "kills.%uuid of attacker%" from file "../../GG-KitPvP/NPC/Data.yml"
- add 1 to {_kills}
- set yaml value "kills.%uuid of attacker%" from file "../../GG-KitPvP/NPC/Data.yml" to {_kills}
- # send "&4&lDEBUG &8&l> &c%{_kills}% ((Død))" to all ops
- on quit:
- set {_kills} to yaml value "kills.%uuid of player%" from file "../../GG-KitPvP/NPC/Data.yml"
- update "UPDATE `npc` SET `kills` = '%{_kills}%' WHERE `npc`.`uuid` ='%uuid of player%'"
- send "Opdaterede %player% ((%uuid of player%)) med databasen!"
- # send "&4&lDEBUG &8&l> &c%{_kills}% ((Quit))" to all ops
- on sign change:
- line 1 is "NPC"
- line 2 is "1dkills"
- set {_loc} to location of event-block
- set yaml value "skilt" from file "../../GG-KitPvP/NPC/1d.yml" to {_loc}
- set line 1 of event-block to "&3&lTop Kills"
- set line 2 of event-block to "&c00&8:&c00&8:&c00"
- set line 3 of event-block to "&bIngen..."
- set line 4 of event-block to "&c0 kills"
- console command "npc sel 103"
- console command "npc skin steve"
- console command "npc rename Vent..."
- on rightclick on a sign:
- line 1 is "&3&lTop Kills"
- player command "top1dkillsnpc"
- command /top1dkillsnpc:
- trigger:
- open chest with 1 row named "&6&lTop Kills" to player
- set {_n} to 0
- wait 2 ticks
- loop 9 times:
- set {_show} to yaml value "top.%{_n}%" from file "../../GG-KitPvP/NPC/Data.yml"
- set {_player} to yaml value "top.navn.%{_n}%" from file "../../GG-KitPvP/NPC/Data.yml"
- set slot {_n} of player's current inventory to {_player}'s skull named "%{_show}%"
- add 1 to {_n}
- command /forceupdate1dkillsnpc:
- permission: ggpvp.admin
- trigger:
- set {_id0::*} to objects in column "uuid" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 0"
- $ thread
- set {_id1::*} to objects in column "uuid" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 1"
- $ thread
- set {_id2::*} to objects in column "uuid" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 2"
- $ thread
- set {_id3::*} to objects in column "uuid" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 3"
- $ thread
- set {_id4::*} to objects in column "uuid" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 4"
- $ thread
- set {_id5::*} to objects in column "uuid" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 5"
- $ thread
- set {_id6::*} to objects in column "uuid" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 6"
- $ thread
- set {_id7::*} to objects in column "uuid" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 7"
- $ thread
- set {_id8::*} to objects in column "uuid" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 8"
- $ thread
- set {_id9::*} to objects in column "uuid" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 9"
- $ thread
- set {_statsn0::*} to objects in column "kills" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 0"
- $ thread
- set {_statsn1::*} to objects in column "kills" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 1"
- $ thread
- set {_statsn2::*} to objects in column "kills" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 2"
- $ thread
- set {_statsn3::*} to objects in column "kills" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 3"
- $ thread
- set {_statsn4::*} to objects in column "kills" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 4"
- $ thread
- set {_statsn5::*} to objects in column "kills" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 5"
- $ thread
- set {_statsn6::*} to objects in column "kills" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 6"
- $ thread
- set {_statsn7::*} to objects in column "kills" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 7"
- $ thread
- set {_statsn8::*} to objects in column "kills" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 8"
- $ thread
- set {_statsn9::*} to objects in column "kills" from result of query "SELECT * FROM `npc` ORDER BY `kills` DESC LIMIT 1 OFFSET 9"
- set {_n} to 0
- set {_n1} to 1
- loop 10 times:
- set {_navn::*} to "Ingen..."
- set {_name} to "Ingen..."
- set {_kills::*} to 0
- set {_navn::*} to yaml value "navn" from file "../../GG-KitPvP/uuid/%{_id%{_n}%::*}%.yml"
- set {_kills::*} to {_statsn%{_n}%::*}
- set {_name} to "%{_navn::*}%" parsed as a offlineplayer
- set yaml value "top.%{_n}%" from file "../../GG-KitPvP/NPC/Data.yml" to "&8[&a%{_n1}%&8] &6%{_navn::*}% &8» &c%{_kills::*}%"
- set yaml value "top.navn.%{_n}%" from file "../../GG-KitPvP/NPC/Data.yml" to {_name}
- add 1 to {_n}
- add 1 to {_n1}
- set {_name} to yaml value "top.navn.0" from file "../../GG-KitPvP/NPC/Data.yml"
- console command "npc sel 103"
- console command "npc skin %{_name}%"
- console command "npc rename &e%{_name}%"
- set {_loc} to yaml value "skilt" from file "../../GG-KitPvP/NPC/1d.yml"
- set {_p} to yaml value "uuid" from file "../../GG-KitPvP/uuid/%{_name}%.yml"
- set {_kills} to yaml value "kills.%uuid of player%" from file "../../GG-KitPvP/NPC/Data.yml"
- set line 4 of block at {_loc} to "&c%{_kills}% kills"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement