Ulysses

General => Developers Corner => Topic started by: mark272 on March 07, 2019, 10:35:51 AM

Title: This documentation...
Post by: mark272 on March 07, 2019, 10:35:51 AM
I don't understand the documentation.
For example where is ulx.command like ulx.command( CATEGORY_NAME, "ulx bring", ulx.bring, "!bring" )
I only found cmds.addCommand
And why is the method not fully entered? In documentation: ucl.registerAccess but in real code it is ULib.ucl.registerAccess
Could someone help me out here? I am so confused.
Thanks.
Title: Re: This documentation...
Post by: iViscosity on March 07, 2019, 10:47:22 AM
The method is being fully entered.

The syntax for ulx.command is
Code: Lua
  1. ulx.command("Category Name", "console command", function_name, "!chatcommand", hide_command, require_space)
  2.  

Where you have the category to sort the command into, the console command to use the command, the actual function to execute when using the command, and then three optional arguments: the chat command, whether or not the person using the command should have their use message show in chat (useful for things like !p where you don't want it to show), and whether or not to require a space between the chat command and the arguments (useful for asay (@message))

The documentation shows ucl.registerAccess because that's how it was in the source code.

At the very top of the file (https://github.com/TeamUlysses/ulib/blob/master/lua/ulib/server/ucl.lua#L47), they have this line:
Code: Lua
  1. local ucl = ULib.ucl
  2.  

Which just makes it easier for them to write. Referencing outside of that file is still "ULib.ucl.registerAccess", remember it's all contained under the main "ULib" table.
Title: Re: This documentation...
Post by: mark272 on March 07, 2019, 10:58:39 AM
Ah thanks  ;D
But where is ulx.command in the documentation? I may not see it but the search gives nothing (good).
Title: Re: This documentation...
Post by: iViscosity on March 07, 2019, 11:05:49 AM
There is no official documentation for ulx, just ULib (actually I was working on documentation for ulx a while ago but kinda forgot about it)

You can find the source for ulx.command here (https://github.com/TeamUlysses/ulx/blob/master/lua/ulx/sh_base.lua#L58).
Title: Re: This documentation...
Post by: mark272 on May 11, 2019, 01:23:34 PM
Hello, sorry for the inconvenience.
Timmy I would appreciate it if you would continue filling up your docs. When you do them good, I may give you a donation via PayPal.
Title: Re: This documentation...
Post by: Timmy on May 11, 2019, 03:23:17 PM
Hi Mark - It's in the pipeline. Is there anything in particular that you'd like to see?