Little error maybe :? - Page 2
 

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

Little error maybe :?

Started by Davey, 18 July, 2007, 12:57:06

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Davey

Hi madman,

I have test it but when I say a bad word, nothing that happend, only that the word doesn't show
Only by the bad word Fuck he is disconnecting me, but with my other words nothing...
I have found allready the trouble
on line 202 return 1 <<--- this must be deleted
Now he works with all the words ;-)

Thnx madman with your help

Madman


Yup, i was just going to tell you that,
the return 1 blocks the loop.
besides your return SendPmToOps line allready have a return 1, so the word still won't show
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Davey

#27
Hmm when adding a new function to it i get this error
HelpFullyv1.2.lua:225: unexpected symbol near '='
And if I remove the = I must go remove >
Can somebody Help.

Trouble Solved ;-)

6Marilyn6Manson6

Change:

for key,a in BlockAdverFile do =>for key,a in pairs(BlockAdverTable) do


with:

for key,a in pairs(BlockAdverTable) do

Davey

thnx m8
it is working perfectly now :-)

6Marilyn6Manson6


Davey

Hey,

I have add bad search detection to it, but when a user search to it, nothing happend...  :'(
I get No errors in it, but I think im forgot something ?? But what ?? Can't find it out lol
Can somebody help ?
SearcArrivel begins from line 240
This is the code of hole script

--// FunBot and Helpfully bot made by [NL]Davey?]
--// Version 1.2 has the follow things :-->
--// New Commands: 1) Check for bad nick name, 2) Who get rc commands, 3) Block Advertise in PM!
--// Removed :: Debugger
--// Thnx to [NL]Daddy-Bear with reporting the follow message ::
--// Important if you running the opsecurity lua then this lua must be above it in the list from PX other wile you get no RC

------------------------------------Configuration------------------------------------------------
BotName = "HelpFully"           -- The Name of your bot [ duhh ]
Start = 1                       -- Start with script restarting 1 = yes  0 = no
Mins = 1                        -- Interval between the message's if put on by !talkon or RC command
SendMain = "on"                 -- Send Message to Main on/off
LogiN = "on"                    -- Send Login Message on/off 
RC_Name = "HelpFully"           -- The name of your RIght Click 
Owner = "Your Name"             -- Owner Name 
FriendlyHubsFile = "FriendlyHubs.txt"
MessagesFile = "Messages.txt"
BadnicknameFile = "BadNick.txt"
BadWordsFile = "BadWords.txt"
BlockAdverFile = "BlockAdver.txt"
BadSearch = "BadSearch.txt"
--------------------------------------End Configuration------------------------------------------

-------------Who Get the Rc Commands?------------------------------------------------

ProFile = {			-- Give a Profile Rc Commands  1 = Yes 0 = No
 [0] = 1,			-- Master  
 [1] = 0,			-- Operator  
 [2] = 0,			-- VIP  
 [3] = 0,			-- Registered  
 [4] = 0,			-- Moderator  
 [5] = 1,			-- Netfounder
 [6] = 1,			-- Owner  
 [-1] = 0,			-- Unregistered  
}
-------------End of Who get the Rc Commands--------------------------------------------

FriendlyTable = {}
MessaGeTable = {}
BadnicknameTable = {}
BadWordsTable = {}
BlockAdverTable = {}
BadSearchTable = {}

tables = {
	FriendlyHubsFile,
	MessagesFile,
	BadnicknameFile,
	BadWordsFile,
	BlockAdverFile,
	BadSearchFile
}
for _,file in pairs(tables) do
	local f,e = io.open(file, "a+" ) if f then f:write("" ) f:close() end
	dofile(file)
end

function Main()
	frmHub:RegBot(BotName)
	SetTimer(Mins*60000)
	dofile("Messages.txt")
	string.gmatch = (string.gmatch or string.gfind);
end

