ULX

Author Topic: Disable chat messages from being broadcasted when using ULX commands.  (Read 19988 times)

0 Members and 1 Guest are viewing this topic.

Offline Timmy

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 252
  • Karma: 168
  • Code monkey
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #15 on: November 05, 2015, 04:48:18 PM »
Why is it in that hook? Autorun would work fine, no?
It's in that hook to make sure all ULib sayCmds are initialised before that piece of code runs.

Just putting it in autorun means you'd have no guarantee that all ULib and ULX modules are initialised.
« Last Edit: November 05, 2015, 05:15:29 PM by Timmy »

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #16 on: November 05, 2015, 05:25:09 PM »
Then put it in addons/addon/lua/ulx/modules?
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 Timmy

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 252
  • Karma: 168
  • Code monkey
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #17 on: November 05, 2015, 05:33:47 PM »
Then put it in addons/addon/lua/ulx/modules?

Putting something in ulx/modules guarantees ULX is initialised, but, it doesn't guarantee that all ULX commands (from other modules) are initialised. That's really important for this to work properly.

Edit: ULX modules are loaded alphabetically. I guess you could name the file zzzzz.lua and then that would work. :D
« Last Edit: April 23, 2016, 07:50:48 AM by Timmy »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #18 on: November 05, 2015, 07:13:25 PM »
We wrote in ULib hooks for a reason.
Timmy's example of using them is the most efficient way of guaranteeing stuff gets done "right".
Props for the thinking outside the 'modify Team Ulysses code' box using hooks we wrote to help prevent that ideology.

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Edned

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #19 on: November 08, 2015, 11:14:53 AM »
Thank you very much Timmy! It worked.
Thank you to everyone for their contributions.
Issue Resolved.