| View previous topic :: View next topic |
| Author |
Message |
Mr B Voice
Joined: 05 Oct 2007 Posts: 2 Location: a secret bunker
|
Posted: Sat Oct 06, 2007 12:16 am Post subject: Passing on a variable outside a proc |
|
|
I just started learning tcl and came across a couple things I just couldn't find any answers to.
Here goes:
| Code: | bind pub - !test lineread
proc lineread {nick host handle chan text} {
global prech homech
if {$chan == $homech} {
putserv "PRIVMSG $prech :$text" } |
My first question is, is it possible to pass a variable from one procedure onto another procedure (without using a file) and how qould that work
In this case the content of $text, since I want to use it in my second procedure.
-
My second procedure will read a specific line, which starts with [
My first thought was to use the \[*
| Code: | | bind pubm - "$prech \[*" reread |
which obviously doesn't work since the [ is in bold
after that I also tried /002\[ to no avail
| Code: | | bind pubm - "$prech /002\[*" reread |
My question is, is there a way to get this to work in the bind pubm line.
Thanks in advance |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Oct 06, 2007 7:24 am Post subject: |
|
|
1: Check out the global command.
Obviously you are already using it, probably just need to read alittle to figure out how to use it.
2: Use \ooo or \xhh to create any character, not /ooo or /xhh (ooo being the octal value, such as 002, xhh being hexadecimal value, such as x02).
Thus, this should do the trick:
| Code: | | bind pubm - "$prech \002\[*" reread |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Mr B Voice
Joined: 05 Oct 2007 Posts: 2 Location: a secret bunker
|
Posted: Sat Oct 06, 2007 1:56 pm Post subject: |
|
|
Ok it took me a bit cause I made some mistakes at first but I finally saw the light
passing on using the global command works now
Thanks for pushing me in the right direction nml375 and for the explantion on the second problem, that also works like a charm now |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Oct 06, 2007 3:01 pm Post subject: |
|
|
That's why we're here  _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|