This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Making 1 letter caped

Old posts that have not been replied to for several years.
Locked
B
BadAssWright
Voice
Posts: 8
Joined: Sun Aug 14, 2005 6:20 pm

Making 1 letter caped

Post by BadAssWright »

I know how to remove all the caps in a line $text or $arg but i dont know how just to make the first letter of a command to be caped


like so

if someone types @commands

the bot will read commands, then responed with


commands @website @help @staff

how can i get Commands to be caped becauses its not set in the tcl file it just reads what ever the user types
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

what about something like that?

set command [string totile $command 1 end]
tcl: evaluate (.tcl): string totitle @commAnd 1 end
Tcl: @Command
simple and effective :)

oh, yes... for changing it in the whole string, you might have to use:

Code: Select all

set text [split $text]
set text [lreplace $text 0 0 [string totitle [lindex $text 0] 1 end]]
learn more about the magic tcl command string

Edit: fixed typo within
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Locked