KeikoNoAskSlotBot
 

News:

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

KeikoNoAskSlotBot

Started by pHaTTy, 19 October, 2003, 04:43:38

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pHaTTy

here a little script i wrote for my multiscript ;)

--KeikoNoAskSlotBot by Phatty
--v1.00

Bot = "Keiko"
Time = "1" --mins to be banned for

function DataArrival(user,data)
s,e,data = strfind(data, "%b<>([%a ]+)")   
	if( strfind(data, "have" and "slot") ) then
		user:SendData(Bot,"Do not ask for slots...goodbye :o)")
		user:TimeBan(Time)
		SendToAll(Bot,user.sName.." was banned for "..Time.."mins for asking for a slot")
	return 1
	end
end

l8rr,,

-phatty
Resistance is futile!

pHaTTy

Updates dont you just luv em :o)

--KeikoNoAskSlotBot by Phatty
--v1.11
--Fixed a little error
--Added warnings

Bot = "Keiko"

Warned = {}

TimeWra = "1" --mins to be banned for on first warning
TimeWrx = "2" --mins to be banned on second warning


function DataArrival(user,data)
s,e,data = strfind(data, "%b<>([%a ]+)")   
	if( strfind(data, "have" and "slot") ) then
		if Warned[user.sName]==nil then Warned[user.sName]=1
			user:SendData(Bot,"Do not ask for slots...goodbye :o)")
			user:TimeBan(TimeWra)
			SendToAll(Bot,user.sName.." was banned for "..TimeWra.."mins for asking for a slot")
		return 1
		elseif Warned[user.sName]==1 then Warned[user.sName]=2
			user:SendData(Bot,"Ive told you DO NOT ask for slots...goodbye :o)")
			user:TimeBan(TimeWrx)
			SendToAll(Bot,user.sName.." was banned for "..TimeWrx.."mins for asking for a slot on second warning")
		return 1
		elseif Warned[user.sName]==2 then Warned[user.sName]=nil
			user:SendData(Bot,"Ok num nuts ive had enough of you...goodbye :o)")
			user:Ban()
			SendToAll(Bot,user.sName.." was banned for asking for slots on third warning")
		return 1
		end
	end
end

enjoy ;)

l8rr,,

-phatty
Resistance is futile!

zinden

nice going  :)

Im off to test it. really thanks.....one question will it apply to ops too and only apply if the user write in pm?
Xion++ - Where it all begins
http://www.zinden.net

pHaTTy

nope it will do in main too i can change if you wish, and yep it will apply to ops too, i will edit out ;)
Resistance is futile!

pHaTTy

here is version with no aplly to ops ;)


--KeikoNoAskSlotBot by Phatty
--v1.12
--Fixed a little error
--Added warnings
--No longer allpies to ops

Bot = "Keiko"

Warned = {}

TimeWra = "1" --mins to be banned for on first warning
TimeWrx = "2" --mins to be banned on second warning


function DataArrival(user,data)
s,e,data = strfind(data, "%b<>([%a ]+)")   
	if( strfind(data, "have" and "slot") ) then
		if not user.bOperator then
			if Warned[user.sName]==nil then Warned[user.sName]=1
				user:SendData(Bot,"Do not ask for slots...goodbye :o)")
				user:TimeBan(TimeWra)
				SendToAll(Bot,user.sName.." was banned for "..TimeWra.."mins for asking for a slot")
			return 1
			elseif Warned[user.sName]==1 then Warned[user.sName]=2
				user:SendData(Bot,"Ive told you DO NOT ask for slots...goodbye :o)")
				user:TimeBan(TimeWrx)
				SendToAll(Bot,user.sName.." was banned for "..TimeWrx.."mins for asking for a slot on second warning")
			return 1
			elseif Warned[user.sName]==2 then Warned[user.sName]=nil
				user:SendData(Bot,"Ok num nuts ive had enough of you...goodbye :o)")
				user:Ban()
				SendToAll(Bot,user.sName.." was banned for asking for slots on third warning")
			return 1
			end
		end
	end
end
Resistance is futile!

pHaTTy

this one you can select from main and pm or just in pm

--KeikoNoAskSlotBot by Phatty
--v1.13
--Fixed a little error
--Added warnings
--No longer applies to ops
--PM checks only

Bot = "Keiko"

mainnpm=0 --1 check pm and main, 0 will check only pm

Warned = {}

TimeWra = "1" --mins to be banned for on first warning
TimeWrx = "2" --mins to be banned on second warning


