View previous topic :: View next topic |
Author |
Message |
simo Revered One
Joined: 22 Mar 2015 Posts: 1054
|
Posted: Tue Aug 16, 2022 7:53 am Post subject: make bot blind for color codes and other codes |
|
|
we are using this small code on dalnet to make bot blind for color codes and other codes and it seems to give some errors while on other networks it works fine and i cant figure why
Code: |
catch {unbind raw - PRIVMSG *raw:irc:msg}
bind raw - PRIVMSG striprivmsg
proc striprivmsg {f k a} {
set a [string map [list \017 ""] [stripcodes abcgru $a]]
*raw:irc:msg $f $k $a
}
|
getting this error :
Quote: | Tcl error [striprivmsg]: invalid command name "*raw:irc:msg" |
|
|
Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1193
|
Posted: Tue Aug 16, 2022 8:19 am Post subject: Re: make bot blind for color codes and other codes |
|
|
simo wrote: | ... and it seems to give some errors while on other networks it works fine and i cant figure why
...
|
Addressing only the "why" part - not addressing how to fix it, right now :
I suspect that this experiment on different networks was also done with different bots - not testing the script on same bot by having bot log into each network.
For the heck of it, I tried this command in the partyline:
Code: |
.binds *raw:irc:m* all
|
Please try it, and see what you get. If you're using more than one bot, try it on each bot.
I tried it on two bots.
Here's what I got on one:
Quote: |
<myhandle> .binds *raw:irc:m* all
<botnick> [12:03:13] #myhandle# binds *raw:irc:m* all
<botnick> Command bindings:
<botnick> TYPE FLAGS COMMAND HITS BINDING (TCL)
<botnick> raw -|- PRIVMSG 80 *raw:irc:msg
<botnick> raw -|- MODE 18 *raw:irc:mode
|
The above was on bot:
Quote: |
<botnick> I am botnickhere, running eggdrop v1.8.3: 67 users (mem: 193k)
|
Next, I tried that command on another bot:
Quote: |
<myhandle> .binds *raw:irc:m* all
<botnick> [14:03:27] #myhandle# binds *raw:irc:m* all
<botnick> Command bindings:
<botnick> TYPE FLAGS COMMAND HITS BINDING (TCL)
<botnick> raw -|- MODE 3 *raw:irc:mode
|
This time, this bot is:
Quote: |
<botnick> I am botnickhere, running eggdrop v1.9.3: 1 user (mem: 263k).
|
So - it appears that command does not exist anymore, on new version of bot.
Please let us know if my guess is correct - that you are trying it on two different bots, and if so, what the version numbers of each bot is.
Assuming that we now know what is going on - that's the first step.
Now we need to figure out how to get you up and running again.
I'm sorry - I don't have the time at the moment to research it further. I'm posting this because it came to mind, and looks like it might be right, so far - and thus might help somebody else keep the ball rolling for you. Maybe I can get back to it later.
I hope this helped. _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1145 Location: France
|
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1054
|
Posted: Tue Aug 16, 2022 9:02 am Post subject: |
|
|
Thanks willyw and crazycat for your swift reply the bot version im running is 1.9.3 |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1054
|
Posted: Tue Aug 16, 2022 9:12 am Post subject: |
|
|
tried your suggestion CrazyCat and gave me this error:
Quote: | Tcl error [striprivmsg]: wrong # args: should be "striprivmsg f k a"
invalid command name "*raw:irc:msg"
|
your suggestion i didnt understand willyw i used that command in PL and it returned the bind
Quote: |
15:09:19 <Cappuccino> .binds *raw:irc:m* all
15:09:19 <HawkONE> [18:09:19] #ctcp# binds *raw:irc:m* all
15:09:19 <HawkONE> Command bindings:
15:09:19 <HawkONE> TYPE FLAGS COMMAND HITS BINDING (TCL)
15:09:19 <HawkONE> raw -|- MODE 27 *raw:irc:mode
|
|
|
Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1145 Location: France
|
Posted: Tue Aug 16, 2022 9:17 am Post subject: |
|
|
Read the manual !
Quote: |
RAWT (stackable)
bind rawt <flags> <keyword> <proc>
procname <from> <keyword> <text> <tag> |
Your procedure must now integrate the tag argument. And send it to *rawt:irc:msg _________________ Eggdrop community - French IRC network |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1054
|
Posted: Tue Aug 16, 2022 9:33 am Post subject: |
|
|
i tried it like this and still get errors:
Code: |
catch {unbind rawt - PRIVMSG *rawt:irc:msg}
bind rawt - PRIVMSG striprivmsg
proc striprivmsg {f k a} {
set a [string map [list \017 ""] [stripcodes abcgru $a]]
*rawt:irc:msg $f $k $a
}
|
errors:
Quote: |
Tcl error [striprivmsg]: wrong # args: should be "striprivmsg f k a" |
|
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1054
|
Posted: Tue Aug 16, 2022 9:44 am Post subject: |
|
|
now i tried it like this :
Code: |
catch {unbind rawt - PRIVMSG *rawt:irc:msg}
bind rawt - PRIVMSG striprivmsg
proc striprivmsg {f k text tag} {
set a [string map [list \017 ""] [stripcodes abcgru $text]]
*rawt:irc:msg $f $k $text $tag
}
|
no errors but not sure if its proper |
|
Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1145 Location: France
|
Posted: Tue Aug 16, 2022 9:44 am Post subject: |
|
|
Why don't you read all the words in my post ?
Code: | proc striprivmsg {f k a t} {
set a [string map [list \017 ""] [stripcodes abcgru $a]]
*rawt:irc:msg $f $k $a $t
} |
_________________ Eggdrop community - French IRC network |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1054
|
Posted: Tue Aug 16, 2022 9:50 am Post subject: |
|
|
Yea sorry about that i overlooked but got it error free
Not sure if it actually works properly
il test it some more thanks crazycat, willyw |
|
Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1145 Location: France
|
Posted: Tue Aug 16, 2022 9:55 am Post subject: |
|
|
First, try to solve your troubles before posting, post only when you have tried different things.
Second, there are 2 binds, so this is what you have to do:
Code: | unbind rawt - PRIVMSG *rawt:irc:msg
unbind rawt - PRIVMSG *rawt:PRIVMSG
bind rawt - PRIVMSG striprivmsg
proc striprivmsg {from key text tag} {
set text [stripcodes * $text]
*rawt:irc:msg $from $key $text $tag
*rawt:PRIVMSG $from $key $text $tag
} |
_________________ Eggdrop community - French IRC network |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1054
|
Posted: Tue Aug 16, 2022 10:03 am Post subject: |
|
|
thanks CrazyCat |
|
Back to top |
|
 |
|