egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

question about colours and variable

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Fri Dec 26, 2008 5:56 pm    Post subject: question about colours and variable Reply with quote

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
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Fri Dec 26, 2008 9:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Sat Dec 27, 2008 10:14 am    Post subject: Reply with quote

thnx a lot Very HappyD do you know where i can find the code for bold and other fuction?


thnx again
Back to top
View user's profile Send private message
incith
Master


Joined: 23 Apr 2005
Posts: 275
Location: Canada

PostPosted: Sat Dec 27, 2008 10:24 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber