mIRC Home    About    Download    Register    News    Help

Topic Options
#23274 - 08/05/03 10:28 PM Away system
NiCk2 Offline
Babel fish

Registered: 23/03/03
Posts: 63
Hi, I'm doing an away system and I wanted to know how I could record what is said in private messages without having the window opened. If I ignore private messages, I can't seem to retrieve them. Should I close the window each time someone says something to me and record what is said each time with the on open event ?
If you know another easyer way, thank you in advance for your help smile

Top
#23275 - 08/05/03 10:32 PM Re: Away system
RoCk Offline
Hoopy frood

Registered: 16/12/02
Posts: 2010
Code:
on *:TEXT:*:?:if ($away) { write messages.txt From: $nick - $1- | close -m $nick } 

Top
#23276 - 08/05/03 10:34 PM Re: Away system
codemastr Offline
Hoopy frood

Registered: 12/12/02
Posts: 2809
Code:
ON ^*:OPEN:?:*:{
   if ($away) {
      .write_to_my_log $+([,$time,]) $+(<,$nick,>) $1-
      .msg $nick your message has been logged
      halt
   }
}


Something along those lines should do what you want.

Top
#23277 - 08/05/03 10:35 PM Re: Away system
ScatMan Offline
Hoopy frood

Registered: 06/05/03
Posts: 730
yeah, ignore works like with an on open and /halt it so u could do that:
Don't ignore him, use this
on ^*:open:?:{ command | halt }
the command can be /write or something depends on where u want to save it ($1- is the text he wrote, use it inside the event)


Top
#23278 - 08/05/03 11:26 PM Re: Away system
NiCk2 Offline
Babel fish

Registered: 23/03/03
Posts: 63
Thank you all for your help, I much appreciate it smile

Top
#23279 - 09/05/03 01:39 AM Re: Away system
Prizm Offline
Fjord artisan

Registered: 07/05/03
Posts: 177
Loc: 127.0.0.1
codemastr:

That would work, but what if the user already had an open private message window? Then your code wouldn't log new incoming messages of an already open PM window. That's why ON TEXT is better.

Top
#23280 - 09/05/03 02:09 AM Re: Away system
Nobodi Offline
Vogon poet

Registered: 10/12/02
Posts: 191
Loc: Australia
But an "on text event" requires the window to be open, the question was.

Quote:
how I could record what is said in private messages without having the window opened.

Top
#23281 - 09/05/03 03:31 AM Re: Away system
Prizm Offline
Fjord artisan

Registered: 07/05/03
Posts: 177
Loc: 127.0.0.1
Yeah that's true. But you might have another PM window open, and, ahhh forget it.

Top
#23282 - 09/05/03 03:36 AM Re: Away system
codemastr Offline
Hoopy frood

Registered: 12/12/02
Posts: 2809
Well I would assume even if, he wouldn't want windows that he "accidentily" left open to be automatically closed by the away script.

Top
#23283 - 09/05/03 12:54 PM Re: Away system
RoCk Offline
Hoopy frood

Registered: 16/12/02
Posts: 2010
Quote:
But an "on text event" requires the window to be open


That's not true, on *:TEXT:*:?: triggers whether there's an open query window for $nick or not.

Edit: Deleted incorrect code


Edited by RoCk (09/05/03 02:53 PM)

Top
#23284 - 09/05/03 02:44 PM Re: Away system
Nobodi Offline
Vogon poet

Registered: 10/12/02
Posts: 191
Loc: Australia
Think you will find the on open event triggers before the on text event, try this.

Code:

on ^*:open:?:test*: { echo -ag open event $1- | haltdef }
on ^*:text:test*:?: { echo -ag on text event $1- | haltdef }


then from the status type "//msg $me test to see which event triggers first." then open a query window to yourself and send the message again.

Top
#23285 - 09/05/03 02:51 PM Re: Away system
RoCk Offline
Hoopy frood

Registered: 16/12/02
Posts: 2010
You're absolutely right .. I should have tested that first.
I just assumed ON TEXT would have higher priority
than ON OPEN making me think it would trigger first.

Top