PtokaX forum

Archive => Archived 5.1 boards => Request for scripts => Topic started by: 6Marilyn6Manson6 on 07 August, 2006, 21:23:44

Title: CAPS to mormal letters
Post by: 6Marilyn6Manson6 on 07 August, 2006, 21:23:44
Hello, I have found this script for change caps with normal letter:

function ChatArrival(user,data)
local _,_,msg = string.find(data, "%b<>%s(.*)%|")
    msg = string.gsub(msg, "(%S+)", function(word)
        local s = string.sub(word,1,1)
        return string.upper(s)..string.lower(string.sub(word,2))
end)
    SendToAll(user.sName, msg)
    return 1
end


my request is: who have other solution for this script? This script is good? thanks
Title: Re: CAPS to mormal letters
Post by: TTB on 07 August, 2006, 21:31:30
Hmz...

Why not:

function Convert(user,data)
local _,_,msg = string.find(data, "%b<>%s(.*)%|")
    msg = string.lower(msg)
    SendToAll(user.sName, msg)
    return 1
end


Title: Re: CAPS to mormal letters
Post by: 6Marilyn6Manson6 on 07 August, 2006, 21:38:42
Thanks TTB and thanks Hungarista for link. If other lua scripter want do other version.... this topic is most good :D
Title: Re: CAPS to mormal letters
Post by: 6Marilyn6Manson6 on 07 August, 2006, 23:23:53
Thanks for your version Mutor ;)
Title: Re: CAPS to mormal letters
Post by: JueLz on 09 August, 2006, 09:34:33
Yes i like the scripts but i want administrators to be able to user Caps Lock
Title: Re: CAPS to mormal letters
Post by: jiten on 09 August, 2006, 12:04:45
Quote from: JueLz on 09 August, 2006, 09:34:33
Yes i like the scripts but i want administrators to be able to user Caps Lock

Using Mutor's code:

ChatArrival = function(user, data)
if not user.bOperator then
return SendToAll(user.sName, string.lower(string.sub(data,(string.len(user.sName)+4),-2))),1
end
end