ULX

Author Topic: Gather a command's Arguments  (Read 2702 times)

0 Members and 1 Guest are viewing this topic.

Offline [TNet] Chadness Everdeen

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Gather a command's Arguments
« 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

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Gather a command's Arguments
« Reply #1 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.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline [TNet] Chadness Everdeen

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Gather a command's Arguments
« Reply #2 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.

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Gather a command's Arguments
« Reply #3 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?
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline [TNet] Chadness Everdeen

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Gather a command's Arguments
« Reply #4 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

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Gather a command's Arguments
« Reply #5 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.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline [TNet] Chadness Everdeen

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Gather a command's Arguments
« Reply #6 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.

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Gather a command's Arguments
« Reply #7 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.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Gather a command's Arguments
« Reply #8 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".
Experiencing God's grace one day at a time.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Gather a command's Arguments
« Reply #9 on: September 06, 2016, 04:23:33 AM »
Isn't XGUI easy enough?
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Gather a command's Arguments
« Reply #10 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?
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Undercover Orange

  • Full Member
  • ***
  • Posts: 139
  • Karma: -14
  • Leader of Undercover Gaming Community
Re: Gather a command's Arguments
« Reply #11 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
~ Undercover Orange