PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: bastya_elvtars on 01 June, 2004, 13:57:34

Title: delay in chat
Post by: bastya_elvtars on 01 June, 2004, 13:57:34
I need a bot that checks the delay in chat so i can avoid situations like this:

Quote[13:58:12] <[HUN]bastya_elvtars> re
[13:58:12] <[HUN]bastya_elvtars> g
[13:58:12] <[HUN]bastya_elvtars> frg
[13:58:12] <[HUN]bastya_elvtars> bg
[13:58:13] <[HUN]bastya_elvtars> hnmhj
[13:58:13] <[HUN]bastya_elvtars> mjk,
[13:58:14] <[HUN]bastya_elvtars> lk.,kl
[13:58:14] <[HUN]bastya_elvtars> ,k
[13:58:15] <[HUN]bastya_elvtars>  jk,m
[13:58:15] <[HUN]bastya_elvtars> jkmhj
[13:58:15] <[HUN]bastya_elvtars> mnhjmnh
[13:58:16] <[HUN]bastya_elvtars> mhjm
[13:58:17] <[HUN]bastya_elvtars> hnbv
[13:58:17] <[HUN]bastya_elvtars> cf
[13:58:18] <[HUN]bastya_elvtars> dafsd
[13:58:18] <[HUN]bastya_elvtars> fasf

:D
Title:
Post by: nErBoS on 02 June, 2004, 00:09:26
Hi,

Not getting your request ??? You want a script to give you the time that the data has longed to be computed ??

Best regards, nErBoS
Title:
Post by: bastya_elvtars on 02 June, 2004, 00:11:12
Nope
Just wanna set that between 2 mainchat posts from same user min. 2 seconds should pass - otherwise his message is blocked...
Title:
Post by: tezlo on 02 June, 2004, 01:03:35
will this do?
list = {}
delay = 2
-- in seconds

function DataArrival(user, data)
if strsub(data, 1, 1) == "<" and not user.bOperator then
local time, now = list[user.sName], clock()
if time and time+delay > now then
user:SendData(">> wait")
return 1
else
list[user.sName] = now
end
end
end
Title:
Post by: bastya_elvtars on 02 June, 2004, 14:01:40
Thx a lot, Tezlo, u r the second most used scripter @ me now lol

(can u make an option 2 exclude ops? just for fun lol)
Title:
Post by: tezlo on 02 June, 2004, 14:15:58
done :) let me guess.. plop is in the lead?
Title:
Post by: plop on 02 June, 2004, 16:40:26
QuoteOriginally posted by tezlo
done :) let me guess.. plop is in the lead?
i made him see the light of ptokax. lol

plop