Jump to content
  • 0

Optimization


Jedynak

Question

Posted

My English is weak, so I use a translator

Hi, I need a little assistance in the optimization of their scripts. Now, how to write them most optimally?

I know the LUA, but with this I have a big problem.

How to do:

- Correct triggers

- When you want to assign something, use the variable, and can setElementData array?

- Have any way to replace loops something else, give August wogole right?

In addition, it would be nice to hear your advice, what to avoid that these scripts run smoothly! Thank you.

3 answers to this question

Recommended Posts

  • 0
Posted
My English is weak, so I use a translator

Hi, I need a little assistance in the optimization of their scripts. Now, how to write them most optimally?

I know the LUA, but with this I have a big problem.

How to do:

- Correct triggers

- When you want to assign something, use the variable, and can setElementData array?

- Have any way to replace loops something else, give August wogole right?

In addition, it would be nice to hear your advice, what to avoid that these scripts run smoothly! Thank you.

For the first question, there isn't much to tell. Simply avoid triggering too many events repeatedly and sending too much data at once (a few megabytes, not kilobytes) - that could cause a network trouble.

Regarding loops, it depends much on the context - e.g. if you are just trying to find a value in a table and the table's values are in an ordered way (must be numbers), you can use the binary search algorithm.

As for your second question, I'm sorry but I didn't understand it.

I used to know how to code, but then I took an arrow in the knee.

Project Redivivus - Remaking Old School MTA With New Code

MTA 0.6 Nightly 1 released

  • 0
Posted
Have any way to replace loops something else, give August wogole right?

Fixed translation:

Is there any way to replace loops with something else, is this even possible?

He can't write proper Polish, so translation is even worse than it should be. He already posted same question in Polish section.

I don't understand why he tries to remove loops completely. And what does he mean by "loops" (as there are many loop statements).

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...