New Window
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

New Window

Started by RDB, 17 April, 2004, 21:43:18

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RDB

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

nErBoS

Hi,

Remove this line...

SendToAll( data )

Best regards, nErBoS
--## nErBoS Spot ##--

RDB

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

Sprinting

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

nErBoS

#4
Hi,

Here you had the "SendToAll( data )" put this...

SendToOps( data )

Best regards, nErBoS
--## nErBoS Spot ##--

RDB

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

nErBoS

Hi,

Try this then...

SendToOps(BotName, data)

Best regards, nErBoS
--## nErBoS Spot ##--

pHaTTy

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;
Resistance is futile!

RDB

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  :(

Snooze

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

SMF spam blocked by CleanTalk