mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 174
K
Kev_Uk Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Dec 2002
Posts: 174
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.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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

Joined: Dec 2002
Posts: 174
K
Kev_Uk Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Dec 2002
Posts: 174
thanks just checked it out, haven't done the watch part yet, but it seems whatever channel this nickname enters i still leave.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
That's part of what you asked for
Quote:
when they join a channel i part it

Joined: Dec 2002
Posts: 174
K
Kev_Uk Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Dec 2002
Posts: 174
Yea but only with the channels i wrote down

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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


Link Copied to Clipboard