I currently use this script
BotName = "Hub bot"
Files = {
["+hubnews"] = "Section/news.txt",
["+com"] = "Section/commands.txt",
["+links"] = "Section/links.txt", --If you're using CHANEEL, don't uncomment this line
}
function Main()
end
function DataArrival(user, data)
if( strsub(data, 1, 1) == "<" ) then
s,e,msg = strfind(data, "%b<> ([ -z]*)")
for key, value in Files do
if( strfind( strlower(msg), key) ) then
txtToShow, x = gsub(value, "%b[]", user.sName)
SendToAll( data )
Show(user, TheFile)
return 1
end
end
end
end
function Show(user, TheFile)
readfrom(txtToShow, "r")
local message = ""
while 1 do
local line = read()
if line == nil then break
else
message = message..line.."\r\n"
end
end
user:SendPM(BotName, message)
readfrom()
return 1;
end
However, the commands arent supressed in main, i.e. they are shown in main chat. Ive been told to add return 1 in there - but its already there.
Any help greatly appreciated.
Thank you in advance
Hi,
Remove this line...
SendToAll( data )
Best regards, nErBoS
Thanks, that works, is it possible to have the command, instead, sent to all OPs? so ops know who is typing it in in case the hub starts to lag they will have a fair idea of what is going on.
Thanks in advance
even if that script was used properly and not abused, don't you think that pm'ing all ops when it is used would get a little annoying? I know my ops wouldn't want it but it's your hub.......
cheers
Hi,
Here you had the "SendToAll( data )" put this...
SendToOps( data )
Best regards, nErBoS
unfortunately ops do not get that message ?(
Using:
BotName = "HouseBot"
Files = {
["!gun"] = "Files/gun.txt",
["!p"] = "Files/p.txt",
["!kickass"] = "Files/kickass.txt", --If you're using CHANEEL, don't uncomment this
line
}
function Main()
end
function DataArrival(user, data)
if( strsub(data, 1, 1) == "<" ) then
s,e,msg = strfind(data, "%b<> ([ -z]*)")
for key, value in Files do
if( strfind( strlower(msg), key) ) then
txtToShow, x = gsub(value, "%b[]", user.sName)
SendToOps( data )
Show(user, TheFile)
return 1
end
end
end
end
function Show(user, TheFile)
readfrom(txtToShow, "r")
local message = ""
while 1 do
local line = read()
if line == nil then break
else
message = message..line.."\r\n"
end
end
SendToAll(BotName, message)
readfrom()
return 1;
end
Hi,
Try this then...
SendToOps(BotName, data)
Best regards, nErBoS
first of all please remember to use the [code ] [ /code] tag around the script
ok u could do
SendToOps(user.sName,msg)
BotName = "HouseBot"
Files = {
["!gun"] = "Files/gun.txt",
["!p"] = "Files/p.txt",
["!kickass"] = "Files/kickass.txt", --If you're using CHANEEL, don't uncomment this line
}
function DataArrival(user, data)
if( strsub(data, 1, 1) == "<" ) then
local s,e,msg = strfind(data, "%b<> ([ -z]*)")
for key, value in Files do
if( strfind( strlower(msg), key) ) then
txtToShow, x = gsub(value, "%b[]", user.sName)
SendToOps(user.sName,msg)
Show(TheFile)
return 1;
end;
end;
end;
end;
function Show(TheFile) -- Was no point sending user
readfrom(txtToShow, "r")
local message = "\r\n"
while 1 do
local line = read()
if line == nil then break
else
message = message..line.."\r\n"
end;
end;
SendToAll(message) --Dont really need the bot name ;-)
readfrom()
return 1;
end;
Thanks.
Would it be possible to have this sent in a pm thru the hub's bot? I tried changing
SendToOps(user.sName,msg)
TO:
SendPMToOps(user.sName,msg)
But no luck :(
just change
SendPMToOps(user.sName,msg)
to
SendPmToOps(user.sName,msg)
You had a BIG 'PM' in there when it should have been 'Pm'.
Good luck..
**Snooze