Main chat timeout
 

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

Main chat timeout

Started by AMediaMan, 12 September, 2004, 04:32:20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AMediaMan

Ok heres a requst for all you smart minded scripters out there lol.

I know there is a time out for searches and a temp ban
but i think it would be cool to have a time out for saying cuss words in the main chat. Say an adjustable time setting 20 mins or 10 secs or whatever.

Any ideals or help would be great >:o)


Thnx, AMediaMan


PS... if there is one out there already im sorry i missed it,
please point me to it ;) thnx again.

nErBoS

Hi,

Didn't understood your request, could you give me examples or explain why a time out to the chat ??

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

AMediaMan

Ok like if someone says F--k  a bot will say sorry cussing is not allowed you now have a ten min time out.

but i would like the time limit to be adjustable or maybe a command that can clear it. Kinda of like a temp gag.
but automatic by the bot......  hope it can be done :)




Thnx , AMediaMan

BottledHate

sure why not... put this together in a few minutes.. tested lightly.


--//TimeOut Bot v0.1
--//By: BottledHate
--//Requested by: AMediaMan
--//14/09/04

--//if using new pto w/ lua 5 erase this stuff...
string = {}
string.sub = strsub
string.find = strfind
string.gsub = gsub
string.len = strlen
string.lower = strlower
os = {}
os.clock = clock
--// ok stop erasing!


--//edit the table...use lowercase. 
timeoutTable = {
   ["fuck"] = 5, --//timeout in minutes.
   ["asshole"] = 5,
}
--//bleh()
timeoutUsers={}
function DataArrival(user, data) 
   local x = nil
   if (string.sub(data, 1, 1) == "<" ) then 
      data= string.lower(string.sub(data,1,string.len(data)-1) )
      x = executeCrap(user,data)
      if x then return 1 end
      x = doStuff(user,data)      
      if x then return 1 end
   end
end
function doStuff(u,d)
   for k,v in timeoutTable do
      if string.find(d, k) then
         timeoutUsers[u.sName] = os.clock() + (v*60)
         SendToAll("*** "..u.sName.." has been put on time-out for "..v.." minutes for saying '"..k.."' ***")
         return 1
      end
   end
end
function executeCrap(u,d)
   if timeoutUsers[u.sName] then
      if os.clock() < timeoutUsers[u.sName] then
         u:SendData( "You are on Time-Out! Sit back, relax, and enjoy the show.... (you have "..(string.sub(((timeoutUsers[u.sName] - os.clock()) / 60),1,1)+1).." minute(s) or less left on timeout.) ")
         return 1
      else
         timeoutUsers[u.sName] = nil
      end
   end
end

-BH
Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!

bastya_elvtars

There is already a script by tezlo out there...
Everything could have been anything else and it would have just as much meaning.

bolamix

An interesting request, and a nice script...
The bleh() function that's commented out is nice, what's it for? Future releases? :))
Sharing is of the essence!

Live music >> Aiwadirock! live music hub
PtokaX knowledge >> The PtokaX Wiki

AMediaMan

Cool ty BottledHate i will test it out looks great :)


Hey bastya_elvtars i couldnt find that script or any like it any where lol if you have a link or something i am iunterested in checking it out as well :)



Thnx, AMediaMan


ps gonna test and ill bbs with results...................

BottledHate

QuoteOriginally posted by AMediaMan
Cool ty BottledHate i will test it out looks great :)


Hey bastya_elvtars i couldnt find that script or any like it any where lol if you have a link or something i am iunterested in checking it out as well :)



Thnx, AMediaMan


ps gonna test and ill bbs with results...................


np... glad to help.

-BH
Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!

BoJlk

Is there a script that might Block user's messages to the Main chat for a period of time, after saying the F#$CK word...

"you not allowed to chat because u used the "word" in the main chat"

something like that

** and what does the Gag user command?  :D

BottledHate

QuoteOriginally posted by BoJlk
Is there a script that might Block user's messages to the Main chat for a period of time, after saying the F#$CK word...

"you not allowed to chat because u used the "word" in the main chat"

something like that

** and what does the Gag user command?  :D

LOL

that is exactly what the script above does.

 :D

-BH
Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!

AMediaMan

#10
Hey BottledHate, script works great ty,
the only problem i have is a trigger bot intercepting the words hahaha but thats ok i can fix that myself ;).

May i request maybe a command to clear the timeout on a certain user ?   Say like !clrt (username). If not its still just what i needed great script thnx again.



thnx, AMediaMan


PS. Maybe you can make the bot say when your time is up. (Ok username you may chat again but watch what you say) .

BoJlk

[BottledHate]
LOL...
Didn't read the script options before Posting a Reply...
 ;)

BottledHate

QuoteOriginally posted by AMediaMan
Hey BottledHate, script works great ty,
the only problem i have is a trigger bot intercepting the words hahaha but thats ok i can fix that myself ;).

sweeeeet :D


QuoteOriginally posted by AMediaMan
May i request maybe a command to clear the timeout on a certain user ?   Say like !clrt (username). If not its still just what i needed great script thnx again.

