mIRC Home    About    Download    Register    News    Help

Print Thread
#169397 22/01/07 06:04 PM
Y
yetti
yetti
Y
Is it possible to call a single raw event?

Let me explain what I want to know smile

When you whois someone the server returns all OR some of these RAW 301, 307, 310, 311, 312, 313, 317, 318, 319.

RAW 317 is the idle and signon time.

I am interested in a way to make the server send me only the idle time when I give a command.

Can this be done without changing the whois output?
I want to have the mirc standard whois answer, but if I use a command like "/idle nick", i need mirc to give me only this:
raw 317:*: { echo -d $2 - idle for: $duration($3) }


#169404 22/01/07 07:37 PM
L
learn3r
learn3r
L
Code:
raw 311:*:{
  if %idle { halt }
  else {
    echo -a -
    echo -a Whois On: $2 ( $+ $3 $+ @ $+ $4 $+ )
    echo -a Real Name: $6-
    halt
  }
}

alias idle {
  set %idle $true
  whois $1
}
alias whois {
  set %idle $false
  whois $1 
}


same goes with the other raws
excempt for the
raw 317 of course

Last edited by learn3r; 22/01/07 07:38 PM.
#169406 22/01/07 09:21 PM
Y
yetti
yetti
Y
why isn't this working?

Code:
alias checkidle { set %var = 1 | whois $1 $1 }

raw 301:*: {
if ( %var == 1 ) ( halt }
else { echo -a $2- }
}
raw 311:*: {
if ( %var == 1 ) ( halt }
else { echo -a $2- }
}
raw 312:*: {
if ( %var == 1 ) ( halt }
else { echo -a $2- }
}
raw 313:*: {
if ( %var == 1 ) ( halt }
else { echo -a $2- }
}
raw 317:*: { 
if ( %var == 1 ) { echo -d $2 - idle for: $duration($3) @ $time } 
else { echo -a $2- }
}
raw 318:*: {
if ( %var == 1 ) ( halt }
else { echo -a $2- }
}
raw 319:*: {
if ( %var == 1 ) ( halt }
else { echo -a $2- }
}


#169408 22/01/07 09:27 PM
Joined: Jan 2007
Posts: 1,155
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,155
First thing I saw was ...

if ( %var == 1 ) ( halt }

( halt } Thats an open paren not an open bracket.

Not that you really need brackets. Also, I would suggest making the variable on a timer or unsetting the variable when finished with it. smile

DJ_Sol #169411 22/01/07 09:50 PM
Y
yetti
yetti
Y
thx DJ_Sol... I added a timer to unset the var, and I also added a "halt" after each else line.. but it stil does not work as it should..

all raw seem to go on the else branch cry

EDIT:
found the problem laugh

Last edited by yetti; 22/01/07 09:59 PM.
#169418 22/01/07 10:58 PM
Y
yetti
yetti
Y
is there a way I can find the raw number of a line?

ex:
Quote:
vizi is ~x@vizitatoarea.users.ro-chat.net * x
vizi on #apropo
vizi using *.ro-chat.net The Romanian-Chat.Network
vizi is logged in as vizitatoarea
vizi has been idle 6hrs 42mins 44secs, signed on Mon Jan 22 17:59:30
vizi End of /WHOIS list.


I cant find the raw for that line. I blocked all the whois raws.. so it's not from there.

any ideea?


Last edited by yetti; 22/01/07 10:58 PM.
#169421 22/01/07 11:20 PM
Joined: Nov 2005
Posts: 104
D
Vogon poet
Offline
Vogon poet
D
Joined: Nov 2005
Posts: 104
The easiest thing to do here, is to type
Code:
 /debug @raw 
and then /whois yourself or someone else. The output with the raw numeric will be outputed to the @raw window. Hope this is what you're looking for.

#169430 23/01/07 01:24 AM
L
learn3r
learn3r
L
Code:
alias checkidle {
  %idle = 1
  whois $1
}

raw 301:*: {
  if (%idle == 1) { halt }
  else { echo -a $2- }
}
raw 311:*: {
  if (%idle == 1) { halt }
  else { echo -a $2- }
}
raw 312:*: {
  if (%idle == 1) { halt }
  else { echo -a $2- }
}
raw 313:*: {
  if (%idle == 1) { halt }
  else { echo -a $2- }
}
raw 317:*: {
  if (%idle == 1) {
  echo -d $2 - idle for: $duration($3) @ $time
  [color:#FF0000]unset %idle[/color]
  }
  else { echo -a $2- }
}
raw 318:*: {
  if (%idle == 1) { halt }
  else { echo -a $2- }
}
raw 319:*: {
  if (%idle == 1) { halt }
  else { echo -a $2- }
}

#169451 23/01/07 06:01 AM
Y
yetti
yetti
Y
thanks drc4. /debug was exactly what I needed.

learn3r if I unset the var in raw 317, it will unset it before all the raws trigger.

thanks learn3r for your help, I couldn't have done it without your ideea smile

#169459 23/01/07 01:54 PM
S
Scripto
Scripto
S
Also, you had this...

set %var = 1 <~~~~~~~~ that sets %var to " = 1 "

(ya dont need the = when using /set, or it makes it part of your variable. ) smile

#169466 23/01/07 03:03 PM
Y
yetti
yetti
Y
yea.. thats why it didnt worked then.. and it went on the "else" branch.. cause %var had the value "= 1" smile

figured that one by myself.. I am scripting genius :P j/k


Link Copied to Clipboard