ULX

Author Topic: Getting full line from a ulx concmd.  (Read 2748 times)

0 Members and 1 Guest are viewing this topic.

Offline ahref

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
Getting full line from a ulx concmd.
« on: April 12, 2009, 02:26:05 PM »
Im used to seeing ulx concms being used like this:
Code: [Select]
function ulx.cc_blah(ply, command, argv, args)
...
end
ulx.concommand( "blah", ulx.cc_blah, "blah", ULib.ACCESS_ADMIN, "!blah", _, ulx.ID_PLAYER_HELP )

I know how to extract different arguments from the line using argv. I however want the full line minus the !blah eg.

"player: !blah i went to the park"
i want to use in my code the "i went to the park" portion of the line. I presumed this was in the args variable but have had little luck getting it to do anything. Im sure im doing it wrong. So either im on the wrong track or im doing it wrong.

So could I have an example of how to do this please?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Getting full line from a ulx concmd.
« Reply #1 on: April 12, 2009, 05:58:43 PM »
Must be doing it wrong?
Your example when using ulx.concommand, <args> would absolutely be "i went to the park"
If you are not using ulx.concommand, but your own or Garry's hooks, yes, there will be differences.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: Getting full line from a ulx concmd.
« Reply #2 on: April 12, 2009, 06:20:05 PM »
args should be what you want. What value are you getting?
Experiencing God's grace one day at a time.

Offline ahref

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
Re: Getting full line from a ulx concmd.
« Reply #3 on: April 13, 2009, 03:23:35 AM »
whoops. Yet again i was using weird logic. I did a check for if the number of arguments was over 1 to then start parsing the full line only i used the wrong symbol. "<". Thanks for putting up with me and my sloppy coding :D