Pls help with this script
 

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

Pls help with this script

Started by jack_port1000, 19 June, 2007, 10:41:45

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jack_port1000

befor i was used PtokaX 0.3.5.2. with Rcup  now i useing Ptokax 0.3.4.0.dbg with Terminator i was use thsi script in
0.3.5.2.  its work good this script is best for me now this script not work with 0.3.4.0. every thing going k no error loaed bot but its not stop badword so can u pls change this script for me or any error then pls solve it Thanks in Advance
[14:00] badword.lua loaded.
[14:00] badword.lua loaded.

local sBot = frmHub:GetHubBotName() 
local trigs = {"fuck","coaie","suck","sucks","suckz","blow","fucker","chutiya",
"madarchod","chodu","bhadva","bhadve","chut","lund","lavde","lavdu","bhenchod","madarchot","madar",
"rand","randi","chod","chinal","gand","jatu","lundfakir","lavda","bastard",} 

function ChatArrival (user, data)
	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(trigs) do
				if word == string.lower(val) then
					return SendPmToOps(sBot," "..user.sName.." Try to sent "..
					"this message in Main----> "..data),user:SendData(sBot,user.sName..", "..
					"please don't use words like "..word.." in this hub order by AnnA  Reconnect to hub."),user:Disconnect(),1
				end 
			end
		end
	end 
end

Leun

try this:

local trigs = {"fuck","coaie","suck","sucks","suckz","blow","fucker","chutiya",
"madarchod","chodu","bhadva","bhadve","chut","lund","lavde","lavdu","bhenchod","madarchot","madar",
"rand","randi","chod","chinal","gand","jatu","lundfakir","lavda","bastard",} 

function ChatArrival (user, data)
	if not user.bOperator then
		local s,e,msg = string.find(string.lower(data), "^%b<> (.+)|$")
		for word in string.gfind(msg,"%S+") do
			for key,val in ipairs(trigs) do
				if word == string.lower(val) then
					return SendPmToOps(sBot," "..user.sName.." Try to sent "..
					"this message in Main----> "..data),user:SendData(sBot,user.sName..", "..
					"please don't use words like "..word.." in this hub order by AnnA  Reconnect to hub."),user:Disconnect(),1
				end 
			end
		end
	end 
end


I changed string.match with string.gfind. So I think your 0.3.4.0 is using LUA 5.0 en the script you past is for LUA 5.1

greetz

jack_port1000

tanx for help but still not work :'(

Naithif

Quote from: swagat_j on 19 June, 2007, 12:20:15
tanx for help but still not work :'(

Give a try replacing

local s,e,msg = string.find(string.lower(data), "^%b<> (.+)|$")


with

local s,e,msg = string.find(string.lower(data),  "%b<>%s+(.*)|")



jack_port1000


Leun

OK maby this one:

-- Set BotName
sBot = frmHub:GetHubBotName()

local trigs = {"fuck","coaie","suck","sucks","suckz","blow","fucker","chutiya",
"madarchod","chodu","bhadva","bhadve","chut","lund","lavde","lavdu","bhenchod","madarchot","madar",
"rand","randi","chod","chinal","gand","jatu","lundfakir","lavda","bastard",} 

function Main ()
	string.gmatch = (string.gmatch or string.gfind); 
end

function ChatArrival (user, data)
	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(trigs) do
				if word == string.lower(val) then
					return SendPmToOps(sBot," "..user.sName.." Try to sent "..
					"this message in Main----> "..data),user:SendData(sBot,user.sName..", "..
					"please don't use words like "..word.." in this hub order by AnnA  Reconnect to hub."),user:Disconnect(),1
				end 
			end
		end
	end 
end


I can't test it yet, I'm still at the office
But I changed:
for word in string.gmatch(msg,"%S+") do

into
for word in string.gmatch(msg,"(%S+)") do


Hopefully it works now,

Greetz

jack_port1000

tanx again all but sorry dude still same problem and thanks a lot Greetz tat u help from ur work place its ok u when u come to ur home then work on it tanx again

Naithif

As far as the script doesn't give any error, nobody's closer any place  ;D (and I guess it looks ok)

string.gmatch or string.gfind would have to give an error message doesn't it? Or only the new PtokaX gives?

(removing 'local' before trigs?  :-\ Guess I'm desperate or what, but isn't local refers to 'within function/chunk'?)

jack_port1000

is tat posible tat i use terminator bot it stop this script? bec no error in script showing to me also but when use any bad word in hub its discoonect to tat user but now its cant disconnect , i was used  PtokaX 0.3.5.2 with robcop in tat its work proper but now i use ptokax 0.3.4.0.dbg with terminator bot  "! ! ! ']['?RM???']['?R V1.Rev 7c ! ! ! By ??????Hawk??????  is Active."  its not work in this only there nothing error but why its not work

bastya_elvtars

Everything could have been anything else and it would have just as much meaning.

jack_port1000

with new is terminotor work?

