--[[ cmd_mass.lua v0.04 by blastbeat - this script adds a command "mass" to send a pm mass message - usage: [+!#]mass - changelog 0.04: - updated script api ]]-- --// settings begin //-- local permission = { -- who is allowed to use this command? [ 0 ] = false, -- unreg [ 10 ] = false, -- guest [ 20 ] = false, -- reg [ 30 ] = true, -- vip [ 40 ] = true, -- svip [ 60 ] = true, -- operator [ 80 ] = true, -- admin [ 100 ] = true, -- hubowner } local msg_denied = "You are not allowed to use this command." local msg_usage = "Usage: +mass " local cmd = "mass" --// settings end //-- local utf_match = utf.match hub:setListener( "onStart", { }, function( ) local help = hub.import "cmd_help" if help then help.reg( "mass", "[+!#]mass ", "sends a pm with to all users", 30 ) end return nil end ) hub:setListener( "onBroadcast", { }, function( user, adccmd, txt ) local command, parameters = utf_match( txt, "^[+!#](%a+) ?(.*)" ) if command == cmd then if not permission[ user:getLevel( ) ] then user:reply( msg_denied, hub.getbot( ) ) return PROCESSED end local msg = utf.match( parameters, "^(%S+)" ) if not msg then user:reply( msg_usage, hub.getbot( ) ) else hub.broadcast( msg, user, user ) end return PROCESSED --// dont send cmd to hub and other scripts end return nil end ) hub.debug( "** Loaded cmd_mass.lua **" )