mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#85755 07/06/04 12:08 AM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Can anyone tell me whats wrong with this script? Its supose to kick and ban anyone who idles on channel and is not level 11 or 10 in remote.ini!!!!


on me:*:JOIN:#channel: .timer 0 5 CheckIdlers

alias CheckIdlers {
if ($ulevel != 10) || ($ulevel != 11) {
if ($nick(%chan,%a,r).idle > 20) { ban -ku300 %chan $nick(%chan,%a,r) 2 ยง5 Please do not idle. Return in a while if you need help or want to help }
dec %a
}
}


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#85756 07/06/04 01:17 AM
Joined: Feb 2003
Posts: 67
N
Naz Offline
Babel fish
Offline
Babel fish
N
Joined: Feb 2003
Posts: 67
You didn't set a value for %chan or %a such as... var %a = $nick(%chan,0)


Those who live by the sword get shot by those who don't.
#85757 07/06/04 02:01 AM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
sorry dont know what you mean where should i put it?


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#85758 07/06/04 02:17 AM
Joined: Feb 2003
Posts: 67
N
Naz Offline
Babel fish
Offline
Babel fish
N
Joined: Feb 2003
Posts: 67
I also just noticed that you didn't add a kick event either.
Code:
alias CheckIdlers {
  [color:blue]var %chan = #YourChannel, %a = $nick(%chan,0) [/color] 
  while %a {
    if ($ulevel != 10) || ($ulevel != 11) {
      if ($nick(%chan,%a,r).idle > 20) { 
        ban -ku300 %chan $nick(%chan,%a,r) 2 [color:blue]| kick %chan $nick(%chan,%a,r)[/color] Please do not idle. Return in a while if you need help or want to help 
      }
    }
    dec %a
  } 
}   



Those who live by the sword get shot by those who don't.
#85759 07/06/04 03:51 AM
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
Quote:
ban -ku300 %chan $nick(%chan,%a,r) 2

the kick is there grin


I refuse to engage in a battle of wits with an unarmed person. wink
#85760 07/06/04 04:21 AM
Joined: Feb 2003
Posts: 67
N
Naz Offline
Babel fish
Offline
Babel fish
N
Joined: Feb 2003
Posts: 67
Ah yes, completely over looked it :tongue:


Those who live by the sword get shot by those who don't.
#85761 07/06/04 12:51 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
well thanks smile But the script doesnt work confused


on me:*:JOIN:#channel: .timer 0 5 CheckIdlers

alias CheckIdlers {
var %chan = #channel %a = $nick(%chan,0)
while %a {
if ($ulevel != 10) || ($ulevel != 11) {
if ($nick(%chan,%a,r).idle > 20) {
ban -ku300 %chan $nick(%chan,%a,r) 2 Please do not idle. Return in a while if you need help or want to help
}
}
dec %a
}
}


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#85762 07/06/04 02:22 PM
Joined: Feb 2003
Posts: 67
N
Naz Offline
Babel fish
Offline
Babel fish
N
Joined: Feb 2003
Posts: 67
When you declare more than one variable on the same line they need to be seperated by a comma.

var %chan = #channel, %a = $nick(%chan,0)



