PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: AMediaMan on 12 September, 2004, 04:32:20

Title: Main chat timeout
Post by: AMediaMan on 12 September, 2004, 04:32:20
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.
Title:
Post by: nErBoS on 14 September, 2004, 23:20:40
Hi,

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

Best regards, nErBoS
Title:
Post by: AMediaMan on 15 September, 2004, 03:35:56
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
Title:
Post by: BottledHate on 15 September, 2004, 07:36:16
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
Title:
Post by: bastya_elvtars on 15 September, 2004, 13:20:49
There is already a script by tezlo out there...
Title:
Post by: bolamix on 15 September, 2004, 15:19:04
An interesting request, and a nice script...
The bleh() function that's commented out is nice, what's it for? Future releases? :))
Title:
Post by: AMediaMan on 16 September, 2004, 02:32:31
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...................
Title:
Post by: BottledHate on 16 September, 2004, 03:03:13
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
Title:
Post by: BoJlk on 16 September, 2004, 03:24:52
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
Title:
Post by: BottledHate on 16 September, 2004, 03:27:00
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
Title: timeout bot
Post by: AMediaMan on 16 September, 2004, 03:56:55
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) .
Title:
Post by: BoJlk on 16 September, 2004, 04:10:03
[BottledHate]
LOL...
Didn't read the script options before Posting a Reply...
 ;)
Title:
Post by: BottledHate on 16 September, 2004, 04:56:55
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
Title:
Post by: AMediaMan on 16 September, 2004, 05:11:13
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
Title:
Post by: BottledHate on 16 September, 2004, 05:38:23
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
Title:
Post by: AMediaMan on 16 September, 2004, 06:03:26
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
Title:
Post by: BottledHate on 16 September, 2004, 06:20:32
as always, i'm happy to help. :)

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

-BH
Title:
Post by: AMediaMan on 16 September, 2004, 06:25:31
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
Title:
Post by: BoJlk on 16 September, 2004, 07:57:48
Works Great...

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

something like !add
Title:
Post by: BottledHate on 16 September, 2004, 08:20:12
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
Title:
Post by: BottledHate on 16 September, 2004, 08:23:48
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
Title:
Post by: AMediaMan on 17 September, 2004, 01:44:05
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
Title:
Post by: BoJlk on 17 September, 2004, 02:08:43
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
Title:
Post by: AMediaMan on 17 September, 2004, 02:47:58
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
Title:
Post by: BoJlk on 17 September, 2004, 03:13:17
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
Title:
Post by: BottledHate on 17 September, 2004, 06:04:38
havn't had time to fully test it yet...

but here it is:


--//TimeOut Bot v0.3
--//By: BottledHate
--//Requested by: AMediaMan
--//16/09/04
--//14/09/04(first release)

--//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 stuff in quotes to your liking:
 --//(cmds are for ops only)
aWord = "!addword" --//


-BH
Title:
Post by: BottledHate on 17 September, 2004, 08:34:11
made a few little changes to the script above... nothing big, just one little error with displaying minutes over 9. and something else i can't remember.

-BH
Title:
Post by: BoJlk on 17 September, 2004, 08:39:42
Well BottledHate

It Affects Master and OPs... :D Now that's funny
And when i tried to add a word with spaces
i've got  

*** TimeOut Bot v0.3: Syntax Error. !thelp for help. ***
Title:
Post by: BottledHate on 17 September, 2004, 09:05:44
QuoteOriginally posted by BoJlk
It Affects Master and OPs... :D Now that's funny
yup.. sure does.. and why shouldn't it :D (not like they can't remove themselves... )

QuoteOriginally posted by BoJlk
And when i tried to add a word with spaces
i've got  

*** TimeOut Bot v0.3: Syntax Error. !thelp for help. ***

a word with spaces is two words... ;)


-BH
Title:
Post by: Psycho_Chihuahua on 17 September, 2004, 09:17:53
In a Testrun

Time-Out yourself and then chat a couple of lines *being blocked of course* and then clear Time-Out List

and what do you get on a 15.25? your not on timeout but u still cant chat in mainonly stays blank
Title:
Post by: BottledHate on 17 September, 2004, 09:23:54
QuoteOriginally posted by Psycho_Chihuahua
and what do you get on a 15.25? your not on timeout but u still cant chat in mainonly stays blank


great.. thanks for the test run... i'm not familiar with
 15.25 ... i assume thats a pto version.. i'll mess around
with it tomorrow and see what the deal is.


-BH
Title:
Post by: BottledHate on 17 September, 2004, 09:25:01
QuoteOriginally posted by BoJlk
And when i tried to add a word with spaces
i've got  

*** TimeOut Bot v0.3: Syntax Error. !thelp for help. ***


if you really want spaces.. edit the .dat file manually and reload the bot :D

-BH
Title:
Post by: AMediaMan on 17 September, 2004, 11:49:31
I like that the masters and ops are included  :D , in the hub i use it in is private and everyone there is an op or higher lol. It really was meant to be for fun with me but i see that it is a very handy script  :P  so i just might add it to my public hub as well hahahaha.

Keep up the great work BottledHate and i will test this one out as well.


Thnx,AMediaMan
Title:
Post by: Psycho_Chihuahua on 17 September, 2004, 12:13:05
QuoteOriginally posted by BottledHate
QuoteOriginally posted by Psycho_Chihuahua
and what do you get on a 15.25? your not on timeout but u still cant chat in mainonly stays blank