Psycho_Chihuahua

Here you go - fixed the script and added CheckProfiles settings - tested as Reg User and even as Master and it works

-- Set BotName
sBot = frmHub:GetHubBotName()
HubOwner = "Psycho_Chihuahua"
CheckProfiles = {
	[0] = 1,    -- =[Master]=
	[1] = 1,    -- =[OP]=
	[2] = 1,    -- =[ViP]=
	[3] = 1,    -- =[Reg]=
	[4] = 1,    -- =[Custom Profile 1]=
	[5] = 1,    -- =[Custom Profile 2]=
	[-1] = 1,   	-- =[UnReg]=
}


local trigs = {"fuck","coaie","suck","sucks","suckz","blow","fucker","chutiya",
"madarchod","chodu","bhadva","bhadve","chut","lund","lavde","lavdu","bhenchod","madarchot","madar",
"rand","randi","chod","chinal","gand","jatu","lundfakir","lavda","bastard",} 

function Main ()
	string.gmatch = (string.gmatch or string.gfind); 
end

function ChatArrival (user, data)
	if CheckProfiles[user.iProfile] == 1 then
		local s,e,msg = string.find(string.lower(data), "^%b<> (.+)|$")
		for word in string.gmatch(msg,"(%S+)") do
			for key,val in ipairs(trigs) do
				if word == string.lower(val) then
					return SendPmToOps(sBot," "..user.sName.." Try to sent "..
					"this message in Main----> "..data),user:SendData(sBot,user.sName..", "..
					"please don't use words like "..word.." in this hub order by "..HubOwner.."  Reconnect to hub."),user:Disconnect(),1
				end 
			end
		end
	end 
end
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

jack_port1000

Tanx a lot all bastya_elvtars  u great man problem slove ;)
There is   "reg Chat" in my hub there if any one use badword bot cant disconnect them so what add in this script that also work in regchat

-- Set BotName
sBot = frmHub:GetHubBotName()
HubOwner = "Psycho_Chihuahua"
CheckProfiles = {
	[0] = 1,    -- =[Master]=
	[1] = 1,    -- =[OP]=
	[2] = 1,    -- =[ViP]=
	[3] = 1,    -- =[Reg]=
	[4] = 1,    -- =[Custom Profile 1]=
	[5] = 1,    -- =[Custom Profile 2]=
	[-1] = 1,   	-- =[UnReg]=
}


local trigs = {"fuck","coaie","suck","sucks","suckz","blow","fucker","chutiya",
"madarchod","chodu","bhadva","bhadve","chut","lund","lavde","lavdu","bhenchod","madarchot","madar",
"rand","randi","chod","chinal","gand","jatu","lundfakir","lavda","bastard","maderchod","lodu","bhosda","landus","bhadwa","harami","motherfucker",} 

function Main ()
	string.gmatch = (string.gmatch or string.gfind); 
end

function ChatArrival (user, data)
	if CheckProfiles[user.iProfile] == 1 then
		local s,e,msg = string.find(string.lower(data), "^%b<> (.+)|$")
		for word in string.gmatch(msg,"(%S+)") do
			for key,val in ipairs(trigs) do
				if word == string.lower(val) then
					return SendPmToOps(sBot," "..user.sName.." Try to sent "..
					"this message in Main----> "..data),user:SendData(sBot,user.sName..", "..
					"please don't use words like "..word.." in this hub order by AnnA  Reconnect to hub."),user:Disconnect(),1
				end 
			end
		end
	end

bastya_elvtars

One should also add badword checking in PM. I don't like that, so I won't code it, but it's food for thuoght anyway.
Everything could have been anything else and it would have just as much meaning.

jack_port1000

i dont care about who use badword in pm, but main chat and regchat is problem for us bec there is senior citizen and females and some kids in our hub so we must respect them tats it so pls in this script codeing for regchat only not for pm :)
??Reg-Chat?? this a bot in my hub if any user (admin,ops,master,reguser) pm this bot this bot tat message send to every one i want to stop badword here no in pm so dont get me wrong   8)

bastya_elvtars

I think you should post the regchat script, because incorporating word filtering right into that would be better.
Everything could have been anything else and it would have just as much meaning.

jack_port1000

bastya there is ??Reg-Chat?? option in terminator bot like opschat, vipchat,adminchat, so check box for ??Reg-Chat?? in terminator bot so it seen in hub ??Reg-Chat?? bot but i dont know how to pull out ??Reg-Chat?? script from terminator
if its not possible to pullout ??Reg-Chat?? script from terminator then can u do me a favor  ;) can u make one script same as above script but in tat script add one thing tat if i start that script, that script add one bot in hub as ??Reg-Chat?? there any user master to reguser  pm tat bot that pm got each and every user in hub and reply to tat message but must badword not work there tats the main thing

bastya_elvtars

If this is OK for you, I will mod it.
Everything could have been anything else and it would have just as much meaning.

jack_port1000


SMF spam blocked by CleanTalk