PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: NemeziS on 19 September, 2004, 19:47:13

Title: No empty lines in main!
Post by: NemeziS on 19 September, 2004, 19:47:13
Hi! Another script request...

I wanted a script to disable empty lines in main: user can't send a message to main without any words (or only with SPACEs)

Example: If I press SPACE button on my keybord and then press ENTER, in main chat appears:

[21:44]                                              

I wanted that if there no sybols or words in message (or only SPACEs) it will not go to main.

Is it possible? :)
Title:
Post by: tezlo on 19 September, 2004, 20:35:53
this will do..
function DataArrival(user, data)
if strsub(data, 1, 1) == "<" then
if strfind(data, "^%b<> %s*%|$") then
return 1
end
end
end
Title:
Post by: NemeziS on 19 September, 2004, 22:34:19
Thanx! It works fine! :))
Title:
Post by: D-J Valhala on 20 September, 2004, 00:08:12
cooL script  :D