This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Matchattr problems in If statement

Old posts that have not been replied to for several years.
Locked
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Matchattr problems in If statement

Post by Weirdo »

Code: Select all

if {[matchattr $dragon(victim) omn $conchan] == 1} {
		putlog "Unable to kick $dragon(victim). User is a registered Botnet Operator/Master/Administrator. Please place direct complaint to Founder/sucessor or use the standard kick command"
		return 0
		}
Well, this is part of the validation for a partyline based kick script. What i want is it to prevent the kicking of any registered op/master/owner on the bot. Problem is, when this is in the script, it allows ops to be kicked, and when i swap the logic around, everyone is a op according to the script.
matchattr <handle> <flags> [channel]
Returns: 1 if the specified user has the specified flags; 0 otherwise
Module: core
this is the reference i have used. Am completely bewildered why this is screwing up on me
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

$dragon(victim) is victim's nick or handle?
Once the game is over, the king and the pawn go back in the same box.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

The matchattr flag syntax is a little confusing.

Use omn|omn instead of plaint omn
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

caesar wrote:$dragon(victim) is victim's nick or handle?
!dragon <victim>

Victim, not handle. Handle is still $hand
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Then you have made an incorect usage of the 'matchattr'..

It should be something like: if {[matchattr [nick2hand $dragon(victim) $conchan] omn|omn $conchan]} {

or: if {[matchattr $hand omn|omn $conchan]} {
Once the game is over, the king and the pawn go back in the same box.
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

Yup, it was the use of nickname, instead of handle, that screwed it up :)
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

hehe, that happens when we don't read carefuly ;]
Once the game is over, the king and the pawn go back in the same box.
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

Tell em about it

Any idea how to use newchanban in a DCC procedure. Cant figure out how to get the host in there at all
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

well you could use getuser to get the host known to the eggdrop...

another option is to use hand2nick to get the nickname of the handle given, then use getchanhost on the nick to get the uhost.... this ofcourse only works if the handle/nick actually is on any of the bots channels
Elen sila lúmenn' omentielvo
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

I figured it :)

Code: Select all

set giga(host) [lindex [split [getchanhost $giga(victim)] "@"] 1]
set giga(reason) "GIGA SLAVE!!!"
newchanban $conchan *!*@$giga(host) $hand $giga(reason) 60
My extreme crappy-ness with Strings saved me, took me 2 hours to figure that one out on my own :P (I suck)

Works pretty good tho now :)
Locked