function DataArrival(user,data)
if mainnpm==1 then
	s,e,data = strfind(data, "%b<>([%a ]+)")   
		if( strfind(data, "have" and "slot") ) then
			if not user.bOperator then
				if Warned[user.sName]==nil then Warned[user.sName]=1
					user:SendData(Bot,"Do not ask for slots...goodbye :o)")
					user:TimeBan(TimeWra)
					SendToAll(Bot,user.sName.." was banned for "..TimeWra.."mins for asking for a slot")
				return 1
				elseif Warned[user.sName]==1 then Warned[user.sName]=2
					user:SendData(Bot,"Ive told you DO NOT ask for slots...goodbye :o)")
					user:TimeBan(TimeWrx)
					SendToAll(Bot,user.sName.." was banned for "..TimeWrx.."mins for asking for a slot on second warning")
				return 1
				elseif Warned[user.sName]==2 then Warned[user.sName]=nil
					user:SendData(Bot,"Ok num nuts ive had enough of you...goodbye :o)")
					user:Ban()
					SendToAll(Bot,user.sName.." was banned for asking for slots on third warning")
				return 1
				end
			end
		end

else

if(strsub(data, 1, 4) == "$To:") then
	s,e,data = strfind(data, "%b<>([%a ]+)")   
		if( strfind(data, "have" and "slot") ) then
			if not user.bOperator then
				if Warned[user.sName]==nil then Warned[user.sName]=1
					user:SendData(Bot,"Do not ask for slots...goodbye :o)")
					user:TimeBan(TimeWra)
					SendToAll(Bot,user.sName.." was banned for "..TimeWra.."mins for asking for a slot")
				return 1
				elseif Warned[user.sName]==1 then Warned[user.sName]=2
					user:SendData(Bot,"Ive told you DO NOT ask for slots...goodbye :o)")
					user:TimeBan(TimeWrx)
					SendToAll(Bot,user.sName.." was banned for "..TimeWrx.."mins for asking for a slot on second warning")
				return 1
				elseif Warned[user.sName]==2 then Warned[user.sName]=nil
					user:SendData(Bot,"Ok num nuts ive had enough of you...goodbye :o)")
					user:Ban()
					SendToAll(Bot,user.sName.." was banned for asking for slots on third warning")
				return 1
				end
			end
		end
	end
end
end


l8rr,,

-phatty
Resistance is futile!

pHaTTy

here a little better

--KeikoNoAskSlotBot by Phatty
--v1.14
--Fixed a little error
--Added warnings
--No longer applies to ops
--PM checks only
--Minor optimisation

Bot = "Keiko"

mainnpm=0 --1 check pm and main, 0 will check only pm

Warned = {}

TimeWra = "1" --mins to be banned for on first warning
TimeWrx = "2" --mins to be banned on second warning


function DataArrival(user,data)
s,e,data = strfind(data, "%b<>([%a ]+)")   
	if( strfind(data, "have" and "slot") ) then
		if mainnpm==1 then
			if not user.bOperator then
				if Warned[user.sName]==nil then Warned[user.sName]=1
					user:SendData(Bot,"Do not ask for slots...goodbye :o)")
					user:TimeBan(TimeWra)
					SendToAll(Bot,user.sName.." was banned for "..TimeWra.."mins for asking for a slot")
				return 1
				elseif Warned[user.sName]==1 then Warned[user.sName]=2
					user:SendData(Bot,"Ive told you DO NOT ask for slots...goodbye :o)")
					user:TimeBan(TimeWrx)
					SendToAll(Bot,user.sName.." was banned for "..TimeWrx.."mins for asking for a slot on second warning")
				return 1
				elseif Warned[user.sName]==2 then Warned[user.sName]=nil
					user:SendData(Bot,"Ok num nuts ive had enough of you...goodbye :o)")
					user:Ban()
					SendToAll(Bot,user.sName.." was banned for asking for slots on third warning")
				return 1
				end
			end
		end

	else

		if(strsub(data, 1, 4) == "$To:") then
			s,e,data = strfind(data, "%b<>([%a ]+)")   
			if( strfind(data, "have" and "slot") ) then
				if not user.bOperator then
					if Warned[user.sName]==nil then Warned[user.sName]=1
						user:SendData(Bot,"Do not ask for slots...goodbye :o)")
						user:TimeBan(TimeWra)
						SendToAll(Bot,user.sName.." was banned for "..TimeWra.."mins for asking for a slot")
					return 1
					elseif Warned[user.sName]==1 then Warned[user.sName]=2
						user:SendData(Bot,"Ive told you DO NOT ask for slots...goodbye :o)")
						user:TimeBan(TimeWrx)
						SendToAll(Bot,user.sName.." was banned for "..TimeWrx.."mins for asking for a slot on second warning")
					return 1
					elseif Warned[user.sName]==2 then Warned[user.sName]=nil
						user:SendData(Bot,"Ok num nuts ive had enough of you...goodbye :o)")
						user:Ban()
						SendToAll(Bot,user.sName.." was banned for asking for slots on third warning")
					return 1
					end
				end
			end
		end
	end
