Once again, I was not asking for examples, but actual samples that failed. That said, I just fired up a 1.9.2 bot and did a few tests in console... .tcl set goodmask {[nick]!*@*} Tcl: [nick]!*@* .tcl set badmask [string map {"\\" "\\\\" "\[" "\\["} $goodmask] ...
I was hoping for some actual samples that failed to execute properly. However, if the banmask would contain { or [, your character substitution would certainly interfere with mask matching... matchaddr does not support backslash escaping, so adding those would insert characters in the mask that will...
It's been a while, so lets see how much I've actually forgotten... As for brackets and braces in general, the most common issues I've come across over the years, is when scripters don't keep track of when they're operating on a string or a list. This is usually the case when I find search-and-replac...
Hello Pauschi, The short answer to that would be no. Log posts are appended to the end of the file, as that is the most efficient way to add new data to a file. Prepending the new log post would either require that the whole content of the file be shifted before adding the new post, or in the extrem...
You're welcome, I tried to cover the most common mistakes I've seen over the years, though there certainly are other pitfalls. Understanding when and how substitutions and escaping occurs is really the name of the game here. The list command does guarantee a valid list (will not break on foreach , l...
Certainly; though the man-page for list do have a few good examples: https://www.tcl.tk/man/tcl8.6/TclCmd/list.htm #sampe 1 set excnick [list chanserv somenick] #sample 2 set excnick [list \ chanserv \ somenick \ ] #sample 3, adding the value of the global variable ::botnick to the list. set excnick...
Hi Simo, Going to try and not make a complete teardown of the script this time... But... Lets start here: set userList [chanlist $chan] set pos [lsearch -nocase $userList $::botnick set userList [lreplace $userList $pos $pos] Here, we treat userList as an actual list (which it is); so far so good. B...
... Sorry, I badly said the thing... stackKicks may work, but the way the list was sent seems strange to me: stackKicks $chan [join $users] $reason 4 Fair enough, was afraid I had overlooked something in there. Sorry about not noticing the addition of string trim in your sample-code, or I would had...
On my mobile right now, so I'll be brief... The problem is that the trailing space in the enumeration of nicks becomes an empty element when you split the substring. I think you'd be able to use something like string trim to remove the space(s) once you've separated the reason from the nicks... Edit...
... So, the trouble is just in stackKicks where the list is badly managed I'm sorry I don't quite follow you there... stackKicks expects a list of nicks, and properly handles that list as a list as far as I can tell. For me, it would only break if you pass something other than a list to it (such as...
Figured I'd butt my head in here... There is indeed issues with mixing list- and string-types in this script: Starting from the initial script: set users [list] set reason [join [lrange [split $text "."] 1 end] "."] set text [lindex [split $text "."] 0] users is an (emp...
Hi, The ident-protocol is a legacy from the old days when most of us would use dialup connections to mainframes, and run our irc clients (on said mainframe) through terminal clients... Since there would be a large number of users from the same IP address, a service was implemented where you could qu...