CAPS LOCK messages...
 

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

CAPS LOCK messages...

Started by NemeziS, 24 September, 2004, 18:48:19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NemeziS

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? :)
--LUA forever! =)

Seiya

#1
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

NemeziS

--LUA forever! =)

Seiya

#3
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

NemeziS

Not works :(( It sends to me "Trun off your caps lock please" every time I send a message (even when Caps Lock off)
--LUA forever! =)

Seiya

I've done the correction...and edited it

BottledHate

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
Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!


SMF spam blocked by CleanTalk