Stripped from my bot
sBot = "Mass-Message";
sPrefix = "!";
CmdOpt = {
["massmaster"] = {
[0] = 1,
[1] = 1,
[2] = 0,
[3] = 0,
[-1] = 0,
},
["massop"] = {
[0] = 1,
[1] = 1,
[2] = 0,
[3] = 0,
[-1] = 0,
},
["massvip"] = {
[0] = 1,
[1] = 1,
[2] = 1,
[3] = 0,
[-1] = 0,
},
["massreg"] = {
[0] = 1,
[1] = 1,
[2] = 1,
[3] = 0,
[-1] = 0,
},
["massall"] = {
[0] = 1,
[1] = 1,
[2] = 0,
[3] = 0,
[-1] = 0,
}
};
function Main()
frmHub:RegBot(sBot);
end
function ChatArrival(user,data)
data=string.sub(data,1,-2);
local s,e,cmd = string.find(data,"^%b<>%s+(%S+)");
local Prefix = string.sub(cmd,1,1);
if (Prefix == sPrefix) then
cmd = string.lower(string.sub(cmd,2,string.len(cmd)));
if (Commands[cmd]) then
return (Commands[cmd](user,data))
end
end
end
Commands = {
["massmaster"] =
function(user,data)
if (Denial("massmaster",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(1,Msg,nil,user);
end,
["massop"] =
function(user,data)
if (Denial("massop",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(1,Msg,nil,user);
end,
["massvip"] =
function(user,data)
if (Denial("massvip",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(2,Msg,nil,user);
end,
["massreg"] =
function(user,data)
if (Denial("massreg",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(3,Msg,nil,user);
end,
["massall"] =
function(user,data)
if (Denial("massall",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(-1,Msg,1,user);
end
};
function MassMessage(ProfileIdx, Msg, bToAll, user)
if (bToAll) then
SendPmToAll(sBot,Msg);
user:SendData(sBot,"Your message has been sent!");
return 1;
end
for i,v in frmHub:GetOnlineUsers() do
if (v.iProfile == ProfileIdx) then
v:SendPM(sBot,Msg);
end
end
user:SendData(sBot,"Your message has been sent!");
return 1;
end
function Denial(Table, user)
if (CmdOpt[Table][user.iProfile] ~= 1) then
user:SendData(sBot,"You are not allowed to use this command!");
return 1;
end
end
Is it possible to have the same script with a graphic message
Exemple :
-------------------------------------------------------------------------
-- Message send by : --
-- --
-- --
-------------------------------------------------------------------------
With this exemple or better (lol)
Thank you
Here goes a fast one:
sBot = "Mass-Message";
sPrefix = "!";
CmdOpt = {
["massmaster"] = {
[0] = 1,
[1] = 1,
[2] = 0,
[3] = 0,
[-1] = 0,
},
["massop"] = {
[0] = 1,
[1] = 1,
[2] = 0,
[3] = 0,
[-1] = 0,
},
["massvip"] = {
[0] = 1,
[1] = 1,
[2] = 1,
[3] = 0,
[-1] = 0,
},
["massreg"] = {
[0] = 1,
[1] = 1,
[2] = 1,
[3] = 0,
[-1] = 0,
},
["massall"] = {
[0] = 1,
[1] = 1,
[2] = 0,
[3] = 0,
[-1] = 0,
}
};
function Main()
frmHub:RegBot(sBot);
end
function ChatArrival(user,data)
data=string.sub(data,1,-2);
local s,e,cmd = string.find(data,"^%b<>%s+(%S+)");
local Prefix = string.sub(cmd,1,1);
if (Prefix == sPrefix) then
cmd = string.lower(string.sub(cmd,2,string.len(cmd)));
if (Commands[cmd]) then
return (Commands[cmd](user,data))
end
end
end
Commands = {
["massmaster"] =
function(user,data)
if (Denial("massmaster",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(1,Msg,nil,user);
end,
["massop"] =
function(user,data)
if (Denial("massop",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(1,Msg,nil,user);
end,
["massvip"] =
function(user,data)
if (Denial("massvip",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(2,Msg,nil,user);
end,
["massreg"] =
function(user,data)
if (Denial("massreg",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(3,Msg,nil,user);
end,
["massall"] =
function(user,data)
if (Denial("massall",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(-1,Msg,1,user);
end
};
function MassMessage(ProfileIdx, Msg, bToAll, user)
local MassSend = function(user,Msg,Profile)
local msg = "\r\n\r\n\t"..string.rep("-",100).."\r\n"
msg = msg.."\t-- Sender: "..user.sName.."\r\n\r\n"
msg = msg.."\t-- To: "..Profile.."\r\n"
msg = msg.."\t-- Message: "..Msg.."\r\n"
msg = msg.."\t"..string.rep("-",100)
return msg
end
if (bToAll) then
SendPmToAll(sBot,MassSend(user,Msg,"All"));
user:SendData(sBot,"Your message has been sent!");
return 1;
end
for i,v in frmHub:GetOnlineUsers() do
if (v.iProfile == ProfileIdx) then
v:SendPM(sBot,MassSend(user,Msg,GetProfileName(ProfileIdx)));
SendPmToOps(sBot,"Report of Mass Message:"..MassSend(user,Msg,GetProfileName(ProfileIdx)))
end
end
user:SendData(sBot,"Your message has been sent!");
return 1;
end
function Denial(Table, user)
if (CmdOpt[Table][user.iProfile] ~= 1) then
user:SendData(sBot,"You are not allowed to use this command!");
return 1;
end
end
Thank you for your help.
function MassMessage(ProfileIdx, Msg, bToAll, user)
if (bToAll) then
SendPmToAll(sBot,Msg);
user:SendData(sBot,"Your message has been sent!");
return 1;
end
for i,v in frmHub:GetOnlineUsers() do
if (v.iProfile == ProfileIdx) then
v:SendPM(sBot,Msg);
end
end
user:SendData(sBot,"Your message has been sent!");
return 1;
end
Is it possible to have a copy of the send message ???
Thank you again
QuoteOriginally posted by chettedeboeuf
Is it possible to have a copy of the send message ???
What do you mean with that? I didn't get it.
Best regards
Yes I would have a copy of the send message when you send this message :
user:SendData(sBot,"Your message has been sent!");
We have few board for PtokaX in french and I have some problems with english
Thank you
I have a question that is not too ontopic, but if I would like to send mass message the way Verli does, I have to use a raw like this, don't I?
for _,obj in frmHub:GetOnlineUsers() do
obj:SendData([color=#CC33CC]"$To: "..obj.sName.." From: "..botname.."$ hi all!"[/color])
end
QuoteOriginally posted by chettedeboeuf
Yes I would have a copy of the send message when you send this message :
user:SendData(sBot,"Your message has been sent!");
We have few board for PtokaX in french and I have some problems with english
Thank you
I still don't understand what you mean... That report message is always sent to the user who uses the mass command.
You can explain it in french if you want.
Cheers
Merci
Je voudrais avoir une copie du message envoy? quand le script envoie 'Your message has been sent!'
Exemple :
Report of mass-message
Sender :
To :
Message :
Et seulement aux OPs et Admins
Merci
to bastya :hmm i guess it could work :)
and chettedeboeuf, thats simple to do, if somebody doesnt do it tomorrow ill do it,:)
QuoteOriginally posted by Dessamator
to bastya :hmm i guess it could work :)
OK, thx, sorry for having these questions but my knowledge definitely needs a /refresh. :D
QuoteOriginally posted by chettedeboeuf
Merci
Je voudrais avoir une copie du message envoy? quand le script envoie 'Your message has been sent!'
Exemple :
Report of mass-message
Sender :
To :
Message :
Et seulement aux OPs et Admins
Merci
First post updated with your request.
Best regards
Thank you jiten
Oupsss : I've a question, what means 'jiten' ??
QuoteOriginally posted by chettedeboeuf
Thank you jiten
Oupsss : I've a question, what means 'jiten' ??
You're welcome :]
What does "jiten" means?
Well, I don't have an exact answer for that, but, if I'm not wrong a part of it means "victory". Don't know of the whole word :D
Cheers
hi :)
i need this script with message to unregs. thx
try this :
sBot = "Mass-Message";
sPrefix = "!";
CmdOpt = {
["massmaster"] = {
[0] = 1,
[1] = 1,
[2] = 0,
[3] = 0,
[-1] = 0,
},
["massop"] = {
[0] = 1,
[1] = 1,
[2] = 0,
[3] = 0,
[-1] = 0,
},
["massvip"] = {
[0] = 1,
[1] = 1,
[2] = 1,
[3] = 0,
[-1] = 0,
},
["massreg"] = {
[0] = 1,
[1] = 1,
[2] = 1,
[3] = 0,
[-1] = 0,
},
["massall"] = {
[0] = 1,
[1] = 1,
[2] = 0,
[3] = 0,
[-1] = 0,
},
["massunreg"] = {
[0] = 1,
[1] = 1,
[2] = 0,
[3] = 0,
[-1] = 0,
}
};
function Main()
frmHub:RegBot(sBot);
end
function ChatArrival(user,data)
data=string.sub(data,1,-2);
local s,e,cmd = string.find(data,"^%b<>%s+(%S+)");
local Prefix = string.sub(cmd,1,1);
if (Prefix == sPrefix) then
cmd = string.lower(string.sub(cmd,2,string.len(cmd)));
if (Commands[cmd]) then
return (Commands[cmd](user,data))
end
end
end
Commands = {
["massmaster"] =
function(user,data)
if (Denial("massmaster",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(1,Msg,nil,user);
end,
["massop"] =
function(user,data)
if (Denial("massop",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(1,Msg,nil,user);
end,
["massvip"] =
function(user,data)
if (Denial("massvip",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(2,Msg,nil,user);
end,
["massreg"] =
function(user,data)
if (Denial("massreg",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(3,Msg,nil,user);
end,
["massall"] =
function(user,data)
if (Denial("massall",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(-1,Msg,1,user);
end,
["massunreg"] =
function(user,data)
if (Denial("massunreg",user) == 1) then return 1 end
local s,e,Msg = string.find(data,"^%b<>%s+%S+%s+(.*)");
return MassMessage(-1,Msg,nil,user);
end,
};
function MassMessage(ProfileIdx, Msg, bToAll, user)
local MassSend = function(user,Msg,Profile)
local msg = "\r\n\r\n\t"..string.rep("-",100).."\r\n"
msg = msg.."\t-- Sender: "..user.sName.."\r\n\r\n"
local Profile = Profile or "Unreg"
msg = msg.."\t-- To: "..Profile.."\r\n"
msg = msg.."\t-- Message: "..Msg.."\r\n"
msg = msg.."\t"..string.rep("-",100)
return msg
end
if (bToAll) then
SendPmToAll(sBot,MassSend(user,Msg,"All"));
user:SendData(sBot,"Your message has been sent!");
return 1;
end
for i,v in frmHub:GetOnlineUsers() do
if (v.iProfile == ProfileIdx) then
v:SendPM(sBot,MassSend(user,Msg,GetProfileName(ProfileIdx)));
SendPmToOps(sBot,"Report of Mass Message:"..MassSend(user,Msg,GetProfileName(ProfileIdx)))
end
end
user:SendData(sBot,"Your message has been sent!");
return 1;
end
function Denial(Table, user)
if (CmdOpt[Table][user.iProfile] ~= 1) then
user:SendData(sBot,"You are not allowed to use this command!");
return 1;
end
end