mIRC Homepage

raw PRIVMSG ??

Posted By: Alex01

raw PRIVMSG ?? - 01/04/05 06:38 AM

I wanted to know what the private messages look like, made a /debug:
<- :z!alex1990@xxx.xxx.xxx.xxx PRIVMSG alex01 :text!!!!

It's PRIVMSG, right? I wrote a small script, just to test it:
raw PRIVMSG:*: { echo -s I got some text. }

I send a message to myself from another nickname. The debug-window shows the text, but echo doesn't seem to work.
Why is that?

P.S.: If I replace the PRIVMSG with, e.g., ACTION - it still won't work. But it does work when I replace it with a numeric (on other events, of course).
But, as far as I've figured out, the PRIVMSG doesn't have its own numeric...
Posted By: SladeKraven

Re: raw PRIVMSG ?? - 01/04/05 09:15 AM

I used Raw *:*: { echo -s $rawmsg } and it didn't echo anything at all.

I do however have this crappy code I'vejust whipped up. I think it works, from what I triedit seems to, but if it don't I'm sure someone can patch it up. I've not been to sleep yet, I'm dropping at the keyboard. grin

Code:
on *:Connect: {
  .timer 0 1 privmsg 
}

alias privmsg {
  if (!$isfile($debug)) { return }
  var %x = $lines($debug)
  while (%x) {
    if ($numtok($read($debug,%x),32) == 5) {
      if ($gettok($gettok($gettok($read($debug,%x),2,58),1,64),1,33) != $me)  &amp;&amp; ($gettok($read($debug,%x),3,32) == PRIVMSG) &amp;&amp; ($gettok($read($debug,%x),4,32) == $me) echo -a I got some text.
    }
    dec %x
  }
}


It may turn out there's a more simpler way and wont need this. Set your debug output to a log file and not window. I used /debug debug.log.

You might even be able to sort the code out if it don't work sufficiently, what it does is reads from the the log file to see if your nickname isn't the bart in blue, it also checks if the raw event was PRIVMSG in red. And will then echo I got some text. If your nickname matches the nickname the PRIVMSG was sent to.

<- :SladeKraven!Andy@=XDkswc54-437-735-342.range81-154.btcentralplus.com PRIVMSG Andy :...

I hope this helps, even a little bit. But my example should show you how to do it if mine don't work sufficiently hehehe.

All the best,

-Andy.
Posted By: Alex01

Re: raw PRIVMSG ?? - 01/04/05 09:38 AM

