When I tried registering more than 50 scripts using luaRegister, it will randomly crash the game. It doesn't show an error, it just crashes.
I use a shortcut script to determine the name of the script I'm registering and directly apply that to the Lua reference name like so:
// luaEngineRegister(lua, script); if(!script_exists(argument1)) return 0; return luaRegister(argument0, script_get_name(argument1), argument1);
And here's what does the crashing.
lua = luaNew();
if(!lua) show_error("Failed to create a new Lua instance.", true);
// Register functions to the Lua instance
luaRegister(lua, "ShowMessage", ShowMessage);
luaRegister(lua, "GetFramerate", GetFramerate);
luaRegister(lua, "IsAltKeyDown", IsAltKeyDown);
luaRegister(lua, "IsShiftKeyDown", IsShiftKeyDown);
luaRegister(lua, "IsCtrlKeyDown", IsCtrlKeyDown);
luaRegister(lua, "Screenshot", Screenshot);
luaRegister(lua, "ReloadUI", ReloadUI);
luaLoadFile(lua, "Interface\base\Engine.lua");
//luaEngineRegister(lua, CreateFrame);
//luaEngineRegister(lua, MakeIntoActionBar);
//luaEngineRegister(lua, GetFont);
//luaEngineRegister(lua, GetJustifyH);
luaEngineRegister(lua, GetJustifyV);
luaEngineRegister(lua, GetText);
luaEngineRegister(lua, GetTextColor);
luaEngineRegister(lua, GetTextHeight);
luaEngineRegister(lua, GetTextWidth);
luaEngineRegister(lua, SetFont);
luaEngineRegister(lua, SetFontName);
luaEngineRegister(lua, SetJustifyH);
luaEngineRegister(lua, SetJustifyV);
luaEngineRegister(lua, SetText);
luaEngineRegister(lua, SetTextColor);
luaEngineRegister(lua, AddLine);
luaEngineRegister(lua, AddDoubleLine);
luaEngineRegister(lua, AddTexture);
luaEngineRegister(lua, AddWord);
luaEngineRegister(lua, NewLine);
luaEngineRegister(lua, ClearLines);
luaEngineRegister(lua, ClearAllPoints);
luaEngineRegister(lua, GetAlpha);
luaEngineRegister(lua, GetBottom);
luaEngineRegister(lua, GetCenterScreenX);
luaEngineRegister(lua, GetCenterScreenY);
luaEngineRegister(lua, GetCenterX);
luaEngineRegister(lua, GetCenterY);
luaEngineRegister(lua, GetHeight);
luaEngineRegister(lua, GetLeft);
luaEngineRegister(lua, GetRight);
luaEngineRegister(lua, GetScreenBottom);
luaEngineRegister(lua, GetScreenLeft);
luaEngineRegister(lua, GetScreenRight);
luaEngineRegister(lua, GetScreenTop);
luaEngineRegister(lua, GetTop);
luaEngineRegister(lua, GetWidth);
luaEngineRegister(lua, SetAllPoints);
luaEngineRegister(lua, SetAlpha);
luaEngineRegister(lua, SetDimensions);
luaEngineRegister(lua, SetHeight);
luaEngineRegister(lua, SetPoint);
luaEngineRegister(lua, SetWidth);
luaEngineRegister(lua, GetID);
luaEngineRegister(lua, GetName);
luaEngineRegister(lua, GetObjectType);
luaEngineRegister(lua, GetParent);
/*
luaEngineRegister(lua, GetScript);
luaEngineRegister(lua, Hide);
luaEngineRegister(lua, RegisterForClicks);
luaEngineRegister(lua, SetScript);
luaEngineRegister(lua, Show);
luaEngineRegister(lua, MakeVisible);
luaEngineRegister(lua, MakeInvisible);
luaEngineRegister(lua, Toggle);*/It doesn't matter which of these commented functions I call, 1 more of them (51 total) that I call, it will 100% guaranteed crash the program. I thought it might have been too much to handle at one time, so I split it up into alarm events separated by 6 steps each. On the 51st script call, it crashed the program. -DF81
Edit: Whoops! Hold on, I found the problem. Scratch what I wrote above.
Edited by DFortun81, 22 March 2011 - 12:51 AM.