end

-phatty
Resistance is futile!

zinden

i get a bunch of:
Syntax Error: bad argument #1 to `strfind' (string expected, got nil)

can you look in too it? im testing the last one
Xion++ - Where it all begins
http://www.zinden.net

Alexei

I think it a stupid idea to have such a bot.... if u do not allow to ask for a slot then no1 can download anything... thats stupid.... :(

Ron_Doe

It's not stupid when you got 20 PM's when you get back from work and when closing them    the same ppl is asking for a slot 30 minutes later.
But i am going to use a TimeAd in my hub telling ppl : If you got no reply in the first Pm dont nagg about it no more.

The queue is there for a reason

Ron
don`t drink and drive-just smoke and fly     :))

zinden

yepp, get HUGE pm:s about open slots, and almost everyone isnt in the hub when i get back.

Do ppl think we are made for granting 10-20 users with slots? well, i really need it anyway in my hub, problably we got some good sharing  :)


btw the Version 1.13 seems to work, i hope you can sort it out with the last update  (uk-kingdom)pH?tt?
Xion++ - Where it all begins
http://www.zinden.net

pHaTTy

ko and i got a little few more updates too ;)
Resistance is futile!

pHaTTy

ok shud be fixed with a little extra ;)

--KeikoNoAskSlotBot by Phatty
--v1.16
--Fixed a little error
--Added warnings
--No longer applies to ops
--PM checks only
--Minor optimisation
--Added Timed Advert

Bot = "Keiko"

mainnpm=1 --1 check pm and main, 0 will check only pm

Warned = {}

TimeWra = "1" --mins to be banned for on first warning
TimeWrx = "2" --mins to be banned on second warning

function Main()
SetTimer(600000)
StartTimer()
end

function OnTimer()
	SendToAll("---------=====================================================----")
	SendToAll(Bot,"..///DO NOT ask for slots in this hub, YOU WILL be kicked\\\..")
	SendToAll("---------=====================================================----")
end

function DataArrival(user,data)
	if( strfind(data, "have" and "slot",1,1))  then
		if mainnpm==1 then
			if not user.bOperator then
				if Warned[user.sName]==nil then Warned[user.sName]=1
					user:SendData(Bot,"Do not ask for slots...goodbye :o)")
					user:TimeBan(TimeWra)
					SendToAll(Bot,user.sName.." was banned for "..TimeWra.."mins for asking for a slot")
				return 1
				elseif Warned[user.sName]==1 then Warned[user.sName]=2
					user:SendData(Bot,"Ive told you DO NOT ask for slots...goodbye :o)")
					user:TimeBan(TimeWrx)
					SendToAll(Bot,user.sName.." was banned for "..TimeWrx.."mins for asking for a slot on second warning")
				return 1
				elseif Warned[user.sName]==2 then Warned[user.sName]=nil
					user:SendData(Bot,"Ok num nuts ive had enough of you...goodbye :o)")
					user:Ban()
					SendToAll(Bot,user.sName.." was banned for asking for slots on third warning")
				return 1
				end
			end
		end

	else

		if(strsub(data, 1, 4) == "$To:") then
			if( strfind(data, "have" and "slot",1,1) ) then
				if not user.bOperator then
					if Warned[user.sName]==nil then Warned[user.sName]=1
						user:SendData(Bot,"Do not ask for slots...goodbye :o)")
						user:TimeBan(TimeWra)
						SendToAll(Bot,user.sName.." was banned for "..TimeWra.."mins for asking for a slot")
					return 1
					elseif Warned[user.sName]==1 then Warned[user.sName]=2
						user:SendData(Bot,"Ive told you DO NOT ask for slots...goodbye :o)")
						user:TimeBan(TimeWrx)
						SendToAll(Bot,user.sName.." was banned for "..TimeWrx.."mins for asking for a slot on second warning")
					return 1
					elseif Warned[user.sName]==2 then Warned[user.sName]=nil
						user:SendData(Bot,"Ok num nuts ive had enough of you...goodbye :o)")
						user:Ban()
						SendToAll(Bot,user.sName.." was banned for asking for slots on third warning")
					return 1
					end
				end
			end
		end
	end
end

now a timed advert too ;)

l8rr,,

-phatty
Resistance is futile!

pHaTTy

little switch to switch on and off the timed add ;)

--KeikoNoAskSlotBot by Phatty
--v1.17
--Fixed a little error
--Added warnings
--No longer applies to ops
--PM checks only
--Minor optimisation
--Added Timed Advert
--Timed add switch

Bot = "Keiko"

mainnpm = 1 --1 check pm and main, 0 will check only pm
TimeAd = 1 --0 will switch off the timed add

Warned = {}

TimeWra = "1" --mins to be banned for on first warning
TimeWrx = "2" --mins to be banned on second warning

function Main()
SetTimer(600000)
StartTimer()
end

function OnTimer()
	if TimedAd == 1 then
		SendToAll("---------=====================================================----")
		SendToAll(Bot,"..///DO NOT ask for slots in this hub, YOU WILL be kicked\\\..")
		SendToAll("---------=====================================================----")
	end
end

function DataArrival(user,data)
	if( strfind(data, "have" and "slot",1,1))  then
		if mainnpm==1 then
			if not user.bOperator then
				if Warned[user.sName]==nil then Warned[user.sName]=1
					user:SendData(Bot,"Do not ask for slots...goodbye :o)")
					user:TimeBan(TimeWra)
					SendToAll(Bot,user.sName.." was banned for "..TimeWra.."mins for asking for a slot")
				return 1
				elseif Warned[user.sName]==1 then Warned[user.sName]=2
					user:SendData(Bot,"Ive told you DO NOT ask for slots...goodbye :o)")
					user:TimeBan(TimeWrx)
					SendToAll(Bot,user.sName.." was banned for "..TimeWrx.."mins for asking for a slot on second warning")
				return 1
				elseif Warned[user.sName]==2 then Warned[user.sName]=nil
					user:SendData(Bot,"Ok num nuts ive had enough of you...goodbye :o)")
					user:Ban()
					SendToAll(Bot,user.sName.." was banned for asking for slots on third warning")
				return 1
				end
			end
		end

	else

		if(strsub(data, 1, 4) == "$To:") then
			if( strfind(data, "have" and "slot",1,1) ) then
				if not user.bOperator then
					if Warned[user.sName]==nil then Warned[user.sName]=1
						user:SendData(Bot,"Do not ask for slots...goodbye :o)")
						user:TimeBan(TimeWra)
						SendToAll(Bot,user.sName.." was banned for "..TimeWra.."mins for asking for a slot")
					return 1
					elseif Warned[user.sName]==1 then Warned[user.sName]=2
						user:SendData(Bot,"Ive told you DO NOT ask for slots...goodbye :o)")
						user:TimeBan(TimeWrx)
						SendToAll(Bot,user.sName.." was banned for "..TimeWrx.."mins for asking for a slot on second warning")
					return 1
					elseif Warned[user.sName]==2 then Warned[user.sName]=nil
						user:SendData(Bot,"Ok num nuts ive had enough of you...goodbye :o)")
						user:Ban()
						SendToAll(Bot,user.sName.." was banned for asking for slots on third warning")
					return 1
					end
				end
			end
		end
	end
end

-phatty
Resistance is futile!

zinden

is it possible to make the script only apply to ops?
i mean do not ask ops for slots.....

So regular users can ask others, but no ops...
Xion++ - Where it all begins
http://www.zinden.net

BrokenBrick

Good idea, but I suggest you change the triggers "have" and "slot" to something like "can" "have" "slot."  Lets say someone was looking for a file, and they found only users with no slots, and asked in the man chat if anyone had it that did have open slots. when someone replied, "I have a slot, " they would of course be banned.  If someone uses "can" most likely they are asking a question and not making a statement, which cuts down on unfair bans ;)
Indiecent Music
indiecent.no-ip.com:4141


Live the lonely life, walk the lonely path, die a lonely death

pHaTTy

yes true, i will sort it asap, bit bizzy atm....:(
Resistance is futile!

SMF spam blocked by CleanTalk