Page 2 of 2
Re: Have simple probleam
Posted: 22 Jan 2010, 04:23
by smoth
Good luck with whatever endeavor you pursue. Sorry for my shitty advice early on.
Re: Have simple probleam
Posted: 22 Jan 2010, 08:11
by Argh
error = 2, LuaRules/draw.lua, error = 2, LuaGadgets/gadgets.lua, [string "LuaGadgets/actions.lua"]:54: attempt to index local 'g' (a function value)
That kind of error halts gadgetHandler, IIRC, and can basically crash the whole Lua state for Gadgets.
IOW, if you have an error that bad (usually comes up with people attempting to port CA Gadgets, hmm) then you probably needed something from CA's Gadget files in the LuaRules directory (action.lua, system.lua, etc.) before it will operate.
So, removing that thing basically removed the conflict and allowed zwswg's code to operate.
Re: Have simple probleam
Posted: 22 Jan 2010, 09:46
by Forboding Angel
Yeah, morph has bricked evo gadgets before. Once you actually know what's going on the fix is fairly simple, but when you're staring at infolog going "OMGWTF?!?!?! GHEY!"... yeah.
Re: Have simple probleam
Posted: 22 Jan 2010, 20:09
by zwzsg
Voidranaut wrote:hay one last question
local MsgForMe=string.match(msg,message_identifier.."(.*)")
what significance is the red syntax?
It's a RegExp. Don't even try to understand that now.
Regular Expresions are very powerful, but very hard to come up with or even decode. Leave them to the Wizards.
The whole line though put into "MsgForMe" the part of the string "msg" that follows the identifier (or nil if there is no identifier).
Re: Have simple probleam
Posted: 22 Jan 2010, 20:35
by lurker
Specifically, () means "output the part inside the ()" and .* means "everything from here to the end".
But if you want a simpler method (which won't fail if the gadget name has certain weird things in it):
Code: Select all
if msg:sub(1,#message_identifier) == message_identifier then
local MsgForMe = msg:sub(#message_identifier + 1)
--stuff
end