mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 3
S
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Feb 2003
Posts: 3
Hello people,

Is there a way to make a script wait for the result of a RAW event?
I'm putting together a script that collects some userinfo
(IP, channels ppl are on, etc) and outputs that to a window.
The part i'm struggling with is this:


Code:
 
RAW 352:*: {  ;  [color:red] the RAW numeric for the WHO command [/color]

   %User.Nick = $6
   haltdef
   }


on *:dns: {

   set %User.Ip        0.0.0.0
   set %User.Nick
   set %User.Channels
   set %User.Address
   set %User.FullId
   set %User.Comment

   %User.Matches = $dns(0)

   if ( %User.Mode == UseNick ) {

      %User.Ip      = $dns(%User.Matches).ip
      %User.Nick    = $dns(%User.Matches).nick
      %User.Address = $dns(%User.Matches).addr

      pDisplayData
      }

   else {
      while ( %User.Matches > 0 ) {

         %User.Ip      = $dns(%User.Matches).ip
         %User.Address = $dns(%User.Matches).addr
         [color:red];  my problem: the command's executed but immediately after that, 
         ;  mirc continues with the next command in line, pDisplayData  [/color]
         who %User.Address  
         pDisplayData
         dec %User.Matches
         }
      }
}

pDisplayData displays (among other things) the value of %User.Nick, which receives its value in the RAW event.
Unfortunately, mIRC does not wait for that event to finish and immediately processes the command below (pDisplayData).
So: can i somehow tell mIRC to wait? So far i've tried a timer (no result) and a loop that kept running for as long as a
boolean wasn't reset by a RAW event i wrote for numeric 315 (the End of WHO-list) (didn't work either)

Any hints you can give me are much appreciated smile

Last edited by Hammer; 28/02/03 06:02 PM.
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
I haven't tried it though I've been told that if you pause at this time it will stall mIRC for the duration of the pause.

Joined: Feb 2003
Posts: 3
S
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Feb 2003
Posts: 3
Thanks, sounds like it's worth a shot but what's the command for a pause? Had a browse in the helpfile but didn't find it blush

Joined: Feb 2003
Posts: 9
A
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
A
Joined: Feb 2003
Posts: 9
Why don't you just move the pDisplayData in to the RAW ?... or atleast another version of it...

If you use Dynamic Variable names you can store the other stuff (the loop makes) for it to use..

---
Ok this might not have made any sense... but you seem smart ...

Joined: Feb 2003
Posts: 3
S
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Feb 2003
Posts: 3
Yes, i was doing that earlier (moving the display commands inside the RAW)
but it still amounts to the same effect: all on-DNS's are triggered in rapid succession,
with the RAW's doing their stuff whenever they receive the server response...
Well, since there doesn't seem to be an obvious way to make the script wait for a result (?), i'll workaround it. Thx all smile


Link Copied to Clipboard