egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

make bot blind for color codes and other codes

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Tue Aug 16, 2022 7:53 am    Post subject: make bot blind for color codes and other codes Reply with quote

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
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1183

PostPosted: Tue Aug 16, 2022 8:19 am    Post subject: Re: make bot blind for color codes and other codes Reply with quote

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. Smile
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
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1058
Location: France

PostPosted: Tue Aug 16, 2022 8:59 am    Post subject: Reply with quote

I guess you're using eggdrop 1.9.3 ?

Use rawt - PRIVMSG *rawt:irc:msg
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Tue Aug 16, 2022 9:02 am    Post subject: Reply with quote

Thanks willyw and crazycat for your swift reply the bot version im running is 1.9.3
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Tue Aug 16, 2022 9:12 am    Post subject: Reply with quote

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
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1058
Location: France

PostPosted: Tue Aug 16, 2022 9:17 am    Post subject: Reply with quote

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
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Tue Aug 16, 2022 9:33 am    Post subject: Reply with quote

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
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Tue Aug 16, 2022 9:44 am    Post subject: Reply with quote

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
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1058
Location: France

PostPosted: Tue Aug 16, 2022 9:44 am    Post subject: Reply with quote

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
}

_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Tue Aug 16, 2022 9:50 am    Post subject: Reply with quote

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
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1058
Location: France

PostPosted: Tue Aug 16, 2022 9:55 am    Post subject: Reply with quote

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
}

_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Tue Aug 16, 2022 10:03 am    Post subject: Reply with quote

thanks CrazyCat
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber