mIRC Homepage
Posted By: vinnie19 Kick users - 09/01/08 10:23 PM
Hello all,

Im looking for a script i can putt in script editor (remote)

The script needs to kick all incoming users in the channel that er not voiced or opped in the channel.
After a time of 5 seconds or something.

Is this possible?
Posted By: jakerandall Re: Kick users - 09/01/08 11:24 PM
Yes it is, i beleive it will be a simple script.
I am not very good on them but ill have a crack
Posted By: Zonk Re: Kick users - 10/01/08 01:27 AM
6 months since i scripted the last time, but should work =)

on *:join:#yourchannelhere: {
.timer $+ $nick 1 5 checkuser $chan $nick
}
alias checkuser { if (($2 !isop $1) && ($2 !isvoice $1) && ($2 ison $1)) kick $1 $2 kickreason }

this will not work if the user changes his nick instantly after he joined the chan, but that will happen pretty rarely i think...
Posted By: Riamus2 Re: Kick users - 10/01/08 03:07 AM
Here...

Code:
on @*:join:#yourchannel: {
  .timerKickRegs 1 5 KickRegs $chan
}
alias KickRegs {
  var %t = $nick($chan,0,r)
  while (%t) {
    kick $1 $nick($1,1,r)
    dec %t
  }
}


Just don't run it in a channel where there are a LOT of Regular users (not voiced/opped/etc) or you'll probably flood yourself off from kicking too many at once. If necessary, you can also throw a dynamic timer on the kick to avoid the problem, but based on what I think you're doing, it probably won't matter.
Posted By: vinnie19 Re: Kick users - 10/01/08 01:22 PM
Originally Posted By: Riamus2
Here...

Code:
on @*:join:#yourchannel: {
  .timerKickRegs 1 5 KickRegs $chan
}
alias KickRegs {
  var %t = $nick($chan,0,r)
  while (%t) {
    kick $1 $nick($1,1,r)
    dec %t
  }
}


Just don't run it in a channel where there are a LOT of Regular users (not voiced/opped/etc) or you'll probably flood yourself off from kicking too many at once. If necessary, you can also throw a dynamic timer on the kick to avoid the problem, but based on what I think you're doing, it probably won't matter.


This script only kicks normal users (not voice or op)?

And im in a channel with not a lot of people.

EDIT: Tested the script but when i login als normal user then i dont get kicked i restarted my MIRC so i gonna check now again


And this one:
Code:
on *:join:#yourchannelhere: {
.timer $+ $nick 1 5 checkuser $chan $nick
}
alias checkuser { if (($2 !isop $1) && ($2 !isvoice $1) && ($2 ison $1)) kick $1 $2 kickreason }


Does that kick also OP because he checks it?
Posted By: vinnie19 Re: Kick users - 11/01/08 02:23 PM
Hmm nobody wants to help me anymore? frown
Posted By: RoCk Re: Kick users - 11/01/08 03:01 PM

You said in your original post that you didn't want voiced or opped users kicked...

Originally Posted By: vinnie19

kick all incoming users in the channel that er not voiced or opped in the channel


Posted By: Riamus2 Re: Kick users - 11/01/08 09:20 PM
The script I gave you will only kick "Regular" users (i.e. Users who do not have any status in the channel including voice, op, etc), which is what you asked for.

Now, keep in mind 3 things with that script. First of all, the client running the script MUST be an op for it to work. Second, if the client running the script joins, it will not kick anyone at that time because it is obviously not an op at that time. Third, make sure you change the channel name to the channel you want it to work in.

To test it, make the client that has this script an OP (or higher) in a channel and change the channel name in the script to match. Then have someone join the channel and don't give that person voice/op/etc. Wait the 5 seconds and they should be kicked.
Posted By: vinnie19 Re: Kick users - 19/01/08 03:21 PM
I tryed the scripts but the dont work confused frown

