mIRC Home    About    Download    Register    News    Help

Print Thread
#177130 20/05/07 01:26 PM
Joined: May 2007
Posts: 4
J
Self-satisified door
OP Offline
Self-satisified door
J
Joined: May 2007
Posts: 4
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)

Joined: Feb 2007
Posts: 27
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 27
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 
  }
}

Last edited by s0urce; 20/05/07 02:43 PM.
Joined: May 2007
Posts: 4
J
Self-satisified door
OP Offline
Self-satisified door
J
Joined: May 2007
Posts: 4
And is there anyway it checks a web page or something if it contains the name that someone uses?

Joined: Feb 2007
Posts: 27
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 27
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.

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

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

Joined: May 2007
Posts: 4
J
Self-satisified door
OP Offline
Self-satisified door
J
Joined: May 2007
Posts: 4
Ok i will try if i can install the script, i am a noob in this kind of things ^^

Joined: May 2007
Posts: 4
J
Self-satisified door
OP Offline
Self-satisified door
J
Joined: May 2007
Posts: 4
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?

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


Link Copied to Clipboard