Hi!
I'm searching for a script that will give a message from bot if the text in main was written with CAPS LOCK.
Example:
I send to main: CAPS LOCK TEXT LA LA LA
and in main appears:
[20:00] CAPS LOCK TEXT LA LA LA
[20:00] turn caps lock off please!!!
JokeR - it's my bot name.
Who can write this script for me? :)
In your DataArrival :
one idea :
QuotesBot1 = "Your Bot"
function DataArrival(user,data)
if (strsub(data, 1, 1) == "<" ) then
data=strsub(data,1,strlen(data)-1)
chaine=strupper(strsub(data,strlen(user.sName)+4,strlen(data)))
if (data=="<"..user.sName.."> "..chaine) then
if (chaine~=strlower(chaine)) then
user:SendData(sBot1, "Turn off your Caps Lock Please")
end
end
end
end
RespectfullyCORRECTION DONE
not works :(((
it works because like this on my hub
another way (i ve just tested it) - (just change sBot1 to your bot variable)
QuotesBot1 = "Your Bot"
function DataArrival(user,data)
if (strsub(data, 1, 1) == "<" ) then
data=strsub(data,1,strlen(data)-1)
chaine=strupper(strsub(data,strlen(user.sName)+4,strlen(data)))
if (data=="<"..user.sName.."> "..chaine) then
if (chaine~=strlower(chaine)) then
user:SendData(sBot1, "Turn off your Caps Lock Please")
end
end
end
end
CORRECTION DONE
Not works :(( It sends to me "Trun off your caps lock please" every time I send a message (even when Caps Lock off)
I've done the correction...and edited it
my 2? cents...
string={find = strfind, sub = strsub, len=strlen, upper=strupper}--//remove this line if using new pto with lua5
function DataArrival(user,data)
if (strsub(data, 1, 1) == "<" ) then
data=string.sub(data,1,string.len(data)-1)
local _,_,text = string.find(data, "%b<> (.*)")
if text == string.upper(text) then
user:SendData("*** "..user.sName.." Turn off your damn Caps Lock off now! ...please... ***")
return 1 --//this line make the message not show up if caps.. remove if you want.
end
end
end
-BH
btw there is anti-shout by bastya_elvtar (http://board.univ-angers.fr/thread.php?threadid=2684&boardid=12)