Rzn
Junior Member
Posts: 55
|
Post by Rzn on Nov 1, 2005 9:48:46 GMT -5
It would be nice to have lunar delete all objects created by the script or have a lunar command that does it.
Its not that big of a deal i just keep for getting to add that last unloading if
|
|
|
Post by TinyTerror on Nov 1, 2005 9:56:24 GMT -5
You mean a command that exits the script? I'm not sure what you mean by objects besides text and primitive objects. For those you can use Graphics.text_DeleteAll( ) or Graphics.primitive_DeleteAll( ) to delete all text or primitives owned by the script. There is an undocumented command called Scriptrunner.scriptExit( ) that is used by the execution hook to shut down a script. Calling it will trigger the hook, stopping your script, deleting all its graphics, and flagging it for auto unload. I haven't actually tried calling this from a script. Normally it is injected into the lua state as part of the hooking mechanism when you load a script. Give it a try. The worst that can happen is that FFXI will crash.
|
|
Rzn
Junior Member
Posts: 55
|
Post by Rzn on Nov 1, 2005 10:03:04 GMT -5
For example my when my tab bot finishes it auto unloads. Without the text_Deleteall statment the text is stuck on screen. it would be easyer (from a script writers point of view) to have lunar do the text_DeleteAlll when the script is unloaded.
In testing I have for goten to add the text_DeleteAll so when the script unloads i'm stuck with text on screen(untell i crash it again) This is where a .Lunar DeleteAll command would come in handy.
EDIT: even with spell check i can't get it right
|
|
|
Post by TinyTerror on Nov 1, 2005 10:07:35 GMT -5
Hmm. Lunar does unload text and graphics when a script is unloaded. Are you sure your script is actually finishing? Does Lunar say that such and such script has finished execution? If not, this might be yet another bug.
|
|
Rzn
Junior Member
Posts: 55
|
Post by Rzn on Nov 1, 2005 10:14:21 GMT -5
It only stays if you unload a running loop. think it works other wise i'll test to when i wake up tho.
|
|
|
Post by TinyTerror on Nov 1, 2005 11:22:29 GMT -5
So you are stopping the script with .Lunar unload, and the graphics are still there after the script unloads?
|
|
Rzn
Junior Member
Posts: 55
|
Post by Rzn on Nov 1, 2005 21:41:32 GMT -5
If a script finishes executing and does not have a text_DeleteAll the text object stays on screen.
also if a script errors while running it will leave its object behind but not always.
on a side note it seems lunar is not reusing the memory it has used to run a script. I've noticed after running a lot of scripts pol.exe's memory usage is through the roof also in some cases an error ed script will keep using more and more memory until it cases a Vmem error and windows nukes it.
|
|
|
Post by TinyTerror on Nov 1, 2005 22:33:39 GMT -5
Yeah, that would be a memory leak. Im working on plugging them, but something of lunar's complexity has a lot of malloc calls.
|
|
|
Post by TinyTerror on Nov 2, 2005 0:31:00 GMT -5
Well, I checked the script unloader code, and sure enough, there is a memory leak. Lunar will fail to release the memory used by a script if the script
1) Runs into an error during execution 2) Finishes execution without being manually unloaded first
Depending on the type of script you are running, this can turn into alot of memory really fast. I missed this error because of the distributed nature of the lunar shutdown sequence for scripts. There is code spread around 3 different classes used to handle unloading, and I missed a giant memory leak. This is why I don't like working alone. I miss stupid shit like this that I should have caught before the first release. Anyway, its on the todo list.
|
|
Rzn
Junior Member
Posts: 55
|
Post by Rzn on Nov 2, 2005 0:35:43 GMT -5
If you need a second pair of eyes i don't mind helping tho i am still very much learning
|
|
|
Post by TinyTerror on Nov 2, 2005 0:40:28 GMT -5
You would need to have a lot of experience with c++ and multi threaded programming to make much sense of the lunar source. Even then it would be a problem because Lunar contains some sensitive info that cliff and starhawk don't really want getting out right now.
|
|
Rzn
Junior Member
Posts: 55
|
Post by Rzn on Nov 2, 2005 0:49:32 GMT -5
I really don't know alot of c++ only thing i've tried to make used windowerhelper.dll to input commands from actool it worked but far from well.
i understand not wanting the plugin and ffact info geting out.
|
|