
Originally Posted by
Jeanne Renault
I know that part. Supposedly Motes libs actually split the string into an array, but in testing that doesn't seem to be the case.
As far as I remember, self_command is passed a string. From the link's description of job_self_command, I assumed the command was passed to job_self_command before any processing was done. You can split it into an array if you want to.
Code:
function job_self_command(commandArgs, eventArgs)
commandArgs= commandArgs:split(' ')
end
You passed self_command the string 'itemize_sets(sets.Stoneskin, \'get\')', which isn't how self_command functions usually work. I guess you could do loadstring(commandArgs)() if you wanted to be unique.

Originally Posted by
Jeanne Renault
How do I wrap a function in a self command so I can actually call it as needed? Everything I've tried has resulted in failure to register anything at all.
You don't need to wrap a function in anything. Call the function from job_self_command.
Code:
function job_self_command(commandArgs, eventArgs)
commandArgs= commandArgs:split(' ')
if commandArgs[1] == 'itemize_sets' then
itemize_sets(commandArgs[2], commandArgs[3])
end
end
//gs c itemize_sets sets.Stoneskin get
Edit: Er, keep in mind that sets.Stoneskin will be a string. You'd need to rewrite your function to convert 'sets.Stoneskin' into the actual table.
Code:
local t = commandArgs[2]:split('.')
local sets = t[1]
for i = 1, #t do
sets = sets[t[i]]
end