This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

bind any raw command

Old posts that have not been replied to for several years.
Locked
r
ribot
Voice
Posts: 17
Joined: Mon Sep 08, 2003 4:01 pm
Location: eggbeer
Contact:

bind any raw command

Post by ribot »

hi!

I want my egg to tell me every raw command that it gets, so i tried the following code:

Code: Select all

bind raw *|* * perception
proc perception { from keyword text } {
  putlog "from keyword text"
  putlog "$from $keyword $text"
  return 0
}
It did not work, the process didn't even run, as i checked .binds.

I have return 0 there because of this text in tcl-commands, under RETURN VALUES:
RAW Return 1 to ask the bot not to process the server text. This
can affect the bot's performance by causing it to miss things
that it would normally act on -- you have been warned.
I'm not sure what this means, but i understood it as it should return 0 to act normally.

What I want to do is make a set of variables which will increase any time a specific RAW command is made.undefined. The bot should still act normally though, and not disconnect or become k-lined or anything like that.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Binds that accept wildcards in the mask has this stated in the comment in tcl-commands.doc (raw is not one of them) What is the goal of this script? If it is to find the numeric of some server message I suggest checking out .console +r (see .help console)
r
ribot
Voice
Posts: 17
Joined: Mon Sep 08, 2003 4:01 pm
Location: eggbeer
Contact:

Post by ribot »

i want to see what data is sent to the bot and how often different things are sent.

you are right, that what i need is the raw incoming server traffic, however i want to use this data in a tcl script and make variables count different raw events.

also, i dont want to affect the raw outgoing traffic, except for adding commands in my script.

it would be something like, when 10 users have joined a channel the bot will say:
OMG this channel is huge :O

but it's not that efficient to use other binds (like pubm, topc, notc, etc) since:
1) im not sure if the binds can trigger on all incoming raw traffic
2) i would have to make several binds instead of one
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Having several binds (let eggdrop do the parsing) will be much more efficient than having a "all incoming traffic"-bind and parse the data using tcl.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

A lil tip: When you want to find a certain raw use mirc to find it. Just do an /debug @bla and on the @bla window you will see everythings that comes and is going to and from the server. :)
Once the game is over, the king and the pawn go back in the same box.
r
ribot
Voice
Posts: 17
Joined: Mon Sep 08, 2003 4:01 pm
Location: eggbeer
Contact:

Post by ribot »

alright i will do that then, thank you very much user.

caesar: good tip, i will do that, ty.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

The mIRC debug is excelent, however, can a simalar effect can be utilised in eggdrop.

See you cofnig file, there are two settings which enable 2 new console flags. One will let you see the incoming raw traffic and the other will allow you to see the outgoing traffic (usful to see what is going out to the server to cause a responce).

There are two binds that come to mind that would allow you to do "Wow this channel is huge".

1: Use timers or the time bind. Periodicaly check each channel, see when you last sent a message, if it is a new record, send the message.

2: Use the join bind. Simalar to above, however, it only does it when somebody join, aka, when something has happened in the channel.
Locked