ingwarsw / tinyfugue

TinyFugue - Rebirth
Other
62 stars 34 forks source link

Initial lua function support. #69

Closed erikarn closed 1 year ago

erikarn commented 1 year ago

This extends things to support calling functions with arbitrary numbers of command parameters. In this way lua code can be used with function arguments, rather than just /calllua 's support for simply including the entire MUD input string w/ attributes and such.

Support a single return result. Handle string, integer and float.

ingwarsw commented 1 year ago

Actually it cannot break anything that was working so lets merge and see in practice..

erikarn commented 1 year ago

thanks! yeah, it seemed like a mostly no brainer to do this.

It's a lot easier/cleaner to write the regexp/glob/hook/prompt/etc matching using tinyfugue macros and then have them call into lua methods with positional parameters.

erikarn commented 1 year ago

actually i wonder if setting the lua stack to 0 each time means the code can't be re-entrant. I mean, I bet lua/tf's eval stuff can't be too re-entrant in the first place? I think it's worth checking...