Posted 19 June 2015 - 03:26 AM
I know the title is a little weird but I don't know how to explain this.
In the program the user types in a command (service stop test)
In the table I have:
What I need to do is to look through the table and see that "service" is a table and to check if stop is there. If stop is there and is a function, run it with the argument "test". I also need it to do it for (lets say) 100 tables before it gets to the actual function.
Any help is appreciated, I have redone the code multiple times and I am out of ideas.
In the program the user types in a command (service stop test)
In the table I have:
{
[ "service" ] = {
[ "stop" ] = function(args)
print(args)
end,
},
}
What I need to do is to look through the table and see that "service" is a table and to check if stop is there. If stop is there and is a function, run it with the argument "test". I also need it to do it for (lets say) 100 tables before it gets to the actual function.
Any help is appreciated, I have redone the code multiple times and I am out of ideas.