· 9 years ago · Nov 22, 2016, 10:12 PM
1script options:
2 $ db url jdbc:mysql://minecraft81.omgserv.com:3306/minecraft_15226
3 $ db username minecraft_15226
4 $ db password BubbleWar
5
6options:
7 table_prefix: Installation_
8
9# Admin
10sub "CreateBDD":
11 update "CREATE TABLE IF NOT EXISTS `{@table_prefix}Liste-SK` (`ID` varchar(255),`Nom` varchar(255),`Lien` varchar(255),`Lore` varchar(1000))"
12
13# Communication entre scripts
14on load:
15 set {ZU.Centrale::installe.comm::Centrale.error} to false
16 while 1 = 1:
17 loop {ZU.Centrale::installe.comm::*}:
18 set {_clock} loop-value
19 subtract 10 minutes from {_clock}
20 set {_test} to now
21 subtract {_clock} from {_test}
22 if {_test} < 10 minutes:
23 set {ZU.Centrale::installe::%loop-index%} to true
24 else:
25 clear {ZU.Centrale::installe::%loop-index%}
26 clear {ZU.Centrale::installe.comm::%loop-index%}
27 wait 5 minutes
28
29
30command "/ZU":
31 trigger:
32 if arg 1 is "Installation":
33 if arg 2 is "Recommandation":
34 if arg 3 is set:
35 set {_recommandation} to arg 3
36
37 set {_nombre} to result of query "SELECT COUNT(`ID`) FROM `{@table_prefix}Liste-SK`"
38 loop {_nombre} times:
39 set {_Nom::%loop-number%} to objects in column "Nom" from result of query "SELECT * FROM `{@table_prefix}Liste-SK` WHERE `{@table_prefix}Liste-SK`.`ID` = '%loop-number%'"
40 set {_Lien::%loop-number%} to objects in column "Lien" from result of query "SELECT * FROM `{@table_prefix}Liste-SK` WHERE `{@table_prefix}Liste-SK`.`ID` = '%loop-number%'"
41 set {_Lore::%loop-number%} to objects in column "Lore" from result of query "SELECT * FROM `{@table_prefix}Liste-SK` WHERE `{@table_prefix}Liste-SK`.`ID` = '%loop-number%'"
42
43 set {_row} to ceil({_nombre} / 7)
44
45 open chest with {_row} row
46
47 loop numbers between 0 and 8:
48 format slot loop-number of player with black stained glass pane named " " to be unstealable
49 loop numbers between ({_row} * 9) and (({_row} * 9) + 8):
50 format slot loop-number of player with black stained glass pane named " " to be unstealable
51 loop numbers between 1 and ({_row} - 1):
52 format slot (loop-number * 9) of player with black stained glass pane named " " to be unstealable
53 format slot ((loop-number * 9) + 8) of player with black stained glass pane named " " to be unstealable
54
55 set {_slot} to 9
56 loop {_nombre} times:
57 add 1 to {_slot}
58 if {_slot} is 17 or 26 or 35 or 44:
59 add 2 to {_slot}
60
61 if {ZU.Centrale::installe::%{_Nom::%%loop-number%%}%} is true:
62 if {_recommandation} is set:
63 format slot {_slot} of player with yellow wool named "%{_Nom::%%loop-number%%}%" with lore "&a&lInstalled:&r%nl%%{_Lore::%%loop-number%%}%" to run [uninstallZU({_Nom::%loop-number%})]->[make player execute command "/ZU Installation Recommandation %{_recommandation}%"]
64 else:
65 format slot {_slot} of player with yellow wool named "%{_Nom::%%loop-number%%}%" with lore "&a&lInstalled:&r%nl%%{_Lore::%%loop-number%%}%" to run [uninstallZU({_Nom::%loop-number%})]->[make player execute command "/ZU Installation"]
66 else if {_recommandation} is {_Nom::%loop-number%}:
67 format slot {_slot} of player with light grey wool named "%{_Nom::%%loop-number%%}%" with lore "&e&l&nInstallable:&r%nl%%{_Lore::%%loop-number%%}%" to run [installZU({_Lien::%loop-number%})]->[make player execute command "/ZU Installation"]
68 else:
69 if {_recommandation} is set:
70 format slot {_slot} of player with grey wool named "%{_Nom::%%loop-number%%}%" with lore "&e&lInstallable:&r%nl%%{_Lore::%%loop-number%%}%" to run [installZU({_Lien::%loop-number%})]->[make player execute command "/ZU Installation Recommandation %{_recommandation}%"]
71 else:
72 format slot {_slot} of player with grey wool named "%{_Nom::%%loop-number%%}%" with lore "&e&lInstallable:&r%nl%%{_Lore::%%loop-number%%}%" to run [installZU({_Lien::%loop-number%})]->[make player execute command "/ZU Installation"]
73
74 loop numbers between {_slot} and (({_row} * 9) - 2):
75 format slot loop-number of player with black stained glass pane named " " to be unstealable