| View previous topic :: View next topic |
| Author |
Message |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Fri Dec 26, 2008 5:56 pm Post subject: question about colours and variable |
|
|
hello i want to ask something is is possible to set colour and something
like that :
set nick1 "\00304 $nick \003" and then if somewhere on proc the variable nick1 runs the \00304 $nick \003 == $nick ...?
i want to set one nick with colour and the result i want to be a colour but i dont want to set colour on the result variable but from begging
thnx |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Fri Dec 26, 2008 9:27 pm Post subject: |
|
|
| Code: | set nick1 "\00304${nick}\003"
if {[string equal [stripcodes bcruag $nick] $nick1]} {
putlog "Equal :D"
}{
putlog "Not Equal :("
} |
Use stripcodes, and definitely don't want to pad left/right with spaces. Stripcodes won't correct those spaces.
| Code: | | set nick1 "\00304${nick}\003" |
Stripcodes will correctly return "Equal" with the code conditions above if it were built within a real procedure. Notice I've used braces to denote the variable name so the interpreter doesn't get confused because it's not spaced out as yours was. This also makes it easier to spot the variable name within a segement of escape codes. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Sat Dec 27, 2008 10:14 am Post subject: |
|
|
thnx a lot D do you know where i can find the code for bold and other fuction?
thnx again |
|
| Back to top |
|
 |
incith Master

Joined: 23 Apr 2005 Posts: 275 Location: Canada
|
Posted: Sat Dec 27, 2008 10:24 am Post subject: |
|
|
http://tclhelp.net/#faqcolor
If you want to make life simple on yourself, use a proc to bold/etc text, such as:
| Code: | proc bold {text} {
return "\002${text}\017"
}
putserv "PRIVMSG $chan :[bold "this text is bold!"]" |
Note \017 is "reset", as in for everything (color, bold, underline). _________________ ; Answer a few unanswered posts! |
|
| Back to top |
|
 |
|