• Print

Author Topic: I can't remember how to ULX, someone give me a hand?  (Read 6247 times)

0 Members and 1 Guest are viewing this topic.

Offline MagisterMortalis

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
I can't remember how to ULX, someone give me a hand?
« on: January 11, 2015, 12:53:43 am »
I can only do the basics now, it's been a long time since I last coded with LUA and haven't touched ulx for a very long time.
The thing I'm trying to code would be really simple, but I'm clearly missing something and once it's pointed out to me, I will feel really stupid because it's very simple.

I'm trying to create a command, when you use it on someone it says in chat "Person has poked SomeDude." I've got most of the basics down, with the targeting, but I can't seem to figure out how to make fancyLog to display in chat.

Someone lead me in the correct direction, I have no idea what to put in the code to make this work, my knowledge is gone, please.

Code: Lua
  1. function ulx.test( calling_ply, target_ply )
  2.  
  3.         ulx.fancyLog( calling_ply, "#A tested a command on #T", target_plys )
  4. end
  5. local test = ulx.command( CATEGORY_NAME, "ulx test", ulx.test, "!test" )
  6. test:addParam{ type=ULib.cmds.PlayerArg, target="!^", ULib.cmds.ignoreCanTarget }
  7. test:defaultAccess( ULib.ACCESS_ADMIN )
  8. test:help( "daw dawd aw" )
  9.  

A little more info, I have no idea if I use fancyLogAdmin, or fancyLog. I need to learn to do this again.

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: I can't remember how to ULX, someone give me a hand?
« Reply #1 on: January 11, 2015, 01:06:48 am »
idk about your fancylog or fancylogadmin problem

But I know on line 3 of that you're trying to use target_plys even though on line 1 you called the variable target_ply
That might be why it's not showing up in chat

Offline MagisterMortalis

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: I can't remember how to ULX, someone give me a hand?
« Reply #2 on: January 11, 2015, 01:08:06 am »
idk about your fancylog or fancylogadmin problem

But I know on line 3 of that you're trying to use target_plys even though on line 1 you called the variable target_ply
That might be why it's not showing up in chat
Let me try that now, thanks for pointing that out.
Edit: Nope, that's a shame, still not working.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: I can't remember how to ULX, someone give me a hand?
« Reply #3 on: January 11, 2015, 07:14:18 am »
For the example code you've shown, besides fixing the variable name, you want the fancyLogAdmin.
Also, make sure you're defining CATEGORY_NAME in your command object setup somewhere else in your file or you can change it at that spot.
fancLogAdmin allows for a "optional" 2nd parameter, a boolean, that if not present, defaults to false.

ulx.fancyLogAdmin( calling_ply, true, "#A tested a command on #T", target_ply )
would HIDE from players (except admins with see echo access)
ulx.fancyLog( calling_ply, "#A tested a command on #T", target_ply )
would not hide from players

Error's your getting would be helpful to us in helping you.


« Last Edit: January 11, 2015, 07:16:02 am by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MagisterMortalis

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: I can't remember how to ULX, someone give me a hand?
« Reply #4 on: January 11, 2015, 07:39:48 pm »
I'm getting no errors, as the code is all correct, just it's not showing anything in chat.

Edit: as you said, fancyLogAdmin works, but is silent. Is there some kind of different format I need to follow for fancyLog?
« Last Edit: January 11, 2015, 07:49:46 pm by MagisterMortalis »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: I can't remember how to ULX, someone give me a hand?
« Reply #5 on: January 11, 2015, 07:53:10 pm »
Use ulx.fancyLogAdmin. As you have it now, it's only echoing to the calling_ply. Make sure you're checking the ULX log files too, they may help you figure out what's going on.
Experiencing God's grace one day at a time.

Offline MagisterMortalis

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: I can't remember how to ULX, someone give me a hand?
« Reply #6 on: January 11, 2015, 08:06:01 pm »
Use ulx.fancyLogAdmin. As you have it now, it's only echoing to the calling_ply. Make sure you're checking the ULX log files too, they may help you figure out what's going on.
Just checked the ULX log files, nothing. What would I have to do to make it echo to all? calling_ply, true? Sorry for being such a newb.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: I can't remember how to ULX, someone give me a hand?
« Reply #7 on: January 11, 2015, 08:34:30 pm »
Pass it nil for the first argument. Are you using ulx.fancyLogAdmin?
Experiencing God's grace one day at a time.

Offline MagisterMortalis

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: I can't remember how to ULX, someone give me a hand?
« Reply #8 on: January 11, 2015, 09:39:59 pm »
fancyLogAdmin, yes. Pass what nil? O.O

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: I can't remember how to ULX, someone give me a hand?
« Reply #9 on: January 12, 2015, 03:20:41 pm »
Replace the first parameter, calling_ply, with nil (any var, such as _, that isn't defined)

There are plenty of examples of how it's used different ways within our codebase.
Simply have to search our github repo.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

  • Print