PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: blackwings on 18 November, 2004, 11:05:58

Title: hmm, some addition to this script is needed please :)
Post by: blackwings on 18 November, 2004, 11:05:58
Can anyone add so that the script checks for 3 words, not 2 words as it is now + add 3 tables, which should contain words that the script checks from(instead of just 3 words)--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
Title:
Post by: nErBoS on 18 November, 2004, 13:35:13
Hi,

That request isn't the same as an Anti-PUB ???

Best regards, nErBoS
Title:
Post by: blackwings on 18 November, 2004, 13:57:40
QuoteOriginally posted by nErBoS
Hi,

That request isn't the same as an Anti-PUB ???

Best regards, nErBoS
something like that, but not quite like that


The script in my first post is meant to search for several words in messages that a user sends in main or in PM.
And I wanted the script to check in table for words, so that the script can detect different ways of what a user might say when
asking for a slot. And the reason for 3 tables, well 2 table is to little I think.
Title:
Post by: nErBoS on 19 November, 2004, 01:42:49
Hi,

That is not so simple as you can think, my advise is to add phrases instead of words.

Best regards, nErBoS