mircscripting.info Forum Index mircscripting.info
#mIRCscripting Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Raw events, re-mastered.

 
Post new topic   Reply to topic    mircscripting.info Forum Index -> Tutorials
View previous topic :: View next topic  
Author Message
holospoof
Major


Joined: 14 Jan 2004
Posts: 103

PostPosted: Fri Jan 16, 2004 1:43 am    Post subject: Raw events, re-mastered. Reply with quote

One of the biggest problems I have explaining to people new at mircscripting is Raw Events.

My definition of raw events follows; raw events are events triggered when mIRC receives "raw" data from the IRC server, that was triggered by a specific command.

mirc.hlp defines raw events as follows; The raw event allows you to process numeric server messages that are identified only by a number, and non-numeric server messages which mIRC doesn't recognize internally.

There are a large number of raw events, far too many to go into here, so it is recommended that you check out the links on the mIRC Homepage for technical information. The document you are looking for is called RFC1459. There is also a numerics help file available which is more up-to-date than this document.

Filtering and handling raw messages can be very time-consuming because of the large number of messages that a server can send, so you should try to make sure that your scripts process this information as quickly as possible. The format of the raw event definition is:


Raw events are a key factor in making your script look good, and can also be helpful for data processing, such as the results from /whois, /lusers, /who, etc..

For example.. the results returned by a '/whois <nickname>' is actually sent back to you in a raw event!

Lets say you do '/whois nickname', normal mIRC display results will look something like the following..

nickname is username@nickname.users.undernet.org * my full name!
nickname on #mircscripting #noobies
nickname using *.undernet.org The Undernet Underworld
nickname is an IRC Operator
nickname is logged in as nickname
nickname End of /WHOIS list.

Pretty bland eh? Yea i know, but you can change that.

Raw events have to do with remote events so all processing of raw data will take place in your remotes section.

To get the 'raw numeric' of the raw data you should follow these steps..

1. Just open up your remotes with ALT+R
2. Add bold words in a line raw *:*:echo -a $numeric $1- | halt to the beginning of the file
3. Close remotes and /whois someone
4. Remember the raw command syntax is 'raw <numeric>:<matching text (a-z,*,?)'

You should now get the following..

311 yournick nickname username nickname.users.undernet.org * my full name!
319 yournick nickname #mircscripting #newbies
312 yournick nickname *.undernet.org The Undernet Underworld
313 yournick nickname is an IRC Operator
330 yournick nickname nickname is logged in as
318 yournick nickname End of /WHOIS list.

Theres alot more to whois than what you would normally see, eh?

In order to master raw events keep the following ideas in your head:

1. Raw events are differentiated by their 'numeric'
2. Different commands trigger different raw numerics
3. You can tell the events numeric by using $numeric inside the raw event
4. You can also specify a numeric for a raw event ( raw 318:*:echo $numeric $1- | halt } ) is the end of whois line.
5. There are many raw numerics, each numeric is assigned by IRC standards, which ammounts to a couple hundred.

Lets me show you an example.. the following lines were taken out of my remote.ini file..

raw 311:*:echo -a Whois for $2 | echo -a Address: $+($3,@,$4) | echo -a Real name: $6- | halt
raw 319:*:echo -a On channels: $3- | halt
raw 312:*:echo -a Server info: ( $+ $3 $+ ) $4- | halt
raw 313:*:echo -a $2 is an IRCop! =) | halt
raw 330:*:echo -a $2 is logged in as $3 | halt
raw 318:*:echo -a End of whois for $2 | halt

raw *:*:echo -a $numeric $1- | halt

Make sure the first line you added is below all other raw catchers, otherwise that line will catch all raw events before it can be rightfully processed by the designated raw N:*: line

This gives us:

Whois for nickname
Address: username@hostname.com
Real name: My real name!!
On channels: #mircscripting #newbies
Server info: (*.undernet.org) The Undernet Underworld
nickname is an IRCop! =)
nickname is logged in as nickname
End of whois for nickname

Now, if youve done everything right you should now have a new whois result.. you can add color and even more if you are a more advanced scripter! If you have had any problem understanding this forum you need to learn a little more about scripting.. if you understand but its not your fault.. post a reply to this topic and I'll take your suggestions..

NOTE:
You can see a list of raw numerics at the following sites...

Option 1, http://rfc.sunsite.dk/rfc/rfc1459.html
Option 2, http://www.irchelp.org/irchelp/rfc/rfc.html
Option 3, http://www.irc.org/tech_docs/rfc1459.html

If those dont work for you try a web search on RFC1459

Thanks and good luck
-gw
_________________
blah!^!@^$^^
Back to top
View user's profile Send private message Visit poster's website
sh0cknock
Site Admin


Joined: 27 Dec 2003
Posts: 224
Location: Ohio, USA

PostPosted: Fri Jan 16, 2004 8:00 pm    Post subject: Nice work Reply with quote

Now this is more like it!
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Iviv
Quite Active


Joined: 12 Jan 2004
Posts: 42
Location: Iasi, Romania

PostPosted: Sat Jan 17, 2004 6:47 am    Post subject: Reply with quote

Another great reference for RAW numerics is Jeepster's RAW Help.
You can find it at:

http://mirc-egg.net/ref/32numrc3.zip
_________________
An idea is not responsible for the people who believe in it.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Iviv
Quite Active


Joined: 12 Jan 2004
Posts: 42
Location: Iasi, Romania

PostPosted: Sat Jan 17, 2004 6:56 am    Post subject: Update on Jeepster's RAW Help Reply with quote

I posted a link for Jeepster's RAW Help earlier today. I found that link to be faulty and couldn't find it anywhere else either. Anyway, long story short, I posted it on my site:

http://iviv.dyns.cx/jeepster303a.zip

Hope it will be useful Wink
_________________
An idea is not responsible for the people who believe in it.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
holospoof
Major


Joined: 14 Jan 2004
Posts: 103

PostPosted: Sat Jan 17, 2004 8:14 am    Post subject: Reply with quote

thank you for contributing to my tutorial
you will receive gratification in the channel

Thanks
-gw Exclamation

Very Happy
_________________
blah!^!@^$^^
Back to top
View user's profile Send private message Visit poster's website
sh0cknock
Site Admin


Joined: 27 Dec 2003
Posts: 224
Location: Ohio, USA

PostPosted: Sat Jan 17, 2004 11:43 am    Post subject: Jeepster Reply with quote

It was such a good help, I wish he would do a new one.
(the Jeepster thing)
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website
holospoof
Major


Joined: 14 Jan 2004
Posts: 103

PostPosted: Sun Jan 18, 2004 4:03 am    Post subject: Reply with quote

thanks to everyone for viewing this post!!!!!!

if you have more ideas about another tutorial or a subject you are shady about plz msg me on undernet or #mircscripting

my nick is holospoof my bots name is concorde..

thanks
_________________
blah!^!@^$^^
Back to top
View user's profile Send private message Visit poster's website
stefys
Major


Joined: 18 Jun 2005
Posts: 89
Location: Romania

PostPosted: Sat Jun 18, 2005 12:21 pm    Post subject: Reply with quote

u can also use /debug @abc or mIRC sockets to get the raws u want.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    mircscripting.info Forum Index -> Tutorials All times are GMT - 5 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


Powered by phpBB © 2001, 2005 phpBB Group