sure.. i'll work on that now...

QuoteOriginally posted by AMediaMan
PS. Maybe you can make the bot say when your time is up. (Ok username you may chat again but watch what you say) .

i made the script without a timer on purpose. i assumed
 u have other scripts running.. and it would require a
timer..... which would mess up any other timers for
 other scripts.  


:D

-BH
Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!

AMediaMan

Cool, i think the only script i use with a timer would be the trivia bot which i can do without hahahaha.

Keep up the good work !!!


thnx, AMediaMan

BottledHate

added a command to clear nicks or the whole list. (ops only)

--//TimeOut Bot v0.2
--//By: BottledHate
--//Requested by: AMediaMan
--//14/09/04

--//if using new pto w/ lua 5 erase this stuff...
string = {}
string.sub = strsub
string.find = strfind
string.gsub = gsub
string.len = strlen
string.lower = strlower
os = {}
os.clock = clock
--// ok stop erasing!

--//edit the table...use lowercase. 
timeoutTable = {
   ["fuck"] = 5, --//timeout in minutes.  0.1 would be 6 seconds ;)
   ["asshole"] = 5,
}

clearCommand = "!clrt" --// !  ...(case sensitive, OPs only) (no  clears the whole list)

timeoutUsers={}
function DataArrival(user, data) 
   local x = nil
   if (string.sub(data, 1, 1) == "<" ) then 
      data= string.sub(data,1,string.len(data)-1)
      local _,_,c,n=strfind(data, "%b<>%s+(%S*)%s*(%S*)")
      if c == clearCommand and user.bOperator then
         if n ~= "" then
            if timeoutUsers[n] then
               timeoutUsers[n] = nil
               SendToAll("*** "..user.sName.." has let "..n.." off of Time-Out. ***")
            else 
               user:SendData( "*** The nick: '"..n.."' was not found on the Time-Out list. ***")
            end
         else
            timeoutUsers = nil
            timeoutUsers ={}
            user:SendData( "*** The entire Time-Out list was cleared. ***")
         end
         return 1
      end
      data = string.lower(data)
      x = executeCrap(user,data)
      if x then return 1 end
      x = doStuff(user,data)      
      if x then return 1 end
   end
end
function doStuff(u,d)
   for k,v in timeoutTable do
      if string.find(d, k) then
         timeoutUsers[u.sName] = os.clock() + (v*60)
         SendToAll("*** "..u.sName.." has been put on time-out for "..v.." minutes for saying '"..k.."' ***")
         return 1
      end
   end
end
function executeCrap(u,d)
   if timeoutUsers[u.sName] then
      if os.clock() < timeoutUsers[u.sName] then
         u:SendData( "You are on Time-Out! Sit back, relax, and enjoy the show.... (you have "..
            (string.sub(((timeoutUsers[u.sName] - os.clock()) / 60),1,1)+1)..
            " minute(s) or less left on timeout.) ")
         return 1
      else
         timeoutUsers[u.sName] = nil
      end
   end
end

-BH
Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!

AMediaMan

#15
Perfect it works great plus with the clrt command it makes it much easier to test lol no more restarting scripts :) thnx for all the help.




Thnx again, AMediaMan

BottledHate

as always, i'm happy to help. :)

if you want any more tweaking/features done to it just ask!

-BH
Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!

AMediaMan

#17
Nothing for this one  :P

But i have a post in the help scripts area that you could check out hahahaha. The one Ada bot help i think it is.
Peep it and give it a shot hahahaha.





AMediaMan

BoJlk

#18
Works Great...

maybe you should make a command
that adds words to the DataBase...

something like !add

BottledHate

QuoteOriginally posted by AMediaMan

But i have a post in the help scripts area that you could check out hahahaha. The one Ada bot help i think it is.
Peep it and give it a shot hahahaha.


will do :D


-BH
Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!

BottledHate

QuoteOriginally posted by BoJlk
Works Great...

maybe you should make a command
that adds words to the DataBase...

something like !add

hmmmm, if i'm going to add that.. may as well go all out..

!add , !remove , !settime , !view, !timeout
Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!

AMediaMan

LMAO, hey hey this could turn out to be BIG haha. Nice add on BoJlk and an even better all out BottledHate lol.I will test and upgrade as we go :)


AMediaMan

BoJlk

#22
It Just Might!...  :D

and it doesn't dependents on the Language you using
in the Main chat...

you can add any inappropriate words in you own language.  :D

AMediaMan

I dont think it would matter what language you use if someone types the word it times them out weather it be french or sweden german or what ever.  :D

The one thing that you would have to do is change the bot response to the language you need. So everything should work just fine  8)




AMediaMan

BoJlk

#24
What i meant was...

If Someone uses the word "????" {Encoding>Cyrilic (Windows)}
**It's in Russian

I would like to add this Offensive word!
to the pile of stinking word that i won't like to be used in the mainchat... :D

SMF spam blocked by CleanTalk