Luadch hub cmd manager 0.01

    --[[

            hub_cmd_manager.lua v0.01 by blastbeat

            - this script mangages permissions for certain adc commands

    ]]--

    local scriptname = "hub_cmd_manager"

    --// min levels to use a command //--

    local ctmlevel = 0
    local rcmlevel = 0
    local schlevel = 0
    local reslevel = 0
    local msglevel = 0    -- mainchat message
    local dmsglevel = 0    -- pm message

    hub:setListener( "onBroadcast", { },
        function( user )
            if user:getLevel( ) < msglevel then
                return PROCESSED
            end
            return nil
        end
    )

    hub:setListener( "onPrivateMessage", { },
        function( user )
            if user:getLevel( ) < dmsglevel then
                return PROCESSED
            end
            return nil
        end
    )

    hub:setListener( "onConnectToMe", { },
        function( user )
            if user:getLevel( ) < ctmlevel then
                return PROCESSED
            end
            return nil
        end
    )

    hub:setListener( "onRevConnectToMe", { },
        function( user )
            if user:getLevel( ) < rcmlevel then
                return PROCESSED
            end
            return nil
        end
    )

    hub:setListener( "onSearch", { },
        function( user )
            if user:getLevel( ) < schlevel then
                return PROCESSED
            end
            return nil
        end
    )

    hub:setListener( "onSearchResult", { },
        function( user )
            if user:getLevel( ) < reslevel then
                return PROCESSED
            end
            return nil
        end
    )

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