great.. thanks for the test run... i'm not familiar with
 15.25 ... i assume thats a pto version.. i'll mess around
with it tomorrow and see what the deal is.


-BH

yes i meant ptokax 0.3.3.0 build 15.25
Title:
Post by: BottledHate on 18 September, 2004, 02:16:27
well i gave it a try in 0.3.3.0 15.25.....

and it worked fine.... it did conflict with another trigbot a
lil.. but adding a "_" to the begining of the script file
making it load last seemed to fix that prob.

so it must be another bot u run causing probs....

i dunno... maybe try changingthe name of the script so
it loads first or last...



-BH
Title:
Post by: BottledHate on 18 September, 2004, 02:23:22
done more testing... all commands work fine. even loaded up the rest of my bots, and all is still good...

i kinda like 0.3.3.0 15.25 :D think i'll use it now, instead of 0.3.2.6 td4.99....

-BH
Title:
Post by: bastya_elvtars on 18 September, 2004, 02:27:27
QuoteOriginally posted by BottledHate
done more testing... all commands work fine. even loaded up the rest of my bots, and all is still good...

i kinda like 0.3.3.0 15.25 :D think i'll use it now, instead of 0.3.2.6 td4.99....

-BH

15.18 is better, it has a bit bigger ram usage, but accesses LUA variables faster.
This is my experimental opinion, but you decide...

I think both should be released at last.
Title:
Post by: BoJlk on 19 September, 2004, 11:51:48
QuoteOriginally posted by BottledHate
if you really want spaces.. edit the .dat file manually and reload the bot :D

Thanks worked fine...

A great Work you did with the script it's comfortable to use and manipulate...

Keep up the good work!
Title:
Post by: BottledHate on 19 September, 2004, 22:44:11
QuoteOriginally posted by BoJlk
Thanks worked fine...

A great Work you did with the script it's comfortable to use and manipulate...

Keep up the good work!


thanks!  :D

this script wouldn't have been possible if it wern't for
 great feedback thoughout... thanks to all that gave
 input!

-BH
Title:
Post by: AMediaMan on 20 September, 2004, 05:26:12
hey hey anytime BottledHate. Besides what kind of person would i be if i requested a bot and didnt help test it lmao. Works great and i ty much.


Keep up the good work, AMediaMan
Title:
Post by: BottledHate on 20 September, 2004, 09:20:12
tryingto update my scripts to be 100% lua5 compatible.. and also making them all play nice together, weather 2 or 100 of them running.


--//TimeOut Bot v0.4
--//By: BottledHate
--//Requested by: AMediaMan
--//20/09/04
--//14/09/04(first release)

--//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
string.type = type
string.format = format
io = {}
io.open = openfile
io.close = closefile
io.write = write
os={}
os.execute = execute
os.clock = clock
table= {}
table.getn = getn
table.insert = tinsert
table.remove = tremove
math = {}
math.random = random
--// ok stop erasing!

tUserDefined = {--//Don't Touch
--//edit the stuff in quotes to your liking:
 --//(cmds are for ops only)
aWord = "!addword", --//

-BH
Title:
Post by: AMediaMan on 23 September, 2004, 23:57:05
COOOOOOOOOOOOL   :D










AMediaMan
Title:
Post by: BottledHate on 25 September, 2004, 04:27:49
another update.....
+ "*" in front of word makes it absolute.

example:
!addword *hi 5   ...will find only "hi"... not anything around it.
Hi everyone!        
(hi would be found)
high everyone!    
(hi would not be found..)

!addword ho 5    ...will find "ho" in any word
blah is a ho          
(ho would be found)
hope you are better    
(ho would still be found..)

oky? (same as the word replace bot)

--//TimeOut Bot v0.5
--//By: BottledHate
--//Requested by: AMediaMan
--//24/09/04
--//14/09/04(first release)

--//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
string.type = type
string.format = format
io = {}
io.open = openfile
io.close = closefile
io.write = write
os={}
os.execute = execute
os.clock = clock
table= {}
table.getn = getn
table.insert = tinsert
table.remove = tremove
math = {}
math.random = random
--// ok stop erasing!

tUserDefined = {--//Don't Touch
--//edit the stuff in quotes to your liking:
 --//(cmds are for ops only)
aWord = "!addword", --//

-BH
Title:
Post by: AMediaMan on 26 September, 2004, 01:30:57
Well ok then hahahaha i will test it out and let you know how it goes :)







AMediaMan
Title:
Post by: BoJlk on 26 September, 2004, 02:15:37
Sweeeeet, Man!  :]

It's great work you've done there BottledHate
Title:
Post by: AMediaMan on 26 September, 2004, 03:16:01
hey hey BoJlk, i cant take credit for the script buddy its BottledHate's coding i just requsted the script and helped with some ideals  :]  but thnx.  


BottledHate, i have tested the script and it works just fine. I really like the add and remove words command it rocks lol. Great job and keep up the good work.




AMediaMan
Title:
Post by: BottledHate on 26 September, 2004, 03:59:12
glad to hear all is working well... :D


-BH
Title:
Post by: BoJlk on 26 September, 2004, 04:21:11
HE,HE,...

i mistyped it i meant to say BottledHate :D  :D  :D

but it's all for mutual cause...