Those who live by the sword get shot by those who don't.
#85763 07/06/04 04:20 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
now the script almost works! But it still kicks level 10 & 11 users if thay dont have voice or op! The script is supose to kick and ban anyone who idle who is not level 11 or 10 user!


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#85764 07/06/04 04:42 PM
Joined: Mar 2004
Posts: 108
X
Vogon poet
Offline
Vogon poet
X
Joined: Mar 2004
Posts: 108
if ($ulevel < 10) || ($ulevel > 11) {

try that

-cheers


sometimes these are as bad as quit messages :tongue:
#85765 07/06/04 05:23 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
hmm Sorry Yoda but it still doesnt work confused confused


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#85766 07/06/04 05:25 PM
Joined: Feb 2003
Posts: 67
N
Naz Offline
Babel fish
Offline
Babel fish
N
Joined: Feb 2003
Posts: 67
I'm assuming wink that you've already added users with "auser" or "guser" to your userlist.
The example below is based on users added to the userlist with type 2 (*!*@host). It was not tested.
Code:
alias CheckIdlers {
  var %chan = #YourChannel, %a = $nick(%chan,0)  
  while %a {
    var %nick = $address($nick(%chan,%a,r),[color:blue]2[/color])
    if (!$ulist(%nick,10,1) || !$ulist(%nick,11,1)) {
      if ($nick(%chan,%a,r).idle &gt; 20) { 
        ban -ku300 %chan $nick(%chan,%a,r) 2 Please do not idle. Return in a while if you need help or want to help
      }
    }
    dec %a
  } 
}   
 


Those who live by the sword get shot by those who don't.
#85767 07/06/04 05:31 PM
Joined: Mar 2004
Posts: 108
X
Vogon poet
Offline
Vogon poet
X
Joined: Mar 2004
Posts: 108
hehe, I should read the code a lil closer before posting. what Naz posted should work for ya. sorry. smile


sometimes these are as bad as quit messages :tongue:
#85768 07/06/04 05:34 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Still doesnt work as its supose to im sorry frown


Lets just start from the beginning and forget the script we have been working on...... I want the script to kick and ban ALL who isnt level 10 or 11 on the channel even if thay are opped.... BUT.. If a level 10 or 11 join its not supose to kick and ban them no mater what..... Do you understand?


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#85769 07/06/04 06:09 PM
Joined: Feb 2003
Posts: 67
N
Naz Offline
Babel fish
Offline
Babel fish
N
Joined: Feb 2003
Posts: 67
Ok, it had appeard you only wanted to k/b regular users.

$nick(%chan,%a,r) is only going to act on "regular" users, meaning not voiced or opped. If you want it to include everybody just make that identifier $nick(%chan,%a)

Also, again make sure that the users are added to the userlist and that you are checking for the same type of hostmask here --> $address($nick(%chan,%a),2)

The alias looks fine. If it doesn't work after changing that identifier, place an echo -a statement after every line that should return something (one line at a time to avoid confusion). That will make the alias echo back to you the info it is getting which will help you see where it it breaking.

For instance, under this line.... var %nick = $address($nick(%chan,%a),2)
put this line.... echo -a %nick
That would echo back the the var %nick for every nick it checks. If it didn't echo anything then you would know the var wasn't being set correctly. (Just an example) It's easier to fix when you know where it is breaking.


Those who live by the sword get shot by those who don't.
#85770 07/06/04 06:18 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Code:
alias CheckIdlers {
 var %chan = [color:red]$1[/color], %a = $nick(%chan,0)
 while %a {
  if ($ulevel != 10) || ($ulevel != 11) {
   if ($nick(%chan,%a).idle &gt; 20) {
    ban -ku300 %chan $nick(%chan,%a) 2 Please do not idle. Return in a while if you need help or want to help
  }
 }
dec %a
 }
}
This should work. Note that the usage of the alias is /checkidlers #channel, so $1 is the identifier for the channel name in that alias. The var %chan has to be set to $1 then.

Hope this works!

Zyzzy. smile


"All we are saying is give peace a chance" -- John Lennon
#85771 07/06/04 07:06 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
hmm if i use this script nothing hapents:

on me:*:JOIN:#needhelp: .timer 0 5 CheckIdlers

alias CheckIdlers {
var %chan = $1, %a = $nick(%chan,0)
while %a {
if ($ulevel != 10) || ($ulevel != 11) {
if ($nick(%chan,%a).idle > 20) {
ban -ku300 %chan $nick(%chan,%a) 2 Please do not idle. Return in a while if you need help or want to help
}
}
dec %a
}
}


And if i use this one, it kicks and bans everyone also level 10 & 11 users:


on me:*:JOIN:#needhelp: .timer 0 5 CheckIdlers

alias CheckIdlers {
var %chan = #needhelp, %a = $nick(%chan,0)
while %a {
if ($ulevel != 10) || ($ulevel != 11) {
if ($nick(%chan,%a).idle > 20) {
ban -ku300 %chan $nick(%chan,%a) 2 Please do not idle. Return in a while if you need help or want to help
}
}
dec %a
}
}



confused confused confused


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#85772 07/06/04 07:18 PM
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
try this:

Code:
 alias CheckIdlers {
  var %chan = #needhelp, %a = $nick(%chan,0)
  while %a {
    if ($ulevel[color:red] ==[/color] 10) || ($ulevel [color:red]==[/color] 11)  [color:red]{ return } [/color] 
    if ($nick(%chan,%a,r).idle &gt; 20) {  
      ban -ku300 %chan $nick(%chan,%a) 2 Please do not idle. Return in a while if you need help or want to help
    }
dec %a
  }
}
 


I refuse to engage in a battle of wits with an unarmed person. wink
#85773 07/06/04 07:18 PM
Joined: Mar 2004
Posts: 108
X
Vogon poet
Offline
Vogon poet
X
Joined: Mar 2004
Posts: 108
this dont look right:
if ($ulevel != 10) || ($ulevel != 11) {
if ($ulevel != 10) or ($ulevel != 11) {
will ban some one level 10 or 11 since it will check both.
try:
if ($ulevel < 10) || ($ulevel > 11) {

on the second code set.

Ps. fire us we stink! if it still dont work after you try the above posts, ill test before my next post.. hehe.

-cheers



Last edited by xxxYODAxxx; 07/06/04 07:25 PM.

sometimes these are as bad as quit messages :tongue:
#85774 07/06/04 07:22 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
on me:*:JOIN:#needhelp: .timer 0 5 CheckIdlers $chan

Without the channel, the script will run with the channel parameters, which is crucial. If you specify the channel (in this case, $chan) then the $1 will be filled.

Hmm.. i think that doing that alias every 5 seconds might slow you down a bit (of course i don't know you computer's RAM so im saying compared to mine :P)

Hope this helps,
Zyzzy


"All we are saying is give peace a chance" -- John Lennon
#85775 07/06/04 07:40 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
The script still kicks and ban users with level 10 or 11!!!!

alias CheckIdlers {
var %chan = #needhelp, %a = $nick(%chan,0)
while %a {
if ($ulevel != 10) || ($ulevel != 11) {
if ($nick(%chan,%a).idle > 20) {
ban -ku300 %chan $nick(%chan,%a) 2 Please do not idle. Return in a while if you need help or want to help
}
}
dec %a
}
}


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#85776 07/06/04 07:46 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Try what CtrlAltDel suggested smile

if ($ulevel == 10) || ($ulevel == 11) { return }

instead of:

if ($ulevel != 10) || ($ulevel != 11) {

Also make sure that the mask in your user list matches the IP of the levels 11 & 10


"All we are saying is give peace a chance" -- John Lennon
#85777 07/06/04 08:58 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
$ulevel
Returns the user level that was matched for the currently triggered event.

The matching level when you trigger an event is your own level.

Also:
When you join a channel, mIRC knows of only one user on that channel, you. You have to wait until the names list is sent (raw 366 is the end of /names list) to know of other users on that channel, and you can't tell their user level until you have them in your IAL.

#85778 07/06/04 09:52 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
alias CheckIdlers {
var %chan = #needhelp, %a = $nick(%chan,0)
while %a {
if ($ulevel == 10) || ($ulevel == 11) { return }
if ($nick(%chan,%a).idle > 20) {
ban -ku300 %chan $nick(%chan,%a) 2 Please do not idle. Return in a while if you need help or want to help
}
}
dec %a
}
}



doesnt work! It chrashes mirc totaly :S

But i still dont know what will make it work confused


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#85779 07/06/04 10:04 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Well as I tried to explain .. using $ulevel can't work.
That alias would be freezing rather than crashing miRC. You have bracket mismatches and the /dec is outside the while { }....


Edit: Try this...
Code:
on me:*:join:#needhelp:inc %who. $+ # | who #
raw 315:*:{
  if %who. [ $+ [ $2 ] ] {
    unset %who. $+ $2
    .timer 0 60 check.idlers $2
    halt
  }
}
alias check.idlers {
  if $chan($$1).ial != $true { echo -ec i $1 IAL is not full for $1 | return }
  if $me !isop $1 { echo -ec i $1 You are not opped on $1! | return }
  var %i = 1
  while $nick($1,%i,r) {
    %a = $ifmatch
    if !$istok(10 11,$level($ial(%a)),32) &amp;&amp; $nick($1,%a).idle &gt; 20 {
      ban -ku300 $1 %a 2 Please do not idle. Return in a while if you need help or want to help.
    }
    inc %i
  }
}
raw 352:*:if %who. [ $+ [ $2 ] ] { halt }

To use it as an /alias you must specify the #channelname.. /check.idlers #needhelp

Edit again: Added check for your op status.

#85780 07/06/04 10:07 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Ok so the script is imposible to make? You cant make it do anything on a user level?


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#85781 07/06/04 10:34 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
ok so you want me to put #needhelp here:

alias check.idlers #needhelp { if $chan($$1).ial != $true { echo -ec i $1 IAL is not full for $1 | return }


cause if thats what you ment that doesnt work!


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#85782 07/06/04 10:43 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Nope. You don't need to put anything there, and what I posted is NOT one line, and will NOT work if you try and use it as such. you need to have it formatted as the 20 or so lines that it is in my post.

#85783 07/06/04 10:59 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
on me:*:join:#needhelp:inc %who. $+ # | who #
raw 315:*:{
if %who. [ $+ [ $2 ] ] {
unset %who. $+ $2
check.idlers $2
halt
}
}

alias check.idlers {
if $chan($$1).ial != $true { echo -ec i $1 IAL is not full for $1 | return }
var %i = 1 while $nick($1,%i,r) {
%a = $ifmatch
if !$istok(10 11,$level($ial(%a)),32) && $nick($1,%a).idle > 20 {
ban -ku300 $1 %a 2 Please do not idle. Return in a while if you need help or want to help.
}
inc %i
}
}
raw 352:*:if %who. [ $+ [ $2 ] ] { halt }



nothing hapends confused


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#85784 07/06/04 11:18 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Yeah change this part, sorry blush This will check every 60 secs from when you join (from when the who list is finished).
Code:
raw 315:*:{
  if %who. [ $+ [ $2 ] ] {
    unset %who. $+ $2
    [color:blue].timer 0 60[/color] check.idlers $2
    halt
  }
}


#85785 07/06/04 11:40 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
oh no wonder it didnt work :P

Well nobody is perfect wink


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#85786 07/06/04 11:46 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
on me:*:join:#needhelp:inc %who. $+ # | who #
raw 315:*:{
if %who. [ $+ [ $2 ] ] {
unset %who. $+ $2
timer 0 5 check.idlers $2
halt
}
}

alias check.idlers {
if $chan($$1).ial != $true { echo -ec i $1 IAL is not full for $1 | return }
var %i = 1 while $nick($1,%i,r) {
%a = $ifmatch
if !$istok(10 11,$level($ial(%a)),32) && $nick($1,%a).idle > 20 {
ban -ku300 $1 %a 2 Please do not idle. Return in a while if you need help or want to help.
}
inc %i
}
}
raw 352:*:if %who. [ $+ [ $2 ] ] { halt }



Sill nothing hapends :S no kick no ban no nothing confused


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#85787 07/06/04 11:48 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
var %i = 1 while $nick($1,%i,r) {
should be
  • var %i = 1
    while $nick($1,%i,r) {

#85788 08/06/04 12:04 AM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
oh my bad :S


YES NOW THE SCRIPT WORKS laugh laugh laugh laugh laugh

I made a change so ops and voiced who aint level 10 & 11 also will get kicked and banned

on me:*:join:#needhelp:inc %who. $+ # | who #
raw 315:*:{
if %who. [ $+ [ $2 ] ] {
unset %who. $+ $2
timer 0 5 check.idlers $2
halt
}
}

alias check.idlers {
if $chan($$1).ial != $true { echo -ec i $1 IAL is not full for $1 | return }
var %i = 1
while $nick($1,%i) {
%a = $ifmatch
if !$istok(10 11,$level($ial(%a)),32) && $nick($1,%a).idle > 20 {
ban -ku300 $1 %a 2 Please do not idle. Return in a while if you need help or want to help.
}
inc %i
}
}
raw 352:*:if %who. [ $+ [ $2 ] ] { halt }




Thanks alot for your great help. Your worth 5 stars wink

And sorry for all the troble!

- NoPleX


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
Page 1 of 2 1 2

Link Copied to Clipboard