Please excuse the length of this post, it needs explaining
I'm looking to write a script that gets channel-specific details, and uses them accordingly...
I've thought of 3 ways to do this (although i'm not sure if 2 of them are possible):
1) text file for each channel, 1 setting per line
2) have 'set channel_var whatever' in the tcl
3) Use .chanset settings
#1 I'm sure could be done easily, but this is not my preferred option, as it requires the editing of text files to change the settings (without writing fancy text editing code from dcc commands)
#2 I have attempted - I've tried various things but cannot get it to interpret the settings:
Code: Select all
bind pub -|- "!info" Info_pub
proc Info_pub {nick uhost hand chan text} {
set channel [string tolower $chan]
set mychannel_setting1 foo
<code goes here>
}
Code: Select all
set Setting1 $[string trimleft $channel #]_setting1
(The channel is #mychannel) - it's returning it as a string, not the value of it.Channel Info: $mychannel_setting1
Now if I use:
Code: Select all
set Setting1 [$[string trimleft $channel #]_setting1]
No matter what I try, it doesn't return the actual value of the variable... How can this be done? (if it can be)Tcl error [Info_pub]: invalid command name "$mychannel_setting1"
#3 is my preferred method, but I'm not sure if it's possible... Is it possible to store strings using .chanset, like you do with
... can you create custom settings? And then how do you read those settings?.chanset #mychannel need-op ...
If you managed to read this far, thank you I'm really stuck on this, i've been trying to solve it all night. All help appreciated
Cheers,
Mike