Can anybody help me with this one
Posted By: Riamus2 Re: Kick users - 19/01/08 09:27 PM
"doesn't work" is about the least helpful thing you can say. *WHAT* does not work? What happens or doesn't happen? What messages/errors do you see? Etc. How are you running it? Is it in a bot or on your main client? Is the client running it opped? Is the client running it already in the channel and opped when someone joins who doesn't get voiced in the time frame? You see, more details are required for people to help.
Posted By: vinnie19 Re: Kick users - 20/01/08 12:17 PM
Oke i got Dreambot running on the server but the commands doent work anymore from dreambot (dont know why) so i made my own script and loaded it in dreambot. Its just a simple script which gives some people OP and VOICE that are allowed in the channel. And you can use the script for commands (!op - !deop - !voice - !devoice - !kick) I putted the script under that script. (in the same script still). When a user enters there is happening nothing no errors no kicks. He can be in the channel as long as he wants as user (not voice or op). I putted in the script editor under Remote. The Dreambot client is +oa (opped and service admin i think). The dreambot client is running on a server in my own house. I tested the script with a other client on my own laptop.
Posted By: Riamus2 Re: Kick users - 20/01/08 11:49 PM
You did change the channel name to match, right?

Other than that, put an ECHO line in the alias and in the event so that you can see where it's failing.

Insert the following into the first line in your event (right after the on TEXT line):

echo -a EVENT

Then, insert the following into the first line in your alias (right after the line that starts with "alias"):

echo -a ALIAS

That will narrow down the problem as it should work just fine.
Posted By: vinnie19 Re: Kick users - 21/01/08 05:43 AM
Code:
on @*:join:#channel: { -a EVENT
  .timerKickRegs 1 5 KickRegs $chan
}
alias KickRegs { -a ALIAS
  var %t = $nick($chan,0,r)
  while (%t) {
    kick $1 $nick($1,1,r)
    dec %t
  }
}


I dont see any on TEXT.
But is this then correct (above)
Posted By: Riamus2 Re: Kick users - 21/01/08 11:20 AM
Sorry, meant on JOIN.

Just move the echo to the next line (inserting it as a new line) rather than having it on the lines you have it on. It may still work there, but it's better to have it on its own line. Then have someone join as usual. You should get both echoes... one immediately and one after the timer expires. Remember that the bot/client running the script has to be an op.
Posted By: asmodeo Re: Kick users - 21/01/08 05:04 PM
Originally Posted By: vinnie19

The script needs to kick all incoming users in the channel that er not voiced or opped in the channel.
After a time of 5 seconds or something.


Hi vinnie19!

You can set mode +N in your channel if you don´t want to have problems with nickchanges. And the code, for example this:

Code:
On @*:JOIN:#myroom:{
   set -u6 %nick $nick
   .timerkicks 1 5 userlook
}
alias userlook {
   if %nick isreg # { kick # %nick reason }
   else { halt }
}


If users aren´t in your access levels list, you must do this:
/msg ChanServ set #myroom restricted on
and only will join in your room users that be in your access list.

Bye smile
Posted By: vinnie19 Re: Kick users - 21/01/08 05:20 PM
asmodeo.

You code doesnt work nothing is happening.

Riamus2

I tryed it with -a EVENT and -a ALIAS but nothing happend i didnt get any error or some kind of messages
Posted By: asmodeo Re: Kick users - 21/01/08 05:29 PM
It´s true, you try other code.

But reply this question, please. Exactly, Do you want kicked all users that haven´t got level in the channel?
In this form, test set mode in ChanServ:
/msg ChanServ SET #myroom restricted on

This´s the best form, I think.

Bye smile
Posted By: vinnie19 Re: Kick users - 21/01/08 06:45 PM
I just want a code im not asking to lock the channel. Its not for all time
Posted By: Riamus2 Re: Kick users - 21/01/08 10:18 PM
Originally Posted By: vinnie19
asmodeo.

You code doesnt work nothing is happening.

Riamus2

I tryed it with -a EVENT and -a ALIAS but nothing happend i didnt get any error or some kind of messages


That means that either you did not change the channel name in the script to match your channel like you were told to do or else you have a conflict with the on JOIN event. Put the script in a new, empty file and try again. And make sure you don't have remotes off (do other scripts work?).
Posted By: vinnie19 Re: Kick users - 22/01/08 06:22 PM
I know i didnt forgot to change the channel.

I really putted the channel in the correct way. in the script.

And others scripts work which are in the script of me.
Posted By: Riamus2 Re: Kick users - 22/01/08 09:05 PM
Also, make sure that you put this in your REMOTES tab and not anywhere else.

If that's not the problem, copy and paste everything in the script file where you put this script so we can find the problem. Not all of your scripts... just what is in the same file as this one.
© mIRC Discussion Forums