[ULX] Custom command problems

I added some custom commands for Luadev to ULX

I can run strings from XGUI fine but if I try to do it from chat this happens:


function ulx.l( calling_ply, line )
calling_ply:ConCommand("lua_run_sv "…line)

local l = ulx.command( CATEGORY_NAME, “ulx l”, ulx.l, “!l” )
l:addParam{ type=ULib.cmds.StringArg }
l:defaultAccess( ULib.ACCESS_ADMIN )
l:help( “Runs a string of lua on the sever” )

probably string escape issue

Not familiar with what these are, can you explain what it is.

One issue is with this line:

l:addParam{ type=ULib.cmds.StringArg }

: is used for function calls. You’re using it for a table declaration. You may have wanted to do:

l:addParam( { type = ULib.cmds.StringArg } )

EOF Expected Error = End Of File; basically you have one too many, or one too few "end"s or some other issue. Typically this is a common mistake when proper indentation ( for human readability ) isn’t followed. It becomes easy to miss.

BUT your issue seems to be with a “symbol” near EOF. Something is out of place… Post the entire code if you need help locating it. Otherwise, comment out large portions of the document, when the error goes away, you’ve located the chunk… Start decreasing the amount of commented code in that segment until you’ve isolated the line. Also ensure tabbing is used, it makes finding EOF Expected / “Cryptic” errors much easier.

Uhh, no? Lua allows you to call functions without parentheses if you pass a single string or table literal as argument.

First, the issue with OP’s code is most likely that ConCommand strips " because in Source’s console system quotes are used to force multiple whitespace separated arguments to become a single argument.
Second, why even use ConCommand, why not manually call whatever function Luadev binds to lua_run_sv?

It’s fixed somewhat, I don’t think the chat command likes using Say() that much but other commands work fine.