mIRC Homepage
Posted By: _D3m0n_ ON part trouble - 15/03/03 03:29 AM
ok ive got a snippet here from my nicklist that just wont work when someone parts yet it works perfectly on any other on join op deop and whatnot i cant seem to figure out why ... i added an echo line into it to status to know infact it is triggering but its not giving me an error

Code:
on *:PART:#: {
  %sn = 1
  if $nick($chan($active),%sn,a) isreg $chan($active) { did -ra _nicklist 1 0 + 1 0 0 $nick($chan($active),%sn,a) }
  if $nick($chan($active),%sn,a) isop $chan($active) { did -ra _nicklist 1 0 + 2 0 0 $nick($chan($active),%sn,a) }
  if $nick($chan($active),%sn,a) ishop $chan($active) { did -ra _nicklist 1 0 + 3 0 0 $nick($chan($active),%sn,a) }
  if $nick($chan($active),%sn,a) isvoice $chan($active) { did -ra _nicklist 1 0 + 4 0 0 $nick($chan($active),%sn,a) }
  if $nick($chan($active),%sn,a) isowner $chan($active) { did -ra _nicklist 1 0 + 5 0 0 $nick($chan($active),%sn,a) }
  %sn = 2
  while ( $nick($chan($active),%sn,a) != $null ) {
    if $nick($chan($active),%sn,a) isreg $chan($active) { did -a _nicklist 1 0 + 1 0 0 $nick($chan($active),%sn,a) }
    if $nick($chan($active),%sn,a) isop $chan($active) { did -a _nicklist 1 0 + 2 0 0 $nick($chan($active),%sn,a) }
    if $nick($chan($active),%sn,a) ishop $chan($active) { did -a _nicklist 1 0 + 3 0 0 $nick($chan($active),%sn,a) }
    if $nick($chan($active),%sn,a) isvoice $chan($active) { did -a _nicklist 1 0 + 4 0 0 $nick($chan($active),%sn,a) }
    if $nick($chan($active),%sn,a) isowner $chan($active) { did -a _nicklist 1 0 + 5 0 0 $nick($chan($active),%sn,a) }
    inc %sn
  }
}


its kinda weird as hell that it just doesnt work on a part yet works perfectly thru join when the help file says its supposed to use the same variables??? anyhow again id appreciate any help in this ..... and ill go thru my scripts to make sure there isnt something else stopping it
Posted By: _D3m0n_ Re: ON part trouble - 15/03/03 03:48 AM
ok ironically enough i think ive figured this one out ...... another one of them pause mirc needs to execute the script properly ....... so what i did was make that nicklist populater into an alias and called it nicklistfiller then did this

on *:PART:#: { timer 1 0 nicklistfiller }

and it works right that way ..... its odd the more things i get into with mirc the more ive encountered this ...... i guess now i see why everyones been asking for some sort of puase for scripting ...... anyhow i figured it out and decided it would be nice to show others
Posted By: Nimue Re: ON part trouble - 15/03/03 04:27 AM
Well, it isn't really that mIRC needs a pause here, the problem is that until AFTER the part event, the nick is still on the channel. Using /timer 1 0.. (or /signal without the n switch) delays the execution until after the event has processed. Another way would be to use /updatenl before you do the processing, keeping in mind that this will also impact other scripts that follow this file in the load order.
Code:
on *:part:#:{
  updatenl
  <rest of code here>
}

The same is true for quits. Until after your script has finished processing the event, the nick is still 'live' and on any common channels.
Posted By: _D3m0n_ Re: ON part trouble - 15/03/03 04:40 AM
yeah i found out it applied to the quits as well and i did the same ..... for it and it also works ....... again ty for the help uve given me as of lately nimue i do greatly appreciate it
Posted By: Nimue Re: ON part trouble - 15/03/03 05:35 AM
No worries smile
© mIRC Discussion Forums