(first, iam sorry for bad topic :( )
http://board.univ-angers.fr/thread.php?threadid=4187&boardid=26&sid=c219552736fd0e4b64d765fcdba756c9
the only thing i need from this awesome script is Mass Message to all... so can somebody shrink this script to fit my purpose.
Thanks for your help ?(
Will this do?
-- QDM (quick-and-dirty mass) by bastya_elvtars
masscmd="massmess" -- no ! needed
Bot="LawMakerBornAgain" -- use your hub bot's name
masslev=4 -- 1: all, 2: reg & above, 3: vip & above, 4: op & su, 5: su only
------------------------------------------------------------------------------------
userlevels={ [-1] = 1, [0] = 5, [1] = 4, [2] = 3, [3] = 2 } -- rights management, no need to edit unless you use robo
-- do not edit below
function massmsg(user,data,env)
local _,_,message=string.find(data,"%b<>%s+%S+%s+(.+)")
if message then
for _,obj in frmHub:GetOnlineUsers() do
obj:SendData("$To: "..obj.sName.." From: "..Bot.." $<"..user.sName.."> "..message)
end
else
SendTxt(user,env,Bot,"Please write the message too, im not a politician to keep telling nothing...=)")
end
end
function ChatArrival(user,data)
data=string.sub(data,1,string.len(data)-1)
local _,_,cmd=string.find(data,"%b<>%s+[%!%+%#](%S+)")
if cmd==masscmd then
if userlevels[user.iProfile]>=masslev then
massmsg(user,data,"MAIN")
else
SendTxt(user,env,Bot,"You are not allowed...")
end
return 1
end
end
function SendTxt(user,env,bot,text)
if env=="PM" then
user:SendPM(bot,text)
else
user:SendData(bot,text)
end
end
function Main()
frmHub:RegBot(Bot)
end
Works perfect, thank you bastya... you are allmost my personal hero :P