mIRC Homepage
Posted By: jeroenganges Check member list for name - 20/05/07 01:26 PM
Hi,

is there a script that checks if someone that joins your channal is in a member list. And if it's not, it kicks him?

(yep bad english i'm dutch)
Posted By: s0urce Re: Check member list for name - 20/05/07 02:42 PM
Code:
on *:join:#chan: { if (!$istok(%allowed,$nick,32)) && ($me isop $chan) { ban -k $nick You are Not allowed on this channel } } 

Code:
alias allow {
  if (!$istok(%allowed,$$1,32)) { set %allowed $addtok(%allowed,$$1,32) | echo -a $$1 added to your allow list }
  else { echo -a Error $$1 is already on your allow list }
}

Add those, and everytime you want to allow someone you type /allow someonesnickhere

I've made a delete one, too, but alterativly you can open up the variables tab and delete their nick
Code:
alias delete {
  if ($istok(%allowed,$$1,32)) {
    set %allowed $remtok(%allowed,$$1,32) | echo -a $$1 deleted from your allow list 
  }
  else { echo -a Error $$1 is not on your allow list 
  }
}
Posted By: jeroenganges Re: Check member list for name - 20/05/07 03:32 PM
And is there anyway it checks a web page or something if it contains the name that someone uses?
Posted By: s0urce Re: Check member list for name - 20/05/07 03:49 PM
Ummm.. No. My script doesn't... But if you want to use a lot of names you could make it read a text file or something.

on *:join:#: {
noop $read(c:\users\myname\filename.txt,s,$nick)
if ($readn == 0) { ban -k $nick You are Not allowed here }
}
But you'd have to copy their nicks to a text file, and the it would have to look something like this

nick1
nick2
nick3..
etc...
I think using hashs would be better.
Posted By: RusselB Re: Check member list for name - 20/05/07 04:15 PM
This could be done using sockets, however, we would need the exact address of the website before we could go much, if any, further with this.
Posted By: RusselB Re: Check member list for name - 20/05/07 04:18 PM
For something like this, where the information is stored, and then accessed infrequently, using a text file is actually better than a hash table, as it will save on memory requirements, and, on average, the extra time required to read the text file, versus having to check a hash table, just to see if the entry exists (or not) is miniscule.
Posted By: jeroenganges Re: Check member list for name - 20/05/07 04:29 PM
Ok i will try if i can install the script, i am a noob in this kind of things ^^
Posted By: jeroenganges Re: Check member list for name - 20/05/07 05:52 PM
sry for the doublepost:

it doesn't work, must there be an exect location you place it or is anywhere in the remote just fine?
Posted By: RusselB Re: Check member list for name - 20/05/07 11:27 PM
Putting the code in any remote file is fine, however, note that the code itself requires the text file with the multiple nicks to be in a specific location, and have a specific name. You can, of course, change that information, but it also has to be changed in the script.
© mIRC Discussion Forums