mIRC Homepage
Posted By: Kev_Uk scan channel for certain nicknames then leave - 28/07/05 10:45 AM
How do i go about making a script that adds users to a list that when they join a channel i part it, and also scans the channel every say 5 minutes to see the if the nickname is in the channel then leaves.

I have made this part

on *:join:#channel:{
if $nick == nickname && $nick(#,$me,!) { part # }
}

Not sure if it's possible to scan if you have left the channel to know when to come back in there if the person isn't in there.
Code:
 on !*:join:#:{
  .hinc -m Watch $+(Nick.,0)
  .hadd -m Watch $hget(Watch,0) $nick
  part $chan
}
on *:start:{
  .hmake Watch 10
}
on *:connect:{
  .timer 0 300 watch
}
alias watch {
  var %a = 1
  while %a <= $hget(Watch,0) {
    .enable #watch
    .whois $hget(Watch,%a)
    inc %a
  }
}
#watch off
raw 301:*: halt 
raw 311:*: halt 
raw 313:*: halt 
raw 312:*: halt 
raw 330:*: halt 
raw 319:*: { 
  if !$istok($3-,<channel>,32) {
    .join <channel>
  }
  halt 
} 
raw 318:*: .disable #watch | haltdef 
#watch end 
 


You'll have to replace <channel> with the actual name of the channel you want to monitor
thanks just checked it out, haven't done the watch part yet, but it seems whatever channel this nickname enters i still leave.
That's part of what you asked for
Quote:
when they join a channel i part it
Yea but only with the channels i wrote down
If you only want it for specific channels, change the # in the ON JOIN event to the actual channel names and separate the channel names with commas.

If you have more than one channel, add additional istok lines in the appropriate raw event

That's the easiest way especially if it's only for say up to 4 or maybe 5 channels

If you want to handle more channels than that, let me know and I'll make some code adjustments
© mIRC Discussion Forums