function OnTimer()
	if Start==1 then
		local MessaGe = MessaGeTable[math.random(1,table.maxn(MessaGeTable))]
		SendToAll(BotName,MessaGe)
	end
end

function NewUserConnected(user)
	if ProFile[user.iProfile] == 0 then
	user:SendData("$UserCommand 1 3 "..RC_Name.."\\Show Avaible Commands for me$<%[mynick]> !help&amp;#124;")
	user:SendData("$UserCommand 1 3 "..RC_Name.."\\Ask for Vip Satus$<%[mynick]> !askvip&amp;#124;")
	user:SendData("$UserCommand 1 3 "..RC_Name.."\\Show Friendly Hubs$<%[mynick]> !showhub&amp;#124;")
	end
	if ProFile[user.iProfile] == 1 then
		user:SendData("$UserCommand 1 3 "..RC_Name.."\\HelpBot\\LogiN\\LogiN Messages On$<%[mynick]> !LogiNOn&amp;#124;")
		user:SendData("$UserCommand 1 3 "..RC_Name.."\\HelpBot\\LogiN\\LogiN Messages Off$<%[mynick]> !LogiNOff&amp;#124;")
		user:SendData("$UserCommand 1 3 "..RC_Name.."\\HelpBot\\Talk Bot\\Talker On$<%[mynick]> !talkon&amp;#124;")
		user:SendData("$UserCommand 1 3 "..RC_Name.."\\HelpBot\\Talk Bot\\Talker Off$<%[mynick]> !talkoff&amp;#124;")
		user:SendData("$UserCommand 1 3 "..RC_Name.."\\HelpBot\\Bot\\Show me the Bot Commands$<%[mynick]> !mhelp&amp;#124;")
		user:SendData("$UserCommand 1 3 "..RC_Name.."\\HelpBot\\Friendly\\Add a Friendly Hub$<%[mynick]> !addhub %[line:Minshare NO Ammount!] %[line:b/kb/mb/gb/tb] %[line:Adress] %[line:Hubname]&amp;#124;")
		user:SendData("$UserCommand 1 3 "..RC_Name.."\\HelpBot\\Friendly\\Delete a Friendly Hub$<%[mynick]> !delhub %[line:name or all]&#124:")
		user:SendData("$UserCommand 1 3 "..RC_Name.."\\HelpBot\\Friendly\\Show Friendly Hubs$<%[mynick]> !showhub&amp;#124;")
		user:SendData("$UserCommand 1 3 "..RC_Name.."\\?Login And Register MessaGe By [NL]Davey?$<%[mynick]>&amp;#124;")
		end
end


OpConnected = NewUserConnected

OnError = function(msg)
	SendPmToOps(BotName,"Hi. I have found an error. Please notify [NL]Davey with the follow message : "..msg)
end

ChatArrival = function(user,data)
	local data = string.sub(data,1,-2)
	local _,_,cmd = string.find(data,"%b<>%s+(%S+)")
	if cmd =="!askvip" then
		SendPmToOps(BotName,"\r\n\t"..user.sName.." with Ip "..user.sIP.." want become a vip in this hub .")
		user:SendData(BotName,"Your request has been send! please be Patient !")
		return 1
	end
	if cmd =="!showhub" then
		if next(FriendlyTable) then
			local disp = "\r\n\t"..string.rep("- -",20).." Friendly Hubs "..string.rep("- -",20).."\r\n"
			disp = disp.."\t\r\n"
			for v, I in pairs(FriendlyTable) do
				disp = disp.."\t\tName:  "..v.."\tAddress: "..FriendlyTable[v][3].."\tMinshare: "..FriendlyTable[v][1]..""..FriendlyTable[v][2].."\r\n"
			end
			disp = disp.."\r\n\t"..string.rep("- -",49)..""
			user:SendPM(BotName, disp)
		else
			user:SendData(BotName,"There are no friendly hubs added")
		end
		return 1
	end
		if ProFile[user.iProfile] == 0 then
			if cmd =="!LogiNOff" or cmd =="!LogiNOn" or cmd =="!mhelp" or cmd =="!delhub" or cmd =="!addhub" or cmd =="!talkoff" or cmd =="!talkon" then
				user:SendData(BotName,"Sorry, But you don't have acces to use this function!!!")
		return 1
	end
