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.

multiple channel modes

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

multiple channel modes

Post by Weirdo »

hey all. Having a bit of problem with this little script i wrote. Now, i want the bot to add multiple modes queued for each putserv. When you add halfops, it automatically removes voice. When it removes halfops, i want it to automaticllay add voice, on the same line. But it just doesnt work.

-h+v does only -h
-h +v does not much really, -h only

* Natsuki-Chan sets mode: -h+v MystMan MystMan

I want the bot to do that basically :)

Code: Select all

#Public binder for setting whether halfops are on
bind pub mn|mn !ahop pub:ahop
proc pub:ahop {nick uhost hand chan text} {
	set ahop(status) [lindex [split $text] 0]
	set ahop(hopping) [lindex [split $text] 1]
	if {$ahop(status) == "on"} {
		set $::ahop(check) "1"
		puthelp "Privmsg $chan :Halfopping has now been turned on"
		if {$ahop(hopping) == "hop"} {
			foreach user [chanlist $chan 2|2] {
				putlog "$user"
				set ahop(nick) [hand2nick $user $chan]
				putserv "Mode $chan +h $ahop(nick)"}
			}
	}
	if {$ahop(status) == "off"} {
		set $::ahop(check) "0"
		puthelp "Privmsg $chan :Halfopping has been turned off"
		foreach user [chanlist $chan 2|2] {
			putlog "$user"
			set ahop(nick) [hand2nick $user $chan]
			putserv "Mode $chan -h +v $ahop(nick)"
#			putserv "mode $chan  $ahop(nick)"
		}
	}
	putlog "$ahop(status) $ahop(hopping)"
}
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

The way the IRC protocol works is, for every user mode you place on a channel, you must have an argument to go with it...

So from what you are doing, you are only giving one argument, for both modes, instead of 2 arguments for both modes, which is needed.

ie.

Code: Select all

putserv "MODE #channel +o-v <nick1> <nick2>"
Even if nick1 == nick2 , you still need to specify it again.
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

Ah, thank you very much :)
Locked