Ulysses

General => Developers Corner => Topic started by: [TNet] Chadness Everdeen on September 05, 2016, 07:16:11 AM

Title: Gather a command's Arguments
Post by: [TNet] Chadness Everdeen on September 05, 2016, 07:16:11 AM
Hello,
I am very new to this stuff and im creating a command panel for a scoreboard and obviously bans require a reason and a length whereas something like a kick just needs a target.

Is there an easy way to determine the arguments needed?

Thanks,
Chad Masters
Title: Re: Gather a command's Arguments
Post by: iViscosity on September 05, 2016, 07:24:19 AM
"ulx help" will give you a list of commands and their parameters on your server that you can use.
Title: Re: Gather a command's Arguments
Post by: [TNet] Chadness Everdeen on September 05, 2016, 07:28:07 AM
Hey,
thank you for a reply but i meant a table. Because ill be putting it into a list so that the user can pick the command they want and execute it with ease. But to do that i will need to check whether it needs a target, reason, number value etc...

I've got each command into the list but i want to be able to determine what input options to show, e.g a text input box or a slider.
Title: Re: Gather a command's Arguments
Post by: iViscosity on September 05, 2016, 07:31:37 AM
Hm... I guess I'm still a bit confused. What "table" do you want to get them in?
Title: Re: Gather a command's Arguments
Post by: [TNet] Chadness Everdeen on September 05, 2016, 07:37:06 AM
Im probably not explaining it enough.

I have a list that i have put all the commands that the player has access to.
So the next step is for me to overlay a button over each command which is easy.

We shall use the ban command for an instance. We know that the ban command needs a target, a reason and a number value for how long they are banned for.
But we dont specifically know this with every command, especially ulx commands from other addons so i need to make sure i get them all automatically.

Is that a little bit clearer?

thanks
Title: Re: Gather a command's Arguments
Post by: iViscosity on September 05, 2016, 07:38:51 AM
I think I get it, but like I said if you use ulx help it will show you every command and its required and optional commands.
Title: Re: Gather a command's Arguments
Post by: [TNet] Chadness Everdeen on September 05, 2016, 07:53:04 AM
I need to do that but without human input,
I dont want to be sitting there inputting every argument. I think there is a table but its extremely confusing.

It has an args table inside it but nothing is clear.
Title: Re: Gather a command's Arguments
Post by: iViscosity on September 05, 2016, 07:59:06 AM
Hm.... Maybe make checks for PlayerArg, StringArg, those types of things... Then add the appropriate input or whatever.
Title: Re: Gather a command's Arguments
Post by: Megiddo on September 05, 2016, 08:27:25 AM
It's not as simple as I'd like it to be, but all the information you need to do this is stored under "ULib.cmds.translatedCmds".
Title: Re: Gather a command's Arguments
Post by: Bite That Apple on September 06, 2016, 04:23:33 AM
Isn't XGUI easy enough?
Title: Re: Gather a command's Arguments
Post by: roastchicken on September 06, 2016, 11:31:05 AM
Isn't XGUI easy enough?

I'm with Apple. What you're describing is basically just XGUI. Why do you need your own solution?
Title: Re: Gather a command's Arguments
Post by: Undercover Orange on September 06, 2016, 01:35:45 PM
there is a scoreboard like this on scriptfodder if you are willing to spend i think $6 on it