end
  	if ProFile[user.iProfile] == 1 then
		if cmd =="!talkon" then
			SendToAll(BotName,"\r\n\t "..user.sName.." is enabeling the TalkeR :-D, Whiiiii !!")
		StartTimer()
			if SendMain == "off" then
				SendMain = "on"
			end
			return 1
		end
		if cmd =="!talkoff" then
			SendToAll(BotName,"\r\n\t "..user.sName.." Is disabeling the TalkeR :-(, Bye !!")
			if SendMain == "on" then
				SendMain = "off"
				StopTimer()
			end
			return 1
		end
		if cmd =="!mhelp" then
			user:SendPM(BotName,"\r\n\t Here are all avaible Commands for your Profile!.\r\n\r\n\t !talkon   -- The bot go On\r\n\t !talkoff   -- The bot go Off \r\n\t !addhub   --  Add a friendly hub to your Friendly Hub List! \r\n\t !delhub   --  Remove a friendly hub from your Friendly list \r\n\t !showhub   --  Shows you the added friendly hubs! \r\n\t\ !LogiNOn  -- Enable the LogiN MessaGes \r\n\t\ !LogiNOff -- Disable the LogiN MessaGes \r\n\t !mhelp -- Show this page \r\n\t !help  -- All avaible commands for your pofile ")
			return 1
		end
		if cmd =="!addhub" then
			local _,_,cmd,minshare,what,addy,name = string.find(data,"%b<>%s+(%S+)%s+(%S+)%s+(%S+)%s+(%S+)%s+(.*)")
			if FriendlyTable[name]== nil then
				if minshare and what and addy and name then
					FriendlyTable[name] ={minshare,what,addy}
					saveTableToFile(FriendlyHubsFile,FriendlyTable,"FriendlyTable")
					SendToOps(BotName,""..user.sName.." has added : "..name.." to the Friendly Hub List !!")
				else
					user:SendData(BotName, "Command is ::  !addhub <minshare> <b/kb/mb/gb/tb> <address> <hub name>!!!")
				end
			else
				user:SendData(BotName,"Sorry, but the hub : "..name.." is allready in my Friendly List !!")
			end
			return 1
		end
	end
	if cmd =="!delhub" then
		local s,e,what = string.find(data, "%b<>%s+%S+%s+(.*)")
		if what then
			if what == "all" then
				SendToOps(BotName,"All Friendly Hubs Are been Deleted By: "..user.sName)
				FriendlyTable = {}
				saveTableToFile(FriendlyHubsFile,FriendlyTable,"FriendlyTable")
				return 1
			end
			if FriendlyTable[what] then
				FriendlyTable[what] = nil
				saveTableToFile(FriendlyHubsFile,FriendlyTable,"FriendlyTable")
				SendToOps(BotName,"Hub NameD: "..what.." is removed from the Friendly Hub List by: "..user.sName)
			end
	return 1
	end
end
	if cmd =="!LogiNOn" then
	            if LogiN == "off" then
				LogiN = "on"
				SendToAll(BotName, " "..user.sName.." has enabled the LogiN messages!")
				end
			return 1
	    end
	if cmd =="!LogiNOff" then
	            if LogiN == "on" then
				LogiN = "off"
				SendToAll(BotName, " "..user.sName.." has disabled the LogiN messages !")
				end
			return 1
			else
--			if ProFile[user.iProfile] ~= 1 then
			if cmd =="!LogiNOff" or cmd =="!LogiNOn" or cmd =="!delhub" or cmd =="!addhub" or cmd =="!talkoff" or cmd =="!talkon" or cmd =="!mhelp" then
				user:SendData(BotName,"Sorry, But you don't have acces to use this function!!!")
			return 1
