mIRC Home    About    Download    Register    News    Help

Print Thread
#231240 09/04/11 07:14 PM
Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 96
I have a simple bot in my chan guarding it
and basicaly I have 3 levels affected with commands (10, 20 and 1000)

to stop channel advertising I used this
Code:
on *:text:#*:#:{ if ($level($fulladdress) <= 9) { .ban -k $chan $nick 2 ban_message } }


but for some reason it only works if i remove the if statement
(no level checkup), but then its pointless...

I just want non level users to be banned and this doesn't work
for some weird reason...
I tried even with just <

any help ?

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Have you tested $level($fulladdress) to verify that it is returning the correct information? Do you have any other text events above this in the same file?

Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 96
I'm testing level directly from my inputs in chan

yes it is 1st on text event in file

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Use echo to test your scripts.

on *:text:#*:#:{
echo -a : $level($fulladdress) <=9?
;if ($level($fulladdress) <= 9) { .ban -k $chan $nick 2 ban_message }

}

Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
on *:text:*#*:#: { if ($level($fulladdress) >= 9) { .ban -k $chan $nick 2 ban_message } }

added a * (so it also catches #channel in the middle of a sentence) and a space between : & {

Last edited by CtrlAltDel; 09/04/11 09:39 PM.

I refuse to engage in a battle of wits with an unarmed person. wink
Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 96
Originally Posted By: DJ_Sol
Use echo to test your scripts.

on *:text:#*:#:{
echo -a : $level($fulladdress) <=9?
}


this helped alot mate, thanks

the screwup was on my side since on user list i thought
if i add ; infront of address that mirc ignores it then
only by removal it worked :P

thanks laugh


@ctraltdel: thanks for effort too, but your snippet bans even if user is on lvl list :P

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Quote:
@ctraltdel: thanks for effort too, but your snippet bans even if user is on lvl list :P
Probably because ctrlaltdel changed the level lookup from <= 9 to >= 9

Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
oops blush
[edit]
even at that it wouldn't work here ..
Code:
on *:text:*#*:#: {
  if ($level($fulladdress) <= 9) { return }
  .ban -k # $nick 3 
}

that does, though

(one line):
on *:text:*#*:#: { if ($level($fulladdress) <= 9) { return } | .ban -k # $nick 3

Last edited by CtrlAltDel; 09/04/11 11:46 PM.

I refuse to engage in a battle of wits with an unarmed person. wink
Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 96
btw... for:

Originally Posted By: CtrlAltDel
and a space between : & {


I have all my "code" with merged :{ (and they all work ok)
why did you do it separated ?

is there some difference ?

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Some people do it like that. I always written my code with no space there. I try to get rid of uneeded spaces.

Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
I got in the habit of making everything as easy to understand as possible because I share with several people that aren't very "technologically advanced" (but want to "edit" their own sometimes) (thus no one liners), and since I started with a space there, I continue to do so.


I refuse to engage in a battle of wits with an unarmed person. wink

Link Copied to Clipboard