• Print

Author Topic: Command Confusion  (Read 13327 times)

0 Members and 1 Guest are viewing this topic.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Command Confusion
« Reply #15 on: September 16, 2010, 04:19:49 pm »
The line here:

Code: Lua
  1. local imitate = ULib.cmds.TranslateCommand:instantiate( "ulx imitate", UImitate, "!im", true )

UImitate is nil, which is causing the error.
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Command Confusion
« Reply #16 on: September 16, 2010, 06:59:13 pm »
Emb, Meg will correct me on this if I'm wrong (and I often am when developing off the cuff like this), you're attempting to define your callback objects before you have the function.
Try placing the UImitate function before your local imitate object parms.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline EMB

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
Re: Command Confusion
« Reply #17 on: September 18, 2010, 06:08:04 am »
Ok, tried putting the function before adding the command, but now I get this error:

Code: [Select]
[addons\uimitate\lua\ulx\modules\uimitate.lua:13] attempt to index local 'imitate' (a nil value)

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Command Confusion
« Reply #18 on: September 18, 2010, 06:37:40 am »
Ok, tried putting the function before adding the command, but now I get this error:

Code: [Select]
[addons\uimitate\lua\ulx\modules\uimitate.lua:13] attempt to index local 'imitate' (a nil value)

Please share your full source so far.
Experiencing God's grace one day at a time.

Offline EMB

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
Re: Command Confusion
« Reply #19 on: September 19, 2010, 03:15:47 am »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Command Confusion
« Reply #20 on: September 19, 2010, 08:35:45 am »
Thanks for updating the post with the full source. Try removing the ':instantiate'. I thought I coded it to work either way but perhaps not. That would make that full line as follows:
Code: Lua
  1. local imitate = ULib.cmds.TranslateCommand( "ulx imitate", UImitate, "!im", true )
Experiencing God's grace one day at a time.

Offline EMB

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
Re: Command Confusion
« Reply #21 on: September 19, 2010, 08:43:22 am »
K, I'll try that.
BTW that post already had the full source, although the two main parts have now been swapped.

Edit: Ok, it now works, although I did have to change
Code: [Select]
imitate:defaultAccess( ULib.ACCESS_OWNER ) -- Who has access by default.to
Code: [Select]
imitate:defaultAccess( "superadmin" ) -- Who has access by default.because it wanted a string and I remembered that not all servers have an owner group. And I had to change a few other gramatical errors :D

Edit2: Chat commands dont seem to work...
« Last Edit: September 19, 2010, 01:18:56 pm by EMB »

Offline EMB

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
Re: Command Confusion
« Reply #22 on: September 27, 2010, 12:10:05 pm »
Anyone know why chat commands and auto-complete don't work?
And before you all start going on about bumping, I always think it's better to bump than to start a new thread.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Command Confusion
« Reply #23 on: September 27, 2010, 01:48:29 pm »
For chat commands, do you get an error from using the chat command, or does nothing happen whatsoever?

As far as autocomplete, are you remembering to run the code to create the command on both server and client?

For bumps, if you have something substantially new to add, please bump it.
Experiencing God's grace one day at a time.

Offline EMB

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
Re: Command Confusion
« Reply #24 on: September 30, 2010, 10:21:29 am »
Hmm, no errors for the chat it just doesnt work.
And how would I get it to run on the client, I already have it in the ulx\modules folder. (Addon format of course.)

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Command Confusion
« Reply #25 on: October 02, 2010, 05:52:30 pm »
Sorry for the slow response. I tested your code and the say command works fine for me. Do the standard ULX say commands work on your client?

As far as autocomplete, move the script from ulx\modules to ulx\modules\sh and you should start getting autocomplete.
Experiencing God's grace one day at a time.

Offline EMB

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
Re: Command Confusion
« Reply #26 on: October 03, 2010, 04:07:41 am »
Don't worry about the slow response, and yes normal say commands work fine.
I'll try moving the script and see what effect that has.

  • Print