Fearless looking for geeks
#21
Code structure > "processing power"
In most cases at least.
#22
(01-17-2016, 09:20 PM)Astari Wrote: processing power wtf are you talking about its one freaking line, it adds like 0.00000001s to the execution time

Lol, you clearly dont know how to code properly.
#23
(01-17-2016, 09:20 PM)Astari Wrote: processing power wtf are you talking about its one freaking line, it adds like 0.00000001s to the execution time

It's about knowing when to move bytes to your base pointer, and when not to. I mean sure, you can go with a code structure and store a variable, but you'll save bytes if you don't. Saving a variable is not just demanding for the memory, it is also demanding for the garbage collector in Lua, wherein for example C++ it is done manually. On a small scale it you won't feel anything, no, but on a bigger scale you will.

(01-17-2016, 09:29 PM)Avgar Wrote: Code structure > "processing power"
In most cases at least.

To some points, but don't overcomplicate it. Most of the times people can understand what is going on. If you are unsure, you can always add comments; they are not compiled anyways.

But actually, I would have stored a variable IF "text" was called multiple times, because it would be faster to call the variable than to call "string.lower" X times.
#24
(01-17-2016, 09:30 PM)Wobbuffet Wrote:
(01-17-2016, 09:20 PM)Astari Wrote: processing power wtf are you talking about its one freaking line, it adds like 0.00000001s to the execution time

Lol, you clearly dont know how to code properly.

does it really matter to you how something on a forum is written out? do you have to cry at every response?
The following 1 user Likes Astari's post:
  • Wobbuffet
#25
(01-18-2016, 05:09 PM)Astari Wrote: does it really matter to you how something on a forum is written out? do you have to cry at every response?
You were the one that started correcting people, not me :b
And no im not crying, just pointing the obvious
#26
(01-18-2016, 05:16 PM)Wobbuffet Wrote:
(01-18-2016, 05:09 PM)Astari Wrote: does it really matter to you how something on a forum is written out? do you have to cry at every response?
You were the one that started correcting people, not me :b
And no im not crying, just pointing the obvious

yes, for a joke, you take things way to far to the point where i have to cringe because of how you're acting.
#27
Astari, Wobbuffet, you've deviated from the topic a tad bit too much, take it to PMs or TS.
The following 2 users Like Avgar's post:
  • Grunt, Wobbuffet
#28
(01-17-2016, 04:28 PM)Astari Wrote: lua error on line 1 c:


hook.Add("PlayerSay", "astarii", function ( ply, text, public )
text = string.lower( text )
if ( text == "!makeAstariContributor" ) then
RunConsoleCommand("ulx", "adduser", "astari", "contributor")
end)

yay

Error: Invalid command

(01-17-2016, 05:40 PM)Doctor Internet Wrote: Firstly, there is a function built into the GM for creation of commands.
Secondly, ULX isn't used on the servers, instead relying on a system built into the gamemode, built on (iirc) Evolve.
Merry Christmas.

There's also a framework in ULX to make commands but he was just making a joke

(01-17-2016, 07:31 PM)Zyphix Wrote: Yeah but that way he did it is if you want to just make a concommand... Sorta. (It hooks PlayerSay still)
Why store string.lower( text ) to a variable? Just use it in the "if" check lol, it's a waste of processing power. Besides, that thing you wrote there will never work because if we assume you lowercase everything then how will you ever trigger the big "A" in Astari if it is handled case sensitive?

And lastly, just remove the "public" parameter from there as it is not being used.

Again, ULX has a system for adding its own console commands. Also, that's not really a big waste of processing power. The mistake is not making text a local variable and like you said the incorrect casing. That said, it's a post on a forum and not something being added to anything....


Anyway,

glad to see the contributor program is still a thing
[Image: nypdcruiser.gif]
#29
(01-18-2016, 07:12 PM)Goigle Wrote:
(01-17-2016, 04:28 PM)Astari Wrote: lua error on line 1 c:


hook.Add("PlayerSay", "astarii", function ( ply, text, public )
text = string.lower( text )
if ( text == "!makeAstariContributor" ) then
RunConsoleCommand("ulx", "adduser", "astari", "contributor")
end)

yay

Error: Invalid command

(01-17-2016, 05:40 PM)Doctor Internet Wrote: Firstly, there is a function built into the GM for creation of commands.
Secondly, ULX isn't used on the servers, instead relying on a system built into the gamemode, built on (iirc) Evolve.
Merry Christmas.

There's also a framework in ULX to make commands but he was just making a joke

(01-17-2016, 07:31 PM)Zyphix Wrote: Yeah but that way he did it is if you want to just make a concommand... Sorta. (It hooks PlayerSay still)
Why store string.lower( text ) to a variable? Just use it in the "if" check lol, it's a waste of processing power. Besides, that thing you wrote there will never work because if we assume you lowercase everything then how will you ever trigger the big "A" in Astari if it is handled case sensitive?

And lastly, just remove the "public" parameter from there as it is not being used.

Again, ULX has a system for adding its own console commands. Also, that's not really a big waste of processing power. The mistake is not making text a local variable and like you said the incorrect casing. That said, it's a post on a forum and not something being added to anything....


Anyway,

glad to see the contributor program is still a thing

Technically it is a waste, but we are down to byte level so you will never feel it, unless it is repeated many, many times (retaining the codestyle). I think he even forgot an "end" to close the if, because "end)" closes the function. But then again, it is just a post on the forums.
#30
Did I start an argument? How fun.
Yours
Doctor Internet;

Developer, Systems Operator,
Data Protection Officer, Business Advisor,
Server Administrator, Community Moderator


Forum Jump:


Users browsing this thread: 1 Guest(s)