Luadch hub cmd manager 0.01

Post finished Hubside Scripts here, known supporting hubsofts for LUA scripting.

ADCH++ | DCWatch | LUADCH
Post Reply
Toast

Luadch hub cmd manager 0.01

Post by Toast » 23 Aug 2008, 13:04

Code: Select all

    --[[

            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 **" )

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests