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.

Bot Setting Wrong Modes [Help] {Solved}

Help for those learning Tcl or writing their own scripts.
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Bot Setting Wrong Modes [Help] {Solved}

Post by Branden »

Okay.. So it worked at first, till I had someone with chattr modes of h, and they were getting +qaohv... When they should have only gotten +hv...


Code: Select all

proc Up { nick host hand chan text } {
	if {[matchattr $hand n|n $chan]} { 
		putserv "MODE $chan +qaohv $nick $nick $nick $nick $nick" 
	} elseif {[matchattr $hand m|m $chan]} { 
		putserv "MODE $chan +aohv $nick $nick $nick $nick" 
	} elseif {[matchattr $hand o|o $chan]} { 
		putserv "MODE $chan +ohv $nick $nick $nick" 
	} elseif {[matchattr $hand h|h $chan]} { 
		putserv "MODE $chan +hv $nick $nick" 
	}
}


I don't know if this is why, but, each user don't have it's own handle. Each user that has access to the !up command is in a group which has a handle.

Example;

the handle Helpers has the host of *!*@Helper.CyberByteCafe.Co.CC, I want this group to be able to use !Up and only get +h

My problem is the bot is giving all modes (+qaohv)
Last edited by Branden on Sun Oct 05, 2008 3:31 pm, edited 3 times in total.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Unfortunately, the pushmode command does not understand some "non-standard" modes, and thus cannot handle/stack them properly.
NML_375
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Post by Branden »

I'm also getting the same problem with putquick.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

May I ask which modes does not work, and their meaning?
NML_375
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Post by Branden »

n|n get chan modes +qaohv
m|m get chan modes +aohv
o|o get chan modes +ohv
h|h get modes +hv
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Post by Branden »

By the way, my account has all modes, its the owner account, and its only getting channel modes +h
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

And the meaning of q and a?
NML_375
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Post by Branden »

UnrealIRCd's Channel Owner (q)
and Protected Op (a)


The bot will set the modes in other commands, just not this one.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Oh wait... you're using the same trigger with pub-bindings... that's the main problem...
PUB bindings does not stack, so any newer binding will override any previous one, thus making the only binding the halfop binding...

My suggestion, skip the flags in the binding, and do the proper privileges-check within the proc itself instead...
NML_375
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Post by Branden »

How do I do that?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

I'd use "matchattr":

Code: Select all

bind pub - !up up
...
 if {[matchattr $handle n|n $channel]} {
  putserv "MODE $channel +q $nick"
 } elseif {[matchattr $handle m|m $channel]} {
  ...
NML_375
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Post by Branden »

Need help again, please see initial post.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Would need examples of those different users, including added hostmasks...

Most likely, you've got one user (handle) with full privileges that has a very broad hostmask, also matching those having nick!user@Helper.CyberByteCafe.Co.CC.
NML_375
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Post by Branden »

Code: Select all

Handle: Root;
Hosts: *!*@NetAdmin.CyberByteCafe.Co.CC;
Modes: jlmnoptx;

Code: Select all

Handle: Admins;
Hosts: *!*@Admin.CyberByteCafe.Co.CC; *!*@CoAdmin.CyberByteCafe.Co.CC; *!*@ServicesAdmin.CyberByteCafe.Co.CC;
Modes: jlmoptx;

Code: Select all

Handle: Opers;
Hosts: *!*@GlobalOper.CyberByteCafe.Co.CC; *!*@LocalOper.CyberByteCafe.Co.CC;
Modes: ajloptx;

I want the handle Root to get channel modes: +qaohv
I want the handle Admins to get channel modes +aohv
I want the handle Opers to get channel modes +ohv


[/quote]
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

No other users with +n privileges?
NML_375
Post Reply