Post by sdphantom on Mar 5, 2006 1:54:18 GMT -5
The first phase of this website is now being worked on, the function detection script. On the first prototype that doesn't recurse through tables yet has returned a few functions that I haven't seen in listed in the Lua documentaton.
The extra functions are here and are supposedly from the Lua core.
<Edit #1>
The second prototype of the auto detect script is coming along well. I had a few disappointments when trying to build a script that would recurse through the tables, but not increase the call stack more than needed (no functions calling themselves).
I couldn't use for loops since the table stack data was constantly changing if a new table was found, same with the next() function.
I had to make my own itteration code with recursive support. What happens is it uses an array as an information stack. A seperate varible determines the stack size (table.getn() was causing problems in one of my other scripts, so I'm not trusting it). The bottom of the stack always points to the _G table (all registered functions are there). Each element of the stack contains a copy of the table being examined, all keys contained in the table, the current key pointer, and the command path (to get the full command instead of just the key name). The script only scans the top element of the stack at any one time. When a table is encountered, the information reguarding scanning that table is pushed on top of the stack. When the current table is finnished beign scanned, it's popped off the stack. When the stack is empty, the script is done.
<Edit #2>
(/cheer)
This phase is now done. I just added path determination and file write commands, everything is done now. The script is done within 30 seconds and generates the following list file on the current version of Lunar.
List file contents:
string.sub
string.gfind
string.rep
string.gsub
string.char
string.dump
string.find
string.upper
string.len
string.format
string.byte
string.lower
xpcall
FFXI.target_GetTargetDistance
FFXI.target_GetName
FFXI.target_GetZPos
FFXI.player_GetZPos
FFXI.target_GetXPos
FFXI.player_GetMainJobLevel
FFXI.player_GetRemainingXP
FFXI.player_GetHeadingRads
FFXI.player_GetFirstPerson
FFXI.player_GetSubJobLevel
FFXI.player_GetMaxHP
FFXI.target_GetHeading
FFXI.player_GetCurrentXP
FFXI.player_GetYPos
FFXI.player_GetStatus
FFXI.chat_GetLineColor
FFXI.chat_GetRawLine
FFXI.player_GetCurrentGil
FFXI.player_GetCurrentTP
FFXI.player_GetLevelXP
FFXI.target_GetHPPercent
FFXI.chat_GetLine
FFXI.player_GetName
FFXI.player_GetHeading
FFXI.player_GetCurrentMP
FFXI.target_GetBearing
FFXI.target_GetHeadingRads
FFXI.target_GetBearingToPlayer
FFXI.player_GetCurrentHP
FFXI.target_GetYPos
FFXI.chat_GetOldestLineNumber
FFXI.chat_GetLineType
FFXI.player_GetXPos
FFXI.player_GetMainJob
FFXI.player_GetSubJob
FFXI.chat_GetNewestLineNumber
FFXI.player_GetMaxMP
tostring
gcinfo
os.exit
os.setlocale
os.execute
os.getenv
os.difftime
os.remove
os.time
os.clock
os.tmpname
os.rename
os.date
unpack
require
getfenv
setmetatable
next
_TRACEBACK
assert
tonumber
io.popen
io.write
io.close
io.flush
io.open
io.output
io.type
io.read
io.input
io.lines
io.tmpfile
rawequal
Control.control_SetKey
Control.control_SetBlockInput
Control.control_IsKeyBound
Control.control_BindKey
Control.control_UnbindKey
Control.control_PressKey
Control.control_GetBlockInput
Control.control_SendString
collectgarbage
getmetatable
Windower.script_SetName
Windower.windower_GetPath
Windower.console_SetVisible
Windower.console_Write
Windower.windower_GetXRes
Windower.console_Exec
Windower.windower_GetYRes
Windower.script_SetContact
Windower.console_SetPosition
Windower.script_GetCommandCount
Windower.windower_GetPolPath
Windower.script_GetCommand
Windower.windower_GetPolLanguage
Windower.script_GetArgCount
Windower.script_GetArg
Windower.script_Sleep
Windower.script_SetVersion
Windower.console_Clear
Windower.windower_GetRenderDesktopRes
Windower.console_Toggle
Windower.windower_GetTrueFullscreen
Windower.console_GetVisible
Windower.script_SetAuthor
rawset
ScriptRunner.exitCheck
ScriptRunner.exitHook
ScriptRunner.scriptExit
math.log
math.atan
math.ldexp
math.deg
math.tan
math.cos
math.random
math.randomseed
math.frexp
math.ceil
math.floor
math.rad
math.max
math.sqrt
math.pow
math.asin
math.min
math.mod
math.exp
math.log10
math.atan2
math.acos
math.sin
math.abs
Graphics.primitive_SetPosition
Graphics.primitive_SetFitToTexture
Graphics.primitive_SetColor
Graphics.primitive_DeleteAll
Graphics.text_SetRightJustify
Graphics.text_SetBGVisibility
Graphics.text_CreateObject
Graphics.primitive_DeleteObject
Graphics.text_SetVisibility
Graphics.primitive_CreateObject
Graphics.primitive_SetSize
Graphics.text_SetFont
Graphics.primitive_SetTexture
Graphics.text_SetBGColor
Graphics.text_SetPosition
Graphics.primitive_HideAll
Graphics.primitive_SetTextureRepeat
Graphics.text_DeleteObject
Graphics.primitive_SetVisibility
Graphics.primitive_ShowAll
Graphics.text_SetBold
Graphics.text_ShowAll
Graphics.text_HideAll
Graphics.text_DeleteAll
Graphics.text_SetText
Graphics.text_SetColor
Graphics.text_SetBGBorderSize
Graphics.text_SetItalic
pcall
debug.getupvalue
debug.sethook
debug.gethook
debug.traceback
debug.setlocal
debug.setupvalue
debug.debug
debug.getinfo
debug.getlocal
__pow
type
table.setn
table.insert
table.getn
table.foreachi
table.foreach
table.sort
table.remove
table.concat
coroutine.resume
coroutine.yield
coroutine.status
coroutine.wrap
coroutine.create
print
newproxy
rawget
loadstring
dofile
setfenv
pairs
ipairs
error
loadfile
The extra functions are here and are supposedly from the Lua core.
- __pow() - Supposedly called by the '^' operator for exponential calculations.
- _TRACEBACK() - Unknown
- newproxy() - Unknown
<Edit #1>
The second prototype of the auto detect script is coming along well. I had a few disappointments when trying to build a script that would recurse through the tables, but not increase the call stack more than needed (no functions calling themselves).
I couldn't use for loops since the table stack data was constantly changing if a new table was found, same with the next() function.
I had to make my own itteration code with recursive support. What happens is it uses an array as an information stack. A seperate varible determines the stack size (table.getn() was causing problems in one of my other scripts, so I'm not trusting it). The bottom of the stack always points to the _G table (all registered functions are there). Each element of the stack contains a copy of the table being examined, all keys contained in the table, the current key pointer, and the command path (to get the full command instead of just the key name). The script only scans the top element of the stack at any one time. When a table is encountered, the information reguarding scanning that table is pushed on top of the stack. When the current table is finnished beign scanned, it's popped off the stack. When the stack is empty, the script is done.
<Edit #2>
(/cheer)
This phase is now done. I just added path determination and file write commands, everything is done now. The script is done within 30 seconds and generates the following list file on the current version of Lunar.
List file contents:
string.sub
string.gfind
string.rep
string.gsub
string.char
string.dump
string.find
string.upper
string.len
string.format
string.byte
string.lower
xpcall
FFXI.target_GetTargetDistance
FFXI.target_GetName
FFXI.target_GetZPos
FFXI.player_GetZPos
FFXI.target_GetXPos
FFXI.player_GetMainJobLevel
FFXI.player_GetRemainingXP
FFXI.player_GetHeadingRads
FFXI.player_GetFirstPerson
FFXI.player_GetSubJobLevel
FFXI.player_GetMaxHP
FFXI.target_GetHeading
FFXI.player_GetCurrentXP
FFXI.player_GetYPos
FFXI.player_GetStatus
FFXI.chat_GetLineColor
FFXI.chat_GetRawLine
FFXI.player_GetCurrentGil
FFXI.player_GetCurrentTP
FFXI.player_GetLevelXP
FFXI.target_GetHPPercent
FFXI.chat_GetLine
FFXI.player_GetName
FFXI.player_GetHeading
FFXI.player_GetCurrentMP
FFXI.target_GetBearing
FFXI.target_GetHeadingRads
FFXI.target_GetBearingToPlayer
FFXI.player_GetCurrentHP
FFXI.target_GetYPos
FFXI.chat_GetOldestLineNumber
FFXI.chat_GetLineType
FFXI.player_GetXPos
FFXI.player_GetMainJob
FFXI.player_GetSubJob
FFXI.chat_GetNewestLineNumber
FFXI.player_GetMaxMP
tostring
gcinfo
os.exit
os.setlocale
os.execute
os.getenv
os.difftime
os.remove
os.time
os.clock
os.tmpname
os.rename
os.date
unpack
require
getfenv
setmetatable
next
_TRACEBACK
assert
tonumber
io.popen
io.write
io.close
io.flush
io.open
io.output
io.type
io.read
io.input
io.lines
io.tmpfile
rawequal
Control.control_SetKey
Control.control_SetBlockInput
Control.control_IsKeyBound
Control.control_BindKey
Control.control_UnbindKey
Control.control_PressKey
Control.control_GetBlockInput
Control.control_SendString
collectgarbage
getmetatable
Windower.script_SetName
Windower.windower_GetPath
Windower.console_SetVisible
Windower.console_Write
Windower.windower_GetXRes
Windower.console_Exec
Windower.windower_GetYRes
Windower.script_SetContact
Windower.console_SetPosition
Windower.script_GetCommandCount
Windower.windower_GetPolPath
Windower.script_GetCommand
Windower.windower_GetPolLanguage
Windower.script_GetArgCount
Windower.script_GetArg
Windower.script_Sleep
Windower.script_SetVersion
Windower.console_Clear
Windower.windower_GetRenderDesktopRes
Windower.console_Toggle
Windower.windower_GetTrueFullscreen
Windower.console_GetVisible
Windower.script_SetAuthor
rawset
ScriptRunner.exitCheck
ScriptRunner.exitHook
ScriptRunner.scriptExit
math.log
math.atan
math.ldexp
math.deg
math.tan
math.cos
math.random
math.randomseed
math.frexp
math.ceil
math.floor
math.rad
math.max
math.sqrt
math.pow
math.asin
math.min
math.mod
math.exp
math.log10
math.atan2
math.acos
math.sin
math.abs
Graphics.primitive_SetPosition
Graphics.primitive_SetFitToTexture
Graphics.primitive_SetColor
Graphics.primitive_DeleteAll
Graphics.text_SetRightJustify
Graphics.text_SetBGVisibility
Graphics.text_CreateObject
Graphics.primitive_DeleteObject
Graphics.text_SetVisibility
Graphics.primitive_CreateObject
Graphics.primitive_SetSize
Graphics.text_SetFont
Graphics.primitive_SetTexture
Graphics.text_SetBGColor
Graphics.text_SetPosition
Graphics.primitive_HideAll
Graphics.primitive_SetTextureRepeat
Graphics.text_DeleteObject
Graphics.primitive_SetVisibility
Graphics.primitive_ShowAll
Graphics.text_SetBold
Graphics.text_ShowAll
Graphics.text_HideAll
Graphics.text_DeleteAll
Graphics.text_SetText
Graphics.text_SetColor
Graphics.text_SetBGBorderSize
Graphics.text_SetItalic
pcall
debug.getupvalue
debug.sethook
debug.gethook
debug.traceback
debug.setlocal
debug.setupvalue
debug.debug
debug.getinfo
debug.getlocal
__pow
type
table.setn
table.insert
table.getn
table.foreachi
table.foreach
table.sort
table.remove
table.concat
coroutine.resume
coroutine.yield
coroutine.status
coroutine.wrap
coroutine.create
newproxy
rawget
loadstring
dofile
setfenv
pairs
ipairs
error
loadfile