Is it possible to send a command to a bot rather than posting it in main chat. which then will activate the said command. This is because we sometimes get ops mistyping their commands and end up showing users what we type and it isnt very secure. The two commands im looking to use especially with this feature is a mass message and a banner script. (but the banner script being something that can be used to make it look like the bot talks and not a full banner).
Thankyou in advance :]
Well since normal users can't use those commands anyways ... what's not safe about it ?
If an OP wants to remain anonymous whilst posting.
Hi,
Just write return 1 in the end of every command and your problem is solved.
Best regards, nErBoS
i have the banner in channelbot. But is it possible to do another banner that simply posts in the main chat as a bot? (using an existing bot and not needing its own bot for this). Also, need a mass message script integrated in the same script if possible.
Thank you in advance :]
Hi,
You have to excuse my english not understanding the banner thing. Can you explain ??
Best regards, nErBoS
QuoteOriginally posted by nErBoS
Hi,
You have to excuse my english not understanding the banner thing. Can you explain ??
Best regards, nErBoS
he means the thing you see in my hub when i go for dinner. lol
plop
I mean a script that will let you send a message in main chat from the bot.
i.e. !botspeak Hi all how ya doing.
Then in mainchat you would see
Hi all how ya doing.
And all ops have this capability, but no user will know who said it ;)
Hi,
QuoteOriginally posted by plop
QuoteOriginally posted by nErBoS
Hi,
You have to excuse my english not understanding the banner thing. Can you explain ??
Best regards, nErBoS
he means the thing you see in my hub when i go for dinner. lol
plop
LOL :)
Here is it then...
--Requested by RDB
--Made by nErBoS
sBot = "Bot-ME"
function Main()
frmHub:RegBot(sBot)
end
function DataArrival(user, data)
if (strsub(data,1,1) == "<" or strsub(data,1,5+strlen(sBot)) == "$To: "..sBot) then
data = strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data, "%b<>%s+(%S+)")
if (cmd == "!botspeak" and user.bOperator) then
local s,e,msg = strfind(data, "%b<>%s+%S+%s+(%S+)")
if (msg == nil) then
user:SendPM(sBot, "Syntax Error, !botspeak , you must write a message.")
else
SendToAll(sBot, msg)
end
return 1
elseif (cmd == "!massmess" and user.bOperator) then
local s,e,msg = strfind(data, "%b<>%s+%S+%s+(%S+)")
if (msg == nil) then
user:SendPM(sBot, "Syntax Error, !massmess , you must write a message.")
else
SendPmToAll(sBot, msg)
end
return 1
end
end
end
Best regards, nErBoS
Perfect :-)
Thank You for the quick response :)
If i wanted to modify channelbot so that those commands were activated by typing to the bot like this one would it be easy? If so, further help required...
Also, ive noticed that certain characters end the message sent
i.e. !botspeak hey, how you all
In main chat users will see
<:HouseBot:> hey,
Is it posssible to stop this from happening?
Thank You in Advance
Added: The character that breaks the command is actually . So only oneword messages can be sent.
QuoteOriginally posted by RDB
Also, ive noticed that certain characters end the message sent
i.e. !botspeak hey, how you all
In main chat users will see
<:HouseBot:> hey,
Is it posssible to stop this from happening?
Thank You in Advance
yep but if you don't mind i'm gone leave it 2 nerbos 2 fix it.
@nerbos: last part of the pattern matching is wrong, it only captures 1 word, you wanne capture everything left in the string.
plop
Hi,
Sorry too many copy past :P...
Try this then...
--Requested by RDB
--Made by nErBoS
sBot = "Bot-ME"
function Main()
frmHub:RegBot(sBot)
end
function DataArrival(user, data)
if (strsub(data,1,1) == "<" or strsub(data,1,5+strlen(sBot)) == "$To: "..sBot) then
data = strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data, "%b<>%s+(%S+)")
if (cmd == "!botspeak" and user.bOperator) then
local s,e,msg = strfind(data, "%b<>%s+%S+%s+(.*)")
if (msg == nil) then
user:SendPM(sBot, "Syntax Error, !botspeak , you must write a message.")
else
SendToAll(sBot, msg)
end
return 1
elseif (cmd == "!massmess" and user.bOperator) then
local s,e,msg = strfind(data, "%b<>%s+%S+%s+(.*)")
if (msg == nil) then
user:SendPM(sBot, "Syntax Error, !massmess , you must write a message.")
else
SendPmToAll(sBot, msg)
end
return 1
end
end
end
Best regards, nErBoS
Thanks, and one last thing - i put that script in without changing bot name so now i got a new bot - how do i unreg a bot.
BTW.. Thank You for the script :)
QuoteOriginally posted by RDB
Thanks, and one last thing - i put that script in without changing bot name so now i got a new bot - how do i unreg a bot.
BTW.. Thank You for the script :)
run this script 1x with the name of the bot you wanne unregister from the userslist.
function Main()
frmHub:UnregBot("PlaceTheToBeRemovedBotNameHere")
end
plop
Thanks, works perfectly :)