Code: Select all
function widget:GetInfo()
return {
name = "Force Repeat ON",
desc = "Turn repeat ON on all units during their creation",
author = "zwzsg",
date = "August 8, 2007",
license = "Free",
layer = 0,
enabled = true -- loaded by default
}
end
function widget:UnitCreated(unitID, unitDefID, unitTeam)
local ud = UnitDefs[unitDefID]
if(unitTeam == Spring.GetMyTeamID()) then
Spring.GiveOrderToUnit(unitID, CMD.REPEAT, { 1 }, {})
Spring.Echo("Repeat order issued on " .. ud.name)
end
end
I guess that lua is not allowed to give order during the first instant of the game. Why? Can be fixed? How do I workaround it?
I'm trying to fix Kernel Panic for 75b2. And amongst other thing, I need the autospam script to work again, and it'd be much nicer if that included the kernel.