View previous topic :: View next topic |
Author |
Message |
ByTransient Expert Cheater Reputation: 5
Joined: 05 Sep 2020 Posts: 240
|
Posted: Fri May 28, 2021 11:23 am Post subject: What is "limit 200"? |
|
|
I am trying to make a great Trainer and although it is halfway it is in 2500 lines for now.
I do not use the form designer, instead I create 70 panels, Edit, Label.
I create them all in the "local" header to be able to use them again.
But it warns that the CE limit for the "local" heading (track) is 200.
Also "=" repeats this sign in the same error.
Note: When I remove the "local" phrase from the beginning of the created objects (GroupBox, Panel, Label, Edit), it continues to give errors for no reason and the Trainer (when clicking Execute Script) does not open.
Where am I doing wrong?
|
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Fri May 28, 2021 11:33 am Post subject: |
|
|
lua only allows 200 local variables in any given code. If you're getting errors with globals then it's probably variables using the same names but not holding what is expected, hard to say without any info on the errors. Try breaking things up into smaller chunks using functions, objects, and modules.
_________________
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Fri May 28, 2021 12:39 pm Post subject: |
|
|
tip: use a local table and fill that with all the data
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
ByTransient Expert Cheater Reputation: 5
Joined: 05 Sep 2020 Posts: 240
|
Posted: Sat May 29, 2021 8:06 am Post subject: |
|
|
I made a test table (1 Edit, 1 Button, 2 Memo, 1 Label)
I put the error free script (2500 lines) in memo1, (if the last 400 lines with errors are added (2500+400)) I wrote "local" in Edit and pressed the button to scan.
Result; There are 248 "local" phrases (all lines starting with "local" came to memo2) and only 11 seem to have used the same word. "local codeIndex1", I changed = "codeIndex1".
I fixed them. Note: It was excerpted from the code that worked fine in the previous Trainer. "local codeIndex1"
Now I will test and add 2500+.
I hope there will be no problems.
EDIT :
DarkByte, you want to say;
Code: | myTrainer={}
myTrainer.form = createForm()
myTrainer.form.Popupmode = 0;
myTrainer.form.Position = poDesktopCenter
myTrainer.Btn1=createButton(myTrainer.form)
myTrainer.Btn1.left=25
myTrainer.Btn1.top=25
myTrainer.Btn1.caption="Click me" |
Is this what you want to say?
Since I'm constantly testing, I need to kill it, how can I do that?
"myTrainer.Destroy()" throws an error or "myTrainer=nil" is not working.
I don't want to re-create "Timers" especially created.
Is there a way to kill it under construction?
EDIT 2:
Code: | if myTrainer.form then myTrainer.form.Destroy() end
myTrainer={}
myTrainer.form = createForm()
myTrainer.form.Popupmode = 0;
myTrainer.form.Position = poDesktopCenter
myTrainer.Btn1=createButton(myTrainer.form)
myTrainer.Btn1.left=25
myTrainer.Btn1.top=25
myTrainer.Btn1.caption="Click me" |
This worked.
I hope the "myTrainer={}" table works.
2500 lines will be difficult to adapt to this.
|
|
Back to top |
|
|
|