Hi,
Was a request, finished it, and here is it published.
-- Automatic BOT replyer, by PM
-- Created by TTB, 17-10-05
-- Request from Leun
--------------------------------------------
bots = {
["[BOT]CBS"] = 1,
["[BOT]Predator"] = 1,
}
bot = "PMreport"
WhoAreTheOps = {
[-1] = 1, -- Users
[0] = 1, -- Masters
[1] = 0, -- OPs
[2] = 0, -- VIPs
[3] = 0, -- REGs
[4] = 1, -- MODs
[5] = 1, -- Founders
}
function Main()
frmHub:RegBot(bot)
end
function OpSend(msg)
for i,v in frmHub:GetOnlineUsers() do
if WhoAreTheOps[v.iProfile] == 1 then
v:SendPM(bot,msg)
end
end
end
function ToArrival(curUser,data)
local _,_,whoTo,mes = string.find(data,"$To:%s+(%S+)%s+From:%s+%S+%s+$(.*)")
if (bots[whoTo]==1 and string.find(mes,"%b<>%s+(.*)")) then
data = string.sub(mes,1,string.len(mes)-1)
curUser:SendPM(whoTo, "I'm a BOT! So that means I'm stupid and only configured by someone who is smarter than me. Please PM to PMtoOPs for your questions...")
OpSend("The user: "..curUser.sName.." was trying to talk to me: "..mes)
end
end
This should be the last script you load in PtokaX!! Otherwise you will have problems by your commands from your other bots!
QuoteOriginally posted by TTB
This should be the last script you load in PtokaX!! Otherwise you will have problems by your commands from your other bots!
good work, if tested it, and it works great !!!!!!!!
Thnx,
QuoteOriginally posted by Markitos
QuoteOriginally posted by TTB
This should be the last script you load in PtokaX!! Otherwise you will have problems by your commands from your other bots!
Because.... The script only just catches if there is a ToArrival to the bot(s). If there is, it will reply. But... let me explain it by example:
You run RoboCop. Type in PM to the bot !help. After this command, robocop will end this with a "return 1" which means, no other script can catch this when it is loaded AFTER robocop.
So, when the script is loaded before RoboCop, this script will catch it first, and after that the command will be catched by Robocop, even when the command exists!
I hope you understand...
QuoteOriginally posted by TTB
QuoteOriginally posted by Markitos
QuoteOriginally posted by TTB
This should be the last script you load in PtokaX!! Otherwise you will have problems by your commands from your other bots!
Because.... The script only just catches if there is a ToArrival to the bot(s). If there is, it will reply. But... let me explain it by example:
You run RoboCop. Type in PM to the bot !help. After this command, robocop will end this with a "return 1" which means, no other script can catch this when it is loaded AFTER robocop.
So, when the script is loaded before RoboCop, this script will catch it first, and after that the command will be catched by Robocop, even when the command exists!
I hope you understand...
Yep thnks!