Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- watermark: &3[&bFREWTY LANG&3] &4-&7
- on load:
- clear {effects::*}
- clear {events::*}
- clear {Execution order::*}
- #TEMP
- loop {integers::*}:
- deleteint(loop-value)
- clear {integers::*}
- #TEMP
- createeffect("+ ")
- createeffect("- ")
- createeffect("broadcast ")
- createeffect("tp plr ")
- createeffect("cool effect man")
- createexpression("plr")
- createevent("chat")
- createevent("die")
- createevent("join")
- createevent("left click")
- createevent("right click")
- if dir "plugins/FrewtyLang/scripts" doesn't exist:
- create dir "plugins/FrewtyLang/scripts"
- broadcast "{@watermark} &c""V1.0.0"" &8IS RUNNING"
- function reload(filename: text):
- clear {lines::*}
- set {linescount} to line count of file "plugins/FrewtyLang/scripts/%{_filename}%.txt"
- loop {linescount} times:
- set {_linecontent} to line loop-num in file "plugins/FrewtyLang/scripts/%{_filename}%.txt"
- add {_linecontent} to {lines::*}
- broadcast "{@watermark} Loaded line &8%loop-num%&7>&d'&5%{_linecontent}%&d'"
- loop {linescount} times:
- if {eventline} = 0:
- variablefunction({lines::%loop-num%})
- # if {lines::%loop-num-1%} starts with "!":
- # stop
- function createexpression(expressionname: text):
- add {_expressionname} to {expressions::*}
- function createevent(eventname: text):
- add {_eventname} to {events::*}
- function createeffect(effectname: text):
- add {_effectname} to {effects::*}
- function createint(intname: text , intval: integer ):
- set {int-%{_intname}%} to {_intval}
- function deleteint(intname: text):
- delete {int-%{_intname}%}
- function read(eventname: text,arg1: text,arg2: text):
- set {eventline} to 0
- set {eventend} to 0
- loop {linescount} times:
- # if {eventline} = 0:
- # variablefunction({lines::%loop-num%})
- if {eventline} != 0:
- if {lines::%loop-num%} starts with "X" or "x" or "cancel" or "Cancel" or "cancel event" or "cancel Event" or "Cancel Event" or "Cancel event":
- stop
- if {lines::%loop-num%} starts with "_":
- continue
- loop {events::*}:
- if {lines::%loop-num-1%} starts with "%{_eventname}%:":
- #broadcast "this is %{_eventname}%:"
- #set {Current Event} to {_eventname}
- set {eventline} to loop-num-1
- loop {linescount} times:
- exit 1 loop
- else:
- if {eventline} != 0:
- loop {events::*}:
- if {lines::%loop-num-1%} starts with "!":
- if loop-num-1 > {eventline}:
- set {eventline} to 0
- stop
- if {lines::%loop-num-1%} does not contain loop-value-2:
- loop {effects::*}:
- #broadcast {effects::%loop-index%}
- if {lines::%loop-num-1%} starts with "%{effects::%loop-index-1%}%":
- if loop-num-1 >= {eventline}:
- effectfunction({effects::%loop-index-1%},{lines::%loop-num-1%},{_arg1},{_arg2})
- exit 1 loops
- #fold
- command /fl [<text>] [<text>]:
- permission: fl
- trigger:
- if arg-1 is not set:
- broadcast "{@watermark}"
- broadcast " &1/fl &c[1<reload/r/load/l>,2<debug/d>]"
- broadcast " &c[1<script name>,2<event/events>]"
- broadcast "&4&lONLY USE DEBUG IF YOU KNOW WHAT YOU ARE DOING"
- if arg-1 = "reload" or "r" or "load" or "l":
- if file "plugins/FrewtyLang/scripts/%arg-2%.txt" exists:
- broadcast "{@watermark} &4RELOADING -%arg-2%-"
- reload(arg-2)
- if arg-1 = "debug" or "d":
- if arg-2 = "events" or "event":
- broadcast "{@watermark} &4EVENTS:&7 %{events::*}%"
- #EFFECT FUNCTION
- function effectfunction(effectname: text,line: text,arg1: text,arg2: text):
- if {_effectname} is "broadcast ":
- set {_message} to {_line}
- set {_colored chat::*} to {_message} split at " "
- if {_colored chat::2} is "colored" or "clrd" or "color" or "clr":
- if {_line} contains "~i@":
- loop {_colored chat::*}:
- loop {integers::*}:
- if {_message} contains "~i@%loop-value-2%~":
- replace "~i@%loop-value-2%~" in {_message} with "%{int-%loop-value-2%}%"
- replace "%{_colored chat::2}% " in {_message} with ""
- replace {_effectname} in {_message} with ""
- loop {expressions::*}:
- if {_message} contains "~%loop-value-2%~":
- replace "~%loop-value-2%~" in {_message} with {_arg1}
- broadcast colored {_message}
- else:
- replace "%{_colored chat::2}% " in {_message} with ""
- replace {_effectname} in {_message} with ""
- loop {integers::*}:
- if {_message} contains "~i@%loop-value%~":
- replace "~i@%loop-value%~" in {_message} with "%{int-%loop-value%}%"
- loop {expressions::*}:
- if {_message} contains "~%loop-value%~":
- replace "~%loop-value%~" in {_message} with {_arg1}
- broadcast colored {_message}
- else if {_colored chat::2} is not "colored" or "clrd" or "color" or "clr":
- if {_line} contains "~i@":
- loop {_colored chat::*}:
- replace {_effectname} in {_message} with ""
- loop {integers::*}:
- if {_message} contains "~i@%loop-value-2%~":
- replace "~i@%loop-value-2%~" in {_message} with "%{int-%loop-value-2%}%"
- loop {expressions::*}:
- if {_message} contains "~%loop-value-2%~":
- replace "~%loop-value-2%~" in {_message} with {_arg1}
- broadcast {_message}
- else:
- replace {_effectname} in {_message} with ""
- loop {integers::*}:
- if {_message} contains "~i@%loop-value%~":
- replace "~i@%loop-value%~" in {_message} with "%{int-%loop-value%}%"
- loop {expressions::*}:
- if {_message} contains "~%loop-value%~":
- replace "~%loop-value%~" in {_message} with {_arg1}
- # loop {expressions::*}:
- # if {_message} contains "~%loop-value%~":
- # set {_plrmsg::*} to {_message} split at "~"
- # loop {_plrmsg::*}:
- # if {_plrmsg::%loop-index-2%} is loop-value-1:
- # set {_loopindex} to loop-index-2
- # subtract 1 from {_loopindex}
- # if {_plrmsg::%{_loopindex}%} is not loop-value-1:
- # set {_loopindex} to loop-index-2
- # subtract 1 from {_loopindex}
- # if {_plrmsg::%{_loopindex}%} is not loop-value-1:
- # replace {_plrmsg::%loop-index-2%} in {_message} with {_arg1}
- broadcast {_message}
- if {_effectname} is "tp plr ":
- set {_message} to {_line}
- replace {_effectname} in {_message} with ""
- set {_tppositions::*} to {_message} split at " "
- loop {_tppositions::*}:
- loop {expressions::*}:
- if {_tppositions::%loop-index-1%} contains "~%loop-value-2%~":
- replace "~%loop-value-2%~" in {_tppositions::%loop-index-1%} with {_arg1}
- teleport ({_tppositions::1} parsed as a player) to ({_tppositions::2} parsed as a player)
- #broadcast "&3%{_tppositions::1}%%{_tppositions::2}%"
- if {_effectname} is "+ ":
- set {_message} to {_line}
- replace {_effectname} in {_message} with ""
- set {_added numbers::*} to {_message} split at " "
- if {_added numbers::2} contains "0" or "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9":
- add ({_added numbers::2} parsed as a number) to {int-%{_added numbers::1}%}
- else:
- add {int-%{_added numbers::2}%} to {int-%{_added numbers::1}%}
- if {_effectname} is "- ":
- set {_message} to {_line}
- replace {_effectname} in {_message} with ""
- set {_subtracted numbers::*} to {_message} split at " "
- if {_subtracted numbers::2} contains "0" or "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9":
- subtract ({_subtracted numbers::2} parsed as a number) from {int-%{_subtracted numbers::1}%}
- else:
- subtract {int-%{_subtracted numbers::2}%} from {int-%{_subtracted numbers::1}%}
- #VARIABLE FUNCTION
- function variablefunction(line: text):
- set {_message} to {_line}
- if {_line} starts with "@":
- replace "@" in {_message} with ""
- if {_message} starts with "int.":
- replace "int." in {_message} with ""
- set {_intcomponents::*} to {_message} split at "="
- add {_intcomponents::1} to {integers::*}
- #broadcast {_message}
- createint({_intcomponents::1},({_intcomponents::2} parsed as an integer))
- on left click:
- read("left click","%player%","%clicked block%")
- on join:
- read("join","%player%","")
- on chat:
- read("chat","%player%","%message%")
- on right click:
- read("right click","%player%","%clicked block%")
- on death:
- read("die","%victim%","%attacker%")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement