Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Command /bl [<text>] [<text>] [<text>]:
- trigger:
- arg-1 is "reload":
- arg-2 is set:
- reloadLink(arg-2, ("%world of player%" parsed as text), player)
- else:
- send "&8[&6&lBINLANG&8] &7/bl (reload) (RAW pastebin link)"
- else if arg-1 is "info":
- send "&8[&6&lBINLANG&8] &7Information:"
- send "&8[&6&lBINLANG&8] &7Version: 0.1.5"
- send "&8[&6&lBINLANG&8] &7Developer: Nutts"
- send "&8[&6&lBINLANG&8] &7Latest release date: June 30th, 2019"
- else if arg-1 is "addon":
- arg-2 is "import":
- send "&8[&6&lBINLANG&8] &7Importing addon..."
- set {_name} to getAddonFromName(arg-3)
- {_name} is "Error":
- send "&8[&6&lBINLANG&8] &cERROR IMPORTING ADDON!"
- else:
- send "&8[&6&lBINLANG&8] &7Successfully imported addon with name %{_name}%"
- else:
- send "&8[&6&lBINLANG&8] &7/bl (reload|info)"
- function reloadLink(t: text, world: text, player: player):
- send "&8[&6&lBINLANG&8] &7Beginning parse of &e%{_t}%&7" to {_player}
- clear {onbreak.%{_world}%::*}, {onchat.%{_world}%::*} and {onplace.%{_world}%::*}
- set {_next} to ""1
- set {_lines::*} to text from url "%{_t}%"
- size of {_lines::*} < 401:
- loop {_lines::*}:
- set {_c} to {_lines::%loop-index%} #get the line of code
- {_next} is not "":
- {_c} is not "}"
- {_c} starts with " ":
- set {_c} to subtext of {_c} from characters 5 to length of {_c}
- else:
- send "&8[&6&lBINLANG&8] &7Error on line %loop-index%: Indentation expected because action takes place in the scope of an event block" to {_player}
- {_c} is "event::break {":
- {_next} is not "":
- send "&8[&6&lBINLANG&8] &7Error on line %loop-index%: Cannot place event inside another event" to {_player}
- else:
- set {_next} to "break"
- else if {_c} is "event::place {":
- {_next} is not "":
- send "&8[&6&lBINLANG&8] &7Error on line %loop-index%: Cannot place event inside another event" to {_player}
- else:
- set {_next} to "place"
- else if {_c} is "event::chat {":
- {_next} is not "":
- send "&8[&6&lBINLANG&8] &7Error on line %loop-index%: Cannot place event inside another event" to {_player}
- else:
- set {_next} to "chat"
- else if {_c} is "":
- else if {_c} is "}":
- {_next} is not "":
- set {_next} to ""
- else:
- send "&8[&6&lBINLANG&8] &7Error on line %loop-index%: Unnecessary closing brace" to {_player}
- else if {_c} starts with "chat::broadcast """:
- checkNext({_next}, {_c}, {_world})
- else if {_c} starts with "chat::send """:
- checkNext({_next}, {_c}, {_world})
- else if {_c} is "cancel event" or "cancel the event" or "undo event" or "undo the event":
- checkNext({_next}, {_c}, {_world})
- else if {_c} starts with "set variable ":
- checkNext({_next}, {_c}, {_world})
- else if {_c} starts with "do player command":
- checkNext({_next}, {_c}, {_world})
- else:
- send "&8[&6&lBINLANG&8] &7Error on line %loop-index%: Unrecognized action. '%{_c}%'" to {_player}
- else:
- send "&8[&6&lBINLANG&8] &7There was an error loading your script." to {_player}
- send "&8[&6&lBINLANG&8] &7Ended parse of &e%{_t}%&7" to {_player}
- function checkNext(next: text, c: text, world: text):
- {_next} is "break":
- add {_c} to {onbreak.%{_world}%::*}
- else if {_next} is "place":
- add {_c} to {onplace.%{_world}%::*}
- else if {_next} is "join":
- add {_c} to {onjoin.%{_world}%::*}
- else if {_next} is "chat":
- add {_c} to {onchat.%{_world}%::*}
- else if {_next} is "firstJoin":
- add {_c} to {onfirstjoin.%{_world}%::*}
- else if {_next} is "quit":
- add {_c} to {onquit.%{_world}%::*}
- else:
- send "&8[&6&lBINLANG&8] &7Error: Event was not defined for action. '%{_c}%'" to {_player}
- on break:
- loop {onbreak.%world of player%::*}:
- set {_c} to {onbreak.%world of player%::%loop-index%}
- replace every "%%player%%" in {_c} with "%player%"
- set {_t} to check({_c}, player)
- {_t} is "cancel"
- cancel event
- on place:
- loop {onplace.%world of player%::*}:
- set {_c} to {onplace.%world of player%::%loop-index%}
- replace every "%%player%%" in {_c} with "%player%"
- set {_t} to check({_c}, player)
- {_t} is "cancel"
- cancel event
- on chat:
- loop {onchat.%world of player%::*}:
- set {_c} to {onchat.%world of player%::%loop-index%}
- replace every "%%message%%" in {_c} with message
- replace every "%%player%%" in {_c} with "%player%"
- set {_t} to check({_c}, player)
- {_t} is "cancel"
- cancel event
- function check(t: text, p: player) :: text:
- {_t} starts with "chat::broadcast """:
- replace every "chat::broadcast """ in {_t} with ""
- replace every "<" in {_t} with ""
- replace every "%%player%%" in {_t} with {_p}
- loop {variables.%{_uuid}%::*}:
- replace every "%%%loop-index%%%" in {_t} with loop-value
- broadcast colored subtext of {_t} from characters 1 to (length of {_t} - 1) to world of {_p}
- else if {_t} starts with "chat::send """:
- replace every "chat::send """ in {_t} with ""
- replace every "<" in {_t} with ""
- replace every "%%player%%" in {_t} with {_p}
- loop {variables.%{_uuid}%::*}:
- replace every "%%%loop-index%%%" in {_t} with loop-value
- send colored subtext of {_t} from characters 1 to (length of {_t} - 1) to {_p}
- else if {_t} is "cancel event" or "cancel the event" or "undo event":
- return "cancel"
- else if {_t} starts with "set variable ":
- replace every "set variable " in {_t} with ""
- replace every " to" in {_t} with ""
- set {_variable} to {_t}
- replace every "[" in {_variable} with ""
- replace every "]" in {_variable} with ""
- set {_parts::*} to {_variable} split at " "
- set {_variable} to {_parts::1}
- set {_value} to {_parts::2}
- replace every """" in {_value} with ""
- replace every "%%player%%" in {_value} with {_p}
- loop {variables.%{_uuid}%::*}:
- replace every "%%%loop-index%%%" in {_value} with loop-value
- set {variables.%{_uuid}%::%{_variable}%} to {_value}
- else if {_t} starts with "do player command":
- replace every "do player command """ in {_t} with ""
- loop {variables.%{_uuid}%::*}:
- replace every "%%%loop-index%%%" in {_t} with loop-value
- execute {_p} command subtext of {_t} from characters 1 to (length of {_t} - 1)
- else if {_t} starts with "add ":
- replace every "add " in {_t} with ""
- replace every "to " in {_t} with ""
- loop {variables.%{_uuid}%::*}:
- replace every "%%%loop-index%%%" in {_t} with loop-value
- set {_parts::*} to {_t} split at " "
- add ({_parts::1} parsed as number) to {variables.%{_uuid}%::%{_parts::2}%}
- function getAddonFromName(t: text) :: text:
- set {_lines::*} to text from url "%{_t}%"
- loop {_lines::*}:
- if {_lines::1} != "##{addon options}":
- return "Error"
- set {_addonName} to {_lines::2}
- replace every "## addon_name: " in {_addonName} with ""
- return {_addonName}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement