Luadch Mem Script

--// settings begin //--

local scriptname = "cmd_mem"

local cmd = "mem"

--// settings end //--

local hubcmd

local onbmsg = function( user, command, parameters, txt )
    local a = ( collectgarbage "count" ) / 1024
    collectgarbage( )
    local b = ( collectgarbage "count" ) / 1024
    user:reply( "Speicher: " .. a .. " / " .. b )
    return PROCESSED
end

hub.setlistener( "onStart", { },
    function( )
        hubcmd = hub.import "etc_hubcommands"    -- add hubcommand
        assert( hubcmd )
        assert( hubcmd.add( cmd, onbmsg ) )
        return nil
    end
)

hub.debug( "** Loaded " .. scriptname .. ".lua **" )