Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /sethome_test [<string>] [<string>]:
- trigger:
- if arg 1 is set:
- set {skycreations::database.%player%.homes::%arg 1%} to arg 1
- set {skycreations::database.%player%.homes.command::%arg 1%} to arg-1
- if arg 2 is set:
- set {skycreations::database.%player%.homes.icon::%arg 1%} to arg-2 parsed as item
- if arg 2 is not set:
- set {skycreations::database.%player%.homes.icon::%arg 1%} to Big Dripleaf
- command /unsethome_test [<text>]:
- trigger:
- if arg 1 is set:
- delete {skycreations::database.%player%.homes::%arg 1%}
- delete {skycreations::database.%player%.homes.command::%arg 1%}
- delete {skycreations::database.%player%.homes.icon::%arg 1%}
- command /home_test [<text>] [<text>] [<text>] [<text>]:
- trigger:
- if arg 1 is set:
- SummonListOfWaypoints(player, arg 1, "Warp To")
- if arg 1 is not set:
- SummonListOfWaypoints(player, "1", "Warp To")
- function SummonListOfWaypoints(player: player, typedpage: text, action: text):
- open chest inventory with 6 rows named "&8Menadzer szybkiej podrozy" to {_player}
- wait 1 ticks
- set {_page} to {_typedpage} parsed as number
- set {skycreations::player::VarTransfer::lastpage} to {_typedpage} parsed as number
- if {_page} is not set:
- set {_page} to 1
- set {_numberofrecords} to size of {skycreations::database.%{_player}%.homes::*}
- set {_numberofpages} to ceil({_numberofrecords}/18)
- if {_numberofpages} is smaller than 1:
- set {_numberofpages} to 1
- if {_page} is smaller than 1:
- send "none" to {_player}
- stop
- if {_page} is greater than {_numberofpages}:
- send "none" to {_player}
- stop
- if {_numberofrecords} is greater than (18*{_page}):
- set slot 43 of {_player}'s current inventory to 1 of arrow named "&aPrzejdz do nastepnej strony" with lore ""
- if {_page} is greater than 1:
- set slot 37 of {_player}'s current inventory to 1 of arrow named "&aPrzejdz do poprzedniej strony" with lore ""
- if size of {skycreations::database.%{_player}%.homes::*} is smaller than 1:
- send "none" to {_player}
- stop
- set slot 40 of {_player}'s current inventory to 1 of book named "&aStrona &e&l%{_page}% &6z &e&l%{_numberofpages}%" with lore "" and "&6Ta lista moze przetwarzac" and "&6naprawde wiele rekordow..."
- loop {skycreations::database.%{_player}%.homes::*}:
- add loop-value to {_skycreations::database.%{_player}%.homes::*}
- loop {skycreations::database.%{_player}%.homes.command::*}:
- add loop-value to {_skycreations::database.%{_player}%.homes.command::*}
- loop {skycreations::database.%{_player}%.homes.icon::*}:
- add loop-value to {_skycreations::database.%{_player}%.homes.icon::*}
- loop {_numberofrecords} times:
- set {_list} to ({_page}-1)*18
- add loop-number to {_list}
- if {_skycreations::database.%{_player}%.homes::%{_list}%} is not set:
- stop
- if loop-number is (18+1):
- stop
- set slot (17+loop-number) of {_player}'s current inventory to 1 of {_skycreations::database.%{_player}%.homes.icon::%{_list}%} named "&e&l%{_skycreations::database.%{_player}%.homes::%{_list}%}%" with lore ""
- # send "&7ID --- Name --- Persorm --- Icon" to {_player}
- # send "&a%{_list}% &f--- &b&l%{_skycreations::database.%{_player}%.homes::%{_list}%}% &f--- &e&l%{_skycreations::database.%{_player}%.homes.command::%{_list}%}% &f--- &c%{_skycreations::database.%{_player}%.homes.icon::%{_list}%}% " to {_player}
- # send "" to {_player}
- on inventory click:
- event-inventory is not player's inventory
- if name of event-inventory is "&8Menadzer szybkiej podrozy":
- cancel event
- set {_player} to player
- set {_page} to 1
- set {_numberofrecords} to size of {skycreations::database.%{_player}%.homes::*}
- set {_numberofpages} to ceil({_numberofrecords}/32000)
- if {_numberofpages} is smaller than 1:
- set {_numberofpages} to 1
- loop {skycreations::database.%{_player}%.homes::*}:
- add loop-value to {_skycreations::database.%{_player}%.homes::*}
- loop {skycreations::database.%{_player}%.homes.command::*}:
- add loop-value to {_skycreations::database.%{_player}%.homes.command::*}
- loop {skycreations::database.%{_player}%.homes.icon::*}:
- add loop-value to {_skycreations::database.%{_player}%.homes.icon::*}
- set {_numberofrecords} to size of {skycreations::database.%{_player}%.homes::*}
- loop {_numberofrecords} times:
- set {_list} to ({_page}-1)*32000
- add loop-number to {_list}
- if {_skycreations::database.%{_player}%.homes::%{_list}%} is not set:
- stop
- if loop-number is 32000:
- stop
- event-item is {_skycreations::database.%{_player}%.homes.icon::%{_list}%} named "&e&l%{_skycreations::database.%{_player}%.homes::%{_list}%}%":
- send "./home %{_skycreations::database.%{_player}%.homes.command::%{_list}%}% get %{_player}%" to {_player}
- if event-item is arrow named "&aPrzejdz do nastepnej strony":
- execute {_player} command "/hometest %({skycreations::player::VarTransfer::lastpage}+1)%"
- if event-item is arrow named "&aPrzejdz do poprzedniej strony":
- execute {_player} command "/hometest %({skycreations::player::VarTransfer::lastpage}-1)%"
Advertisement
Add Comment
Please, Sign In to add comment