--		end
      else
      if not user.bOperator then
       local s,e,msg = string.find(string.lower(data), "^%b<>(.+)")
		for word in string.gmatch(msg,"%S+") do
			for key,val in ipairs(BadWordsTable) do
				if word == string.lower(val) then
					return SendPmToOps(BotName," "..user.sName.." Is Disconnected "..
					"because he has try to say : "..data),user:SendData(BotName,user.sName..", "..
					"You has try to say "..word.." This word isn't allowed in here!."),user:Disconnect(),1
				end		
			end
			collectgarbage("collect")
		end
	 end
  end
 end
end

MyINFOArrival = function(user,data)
	for _,bad in pairs(BadnicknameTable) do
		local bad,nick = bad:lower(),user.sName:lower()
		if nick:find(bad) then
			user:SendData(BotName,"You are been disconnected for using a badnickname! Change it and come back")
			SendPmToOps(BotName," "..user.sName.." with ip "..user.sIP.." is been disconnected because: Using a Bad NickName!!")
			user:Disconnect()
		end
	end
end

function ToArrival(user, data) 
if user.iProfile ~= 0  and user.iProfile ~= 2 and user.iProfile ~= 3 then
for key,a in pairs(BlockAdverTable) do
if( string.find(string.lower(data), key) ) then 
         user:SendPM(BotName, "No,no,no don't avdertise to other peoples!!!")
         SendPmToOps(BotName, " "..user.sName.." with Ip "..user.sIP.." has tryed to send this "..data.." ")		 
         return 1 
         end 
     end 
  end 
end 

SearchArrival = function(user,data)
	if user.iProfile ~= 0  and user.iProfile ~= 2 and user.iProfile ~= 3 then
	local s,e,what = string.find(data, "$Search %S+%s%S+?%S+?%S+?%S+?(.*)|")
		for deny,key in pairs(BadSearchTable) do
			if string.find(what,deny) then
				BadSearch_Message(user,what,deny)
				SendPmToOps(BotName,BotName,"\n\n\tBAD SEARCH DETECTED !!\n\t?Info: "..user.sName.." / "..user.sIP.."\n\t?Searched: "..what.."\n\t?Blocked by: "..deny.."\n")
				user:SendData("TTH:BLOCKEDBYHELPFULLY ("..frmHub:GetHubIp()..":"..frmHub:GetHubPort()..")")
				return 1
		end
	end
end
end

saveTableToFile = function(file, table, tablename)
	local handle = io.open(file,"w")
	Serialize(table,tablename,handle)
   	handle:close()
	io.flush()
end

6Marilyn6Manson6

Reply SearchArrival with this: (not tested)

SearchArrival = function(user,data)
	if user.iProfile ~= 0  and user.iProfile ~= 2 and user.iProfile ~= 3 then
		for deny,key in pairs(BadSearchTable) do
		if string.find(string.lower(what,deny)) then
			local s,e,what = string.find(data, "$Search %S+%s%S+?%S+?%S+?(%S+)?(.*)")
				BadSearch_Message(user,what,deny)
				SendPmToOps(BotName,BotName,"\n\n\tBAD SEARCH DETECTED !!\n\t?Info: "..user.sName.." / "..user.sIP.."\n\t?Searched: "..what.."\n\t?Blocked by: "..deny.."\n")
				user:SendData("TTH:BLOCKEDBYHELPFULLY ("..frmHub:GetHubIp()..":"..frmHub:GetHubPort()..")")
				return 1
			end
		end
	end
end

Davey

Hi,

I have test it but I got No messages
And it's not block the Bad Search


6Marilyn6Manson6

Hi, now I'm doing a backup of Windows, when it has finish, I can star with test, sorry  :'(

Davey

Oki, im also trying some thing to get it working, but without any suc6...
Hope whe can fix it soon!

SMF spam blocked by CleanTalk