General > Developers Corner

ULX Commands

<< < (4/6) > >>

Aaron113:
Thanks for the help!  I'll get to working on this more possibly some time later today or tomorrow.

JamminR:
You're welcome.
I've not been motivated this past year to contribute to the ULib codebase directly, and haven't been on Steam enough to indirectly contribute in discussions with Megiddo. (I miss you, man!)
ULib/Lua assistance like this help keep me sharp and exercise my brain.
I'd not even realized until helping you that repeat_min and _max had been added to the StringArg object.
Always enjoy learning our new toys.
:P

Aaron113:
Finally got around to adding the autocompletes.  Works well.

Aaron113:

--- Quote from: Megiddo on November 09, 2010, 08:48:52 PM ---I think hint is just used for autocomplete and command syntax. Repeat min ensures that an argument is repeated at least n times (and also states that it CAN be repeated). This was mainly added for XGUI's benefit, but it's useful for ULX as well.

For example:
vote:addParam{ type=ULib.cmds.StringArg, hint="options", ULib.cmds.takeRestOfLine, repeat_min=2, repeat_max=10 }

That's a line from the ulx vote definition. It makes sure that there are at least 2 options given, and a maximum of 10. (I need to document repeat_max :P)

--- End quote ---

Is there a way to get all the values into a table without having a million arguments in the function?

Megiddo:

--- Quote from: Aaron113 on March 14, 2011, 04:24:01 PM ---Is there a way to get all the values into a table without having a million arguments in the function?

--- End quote ---

They're optional, so only specify them if you need them. This is a named parameter design.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version