Post by Jubei on Nov 13, 2005 20:40:37 GMT -5
For anyone looking for an editor for their Lunar scripts that's better than using notepad, i can recommend Scite. An installer for Scite can be downloaded from this link and features support for Lua 5.0 scripts.
gnuwin.epfl.ch/apps/SciTE/en/install/
I was bored and modified the lua.properties file in the install directory of Scite to highlight all Lunar functions. Simply open Scite and do
options > "open lua.properties"
delete the text and replace with the following code. Save the changes and close. Highlighting of Lunar keywords will only occur once it has been typed correctly and the script has been saved as .lua.
Happy Scripting
gnuwin.epfl.ch/apps/SciTE/en/install/
I was bored and modified the lua.properties file in the install directory of Scite to highlight all Lunar functions. Simply open Scite and do
options > "open lua.properties"
delete the text and replace with the following code. Save the changes and close. Highlighting of Lunar keywords will only occur once it has been typed correctly and the script has been saved as .lua.
# Define SciTE settings for Lua files.
file.patterns.lua=*.lua
filter.lua=Lua (lua)|$(file.patterns.lua)|
lexer.$(file.patterns.lua)=lua
word.chars.lua=$(chars.alpha)$(chars.numeric)_%
word.characters.$(file.patterns.lua)=$(chars.alpha)$(chars.numeric)_%
keywordclass.lua=and break do else elseif end false for function if \
in local nil not or repeat return then true until while
keywords.$(file.patterns.lua)=$(keywordclass.lua)
# Basic Functions
keywordclass2.lua=_VERSION assert collectgarbage dofile error gcinfo loadfile loadstring \
print tonumber tostring type unpack
#### Lua 4.0
# Basic Functions
keywordclass2.lua4=_ALERT _ERRORMESSAGE _INPUT _PROMPT _OUTPUT \
_STDERR _STDIN _STDOUT call dostring foreach foreachi getn globals newtype \
rawget rawset require sort tinsert tremove
# String Manipulation & Mathematical Functions
keywordclass3.lua4=abs acos asin atan atan2 ceil cos deg exp \
floor format frexp gsub ldexp log log10 max min mod rad random randomseed \
sin sqrt strbyte strchar strfind strlen strlower strrep strsub strupper tan
# Input and Output Facilities & System Facilities
keywordclass4.lua4=openfile closefile readfrom writeto appendto \
remove rename flush seek tmpfile tmpname read write \
clock date difftime execute exit getenv setlocale time
#### Lua 5.0
# Basic Functions
keywordclass2.lua5=_G getfenv getmetatable ipairs loadlib next pairs pcall \
rawegal rawget rawset require setfenv setmetatable xpcall \
string table math coroutine io os debug
# I put the library names here, so when highlighted standalone, they are probably variable name from Lua 4.0 times.
# String Manipulation, Table Manipulation, Mathematical Functions (string & table & math)
keywordclass3.lua5=string.byte string.char string.dump string.find string.len \
string.lower string.rep string.sub string.upper string.format string.gfind string.gsub \
table.concat table.foreach table.foreachi table.getn table.sort table.insert table.remove table.setn \
math.abs math.acos math.asin math.atan math.atan2 math.ceil math.cos math.deg math.exp \
math.floor math.frexp math.ldexp math.log math.log10 math.max math.min math.mod \
math.pi math.rad math.random math.randomseed math.sin math.sqrt math.tan
# Coroutine Manipulation, Input and Output Facilities, System Facilities (coroutine & io & os)
keywordclass4.lua5=coroutine.create coroutine.resume coroutine.status \
coroutine.wrap coroutine.yield \
io.close io.flush io.input io.lines io.open io.output io.read io.tmpfile io.type io.write \
io.stdin io.stdout io.stderr \
os.clock os.date os.difftime os.execute os.exit os.getenv os.remove os.rename \
os.setlocale os.time os.tmpname
# Lunar Functions
keywordclass5.lua5=Windower.console_Clear Windower.console_Exec Windower.console_GetVisible Windower.console_SetPosition Windower.console_SetVisible Windower.console_Toggle Windower.console_Write Windower.script_GetArg Windower.script_GetArgCount Windower.script_GetCommand Windower.script_GetCommandCount Windower.script_SetAuthor Windower.script_SetContact Windower.script_SetName Windower.script_SetVersion Windower.script_Sleep Graphics.primitive_CreateObject Graphics.primitive_DeleteAll Graphics.primitive_DeleteObject Graphics.primitive_HideAll Graphics.primitive_SetColor Graphics.primitive_SetFitToTexture Graphics.primitive_SetPosition Graphics.primitive_SetSize Graphics.primitive_SetTexture Graphics.primitive_SetTextureRepeat Graphics.primitive_ShowAll Graphics.primitive_SetVisibility Graphics.text_CreateObject Graphics.text_DeleteAll Graphics.text_DeleteObject Graphics.text_HideAll Graphics.text_SetBGBorderSize Graphics.text_SetBGBorderVisibility Graphics.text_SetBGColor Graphics.text_SetBold
Graphics.text_SetColor
Graphics.text_Color Graphics.text_SetFont Graphics.text_SetItalic Graphics.text_SetPosition Graphics.text_SetRightJustify Graphics.text_SetText Graphics.text_SetVisibility Graphics.text_ShowAll Control.control_BindKey Control.control_GetBlockInput Control.control_IsKeyBound Control.control_SendString Control.control_SetBlockInput Control.control_SetKey Control.control_UnbindKey FFXI.player_GetName FFXI.player_GetStatus FFXI.player_GetXPos FFXI.player_GetYPos FFXI.player_GetZPos FFXI.player_GetHeading FFXI.player_GetHeadingRads FFXI.player_GetFirstPerson FFXI.player_GetCurrentHP FFXI.player_GetCurrentMP FFXI.player_GetMaxHP FFXI.player_GetMaxHP FFXI.player_GetMaxMP FFXI.player_GetCurrentTP FFXI.player_GetCurrentGil FFXI.player_GetMainJob FFXI.player_GetSubJob FFXI.player_GetMainJobLevel FFXI.player_GetSubJobLevel FFXI.player_GetCurrentXP FFXI.player_GetRemainingXP FFXI.player_GetLevelXP FFXI.target_GetName FFXI.target_GetXPos FFXI.target_GetYPos FFXI.target_GetZPos FFXI.target_GetHeading FFXI.target_GetHeadingRads FFXI.target_GetBearing FFXI.target_GetBearingToPlayer FFXI.target_GetHPPercent FFXI.target_GetTargetDistance FFXI.chat_GetOldestLineNumber FFXI.chat_GetNewestLineNumber FFXI.chat_GetLine FFXI.chat_GetRawLine FFXI.chat_GetLineColor FFXI.chat_GetLineType
# I keep keywords5, 6, 7 & 8 for other libraries
# To make the change from Lua 4 to Lua 5 as smooth as possible, I made these properties
# modular and flexible.
# If you use only Lua 4, you can remove the lua5 keywords.
# If you use only Lua 5, you can either remove the lua4 keywords, or put them
# in another property to highlight them in a warning/error style.
# If you still use both, you can keep them like below, or use separate styles.
keywords2.$(file.patterns.lua)=$(keywordclass2.lua) $(keywordclass2.lua4) $(keywordclass2.lua5)
keywords3.$(file.patterns.lua)=$(keywordclass3.lua4) $(keywordclass3.lua5)
keywords4.$(file.patterns.lua)=$(keywordclass4.lua4) $(keywordclass4.lua5)
keywords5.$(file.patterns.lua)=$(keywordclass5.lua5)
#~ statement.indent.$(file.patterns.lua)=5 do else function then
#~ statement.end.$(file.patterns.lua)=5 end until
#~ statement.lookback.$(file.patterns.lua)=20
indent.maintain.$(file.patterns.lua)=1
comment.block.lua=--~
comment.block.at.line.start.lua=1
# Lua styles
#Default
style.lua.32=$(font.code.base),fore:#000000
# White space: Visible only in View Whitespace mode (or if it has a back colour)
style.lua.0=fore:#FF0000
# Block comment (Lua 5.0)
style.lua.1=$(colour.code.comment.box),$(font.code.comment.box),back:#D0F0F0,eolfilled
# Line comment
style.lua.2=$(colour.code.comment.line),$(font.code.comment.line)
# Doc comment -- Not used in Lua (yet?)
style.lua.3=$(colour.notused),$(font.notused)
# Number
style.lua.4=$(colour.number)
# Keyword
style.lua.5=$(colour.keyword)
# String
style.lua.6=$(colour.string)
# Character
style.lua.7=$(colour.char)
# Literal string
style.lua.8=$(colour.string),$(font.code.comment.box),back:#E0FFFF
# Preprocessor (obsolete in Lua 4.0 and up)
style.lua.9=$(colour.preproc)
# Operators
style.lua.10=$(colour.operator)
# Identifier (everything else...)
style.lua.11=
# End of line where string is not closed
style.lua.12=back:#E0C0E0,eolfilled
# Other keywords (bozo test colors :-)
style.lua.13=$(style.lua.5),back:#D0FFD0
style.lua.14=$(style.lua.5),back:#D0D0FF
style.lua.15=$(style.lua.5),back:#FFD0D0
style.lua.16=$(style.lua.5),back:#FFFFCC
style.lua.17=$(style.lua.5),back:#FFFFD0
style.lua.18=$(style.lua.5),back:#FFA0A0
style.lua.19=$(style.lua.5),back:#FFFF99
# Braces are only matched in operator style
braces.lua.style=10
command.compile.*.lua=LuaC-5.0.exe -o "$(FileName).luc" "$(FileNameExt)"
# Lua 5.0
command.go.*.lua=Lua-5.0.exe "$(FileNameExt)"
# Lua 4.0
#command.go.*.lua=Lua-4.0.exe -c -f "$(FileNameExt)"
Happy Scripting