proc reply:share {nick uhost hand chan arg} {
puthelp "NOTICE $nick :I'm a robot, NOT sharing files!"
}
and got this error:
can't read "bot": no such variable
while executing
"bind pub - @$bot reply:share "
(file "scripts/notrigger.tcl" line 1)
invoked from within
"source scripts/notrigger.tcl"
The slight advantage of this is that the bind is in operation only after the bot is on the IRC server, and $botnick holds the actual bot nickname (which, incidentally, may not coincide with $nick). I'd suggest also to check for bot's nick changes, and change the bind as appropriate.
Or, instead of doing all that work, have a bind to match all public text against the desired trigger (@), and check for the appropriate botnick from within that proc itself, if you want/need to handle all those cases.
strikelight wrote:One possibility is that you entered the code wrong initially, changed it, rehashed (instead of restarting), thus leaving the original incorrect bind in tact and still usable...
Another possibility is that you loaded the bot from scratch and when doing so, the bot has not yet connected to irc, and botnick may be "" (empty), thus meaning that the bind would just be "@".... If this is the problem, then a better bind would be bind pub - @$nick <proc> instead.
all bots still reply to just @ after I did a rehash .. I'll try the alternative codes later today. I appreciate all the input.
strikelight wrote:One possibility is that you entered the code wrong initially, changed it, rehashed (instead of restarting), thus leaving the original incorrect bind in tact and still usable...
Another possibility is that you loaded the bot from scratch and when doing so, the bot has not yet connected to irc, and botnick may be "" (empty), thus meaning that the bind would just be "@".... If this is the problem, then a better bind would be bind pub - @$nick <proc> instead.
all bots still reply to just @ after I did a rehash .. I'll try the alternative codes later today. I appreciate all the input.
That's exactly what I was saying... you should NOT use .rehash...
you should have used .restart.