Hmm, yeah, this should work (although I haven't tried yet, I got the idea).
But the code I was trying to get working IS supposed to work, and it's much better, too. I don't adore timers that work all the time, really. smile
Maybe this thread is for the "mIRC Bugs" board?
Posted By: SladeKraven

Re: raw PRIVMSG ?? - 01/04/05 09:44 AM

Most probably is better that was just a rough etch up and plus I'm pretty tired.

As for bugs, I wouldn't call it a bug I'm not sure what to make of it IMO.

-Andy
Posted By: wiebe

Re: raw PRIVMSG ?? - 01/04/05 10:06 AM

"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."

taken from /help raw events, pay special attention to the last part. so for messages, you have to work with the on text event.

as side note, you can make /debug send everything to an alias, see /help /debug

wiebe
Posted By: SladeKraven

Re: raw PRIVMSG ?? - 01/04/05 10:14 AM

Yeah. smile

I guess I just wanted to see if there was any other way without On Text handling. As for the alias, I did something similar in my first post.

-Andy
Posted By: DaveC

Re: raw PRIVMSG ?? - 01/04/05 12:27 PM

another way is using

/debug -i on $debugger

Code:
alias debugger {
  ; $1 contains debug line so do what ya want with it
  ;example
  tokenize 32 $1
  if     ($1 $3 == -&gt; PRIVMSG) { echo -st YOU JUST SAID TEXT SAID IN A PRIVMSG TO $4 IT WAS $mid($5-,2) }
  elseif ($1 $3 == &lt;- PRIVMSG) { echo -st YOU JUST RECIEVED A PRIVMSG FROM $4 IT WAS $mid($5-,2) }
  ;
  return $1-
}
Posted By: SladeKraven

Re: raw PRIVMSG ?? - 01/04/05 01:16 PM

Ah yes, I read about that earlier when looking for the $debug identifier. Good point. smile
Posted By: FiberOPtics

Re: raw PRIVMSG ?? - 01/04/05 01:18 PM

What Dave showed, is what wiebe tried to point out to you, if you read his last line carefully :tongue:
Posted By: Alex01

Re: raw PRIVMSG ?? - 01/04/05 01:36 PM

Quote:
another way is using
/debug -i on $debugger ...


Thank you very much! Works perfectly.
Posted By: DaveC

Re: raw PRIVMSG ?? - 01/04/05 10:12 PM

just a side note If your not keeping a debug.log, you might want to do something like

/debug -i null $debugger
^ null isnt nul device but just a file called null, see below i keep clearing the first thing in the alias

Code:
alias debugger {
  write -c null
[/quote]


* I tried sending output to nul and nul: but mirc didnt like it frown Anyone know how to set that?
Posted By: Sat

Re: raw PRIVMSG ?? - 01/04/05 11:10 PM

Another (not necessarily better) way of saving some resources, is by sending the debug output to a (hidden) window and simply having the debugger alias not /return anything; that way, that window will always remain empty, and no debug.log file will be created either. That's the method I use, anyway.


Quote:
* I tried sending output to nul and nul: but mirc didnt like it

As far as I know, mIRC blocks such device names because of the old /con/con (etc) DoS problems..
Posted By: qwerty

Re: raw PRIVMSG ?? - 02/04/05 08:31 AM

The nul device is accepted by mirc in some occasions, like /debug and /filter. Are you sure
/debug -i nul somealias
doesn't work? As far as I know, it also works on 9x systems (I'm on XP).
Posted By: StirCrazy

Re: raw PRIVMSG ?? - 11/04/05 10:37 AM

I always cheated didnt actually know about using debuger but good info. Whenever i needed to know the raw data sent and recieved,i ussually used a script similar to this.

Code:
 
on *:sockwrite:ircserver: { echo @irc SENT: $1- }
on *:sockread:ircserver:{
  if ($sockerr &gt; 0) { return }
  :nextread
  sockread -f %ircServer
  if (%ircserver != $null) {
    echo @irc RECVD: %ircServer
  }
  if ($sockbr == 0) return
  goto nextread
}
on 1:input:@irc: { if ( $left($1,1) != / ) { sockwrite -n ircserver $1- } }
 


just need to do /window -e @irc and finish up with a /sockopen irc.somenetwork.net 6667
never failed when i needed to know raw data sent from ircd to client and back that code will probably ping out tho was a 2 sec write real fast
Posted By: DaveC

Re: raw PRIVMSG ?? - 12/04/05 02:03 AM

Quote:
The nul device is accepted by mirc in some occasions, like /debug and /filter. Are you sure
/debug -i nul somealias
doesn't work? As far as I know, it also works on 9x systems (I'm on XP).


Grrrrr i had tried to use /write nul before and it failed, so i assumed it was blocked outright, thanks for the tip
Posted By: cindies200

i need some help - 12/04/05 09:43 AM

i would like to know if i can get credit cards number and their information,checks,moneyr orders and bank accounts loggin,i hope to hear from you soon,if u dont have any info,u can ask around,i would pay for it
Posted By: Mentality

Re: i need some help - 12/04/05 11:36 AM

This has nothing to do with this thread, and we do not help with those activities here. Please do not make any further attempts at this, it's bad, you wouldn't like it done to you, and it's highly illegal.

mad

Regards,
Posted By: DaveC

Re: i need some help - 12/04/05 10:11 PM

Where on earth did that come from?
Posted By: IR_n00b

Re: i need some help - 30/04/05 01:25 AM

spammer, he was on the scripting board before.
anyways this board has helped me archieve somthing i tried with raw privmsg:*: and didnt work
so thx peeps cool
© 2020 mIRC Discussion Forums