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.

custom flag

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
C
Cr0ntab
Voice
Posts: 22
Joined: Fri Mar 26, 2010 11:31 am

custom flag

Post by Cr0ntab »

Hello i want a tcl(i believe it is an easy one).
i want the bot to give auto mode +a on the users that have +A flag.like it gives +v on +g users.(affected by chanset aop-delay).
for example if i have global +A i want the bot when it can to give me +a channel mode on join like the +v with +g flag and +o with +a flag
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

Code: Select all


bind join - "% *" giveSOP


proc giveSOP {nick uhost handle chan} {

	if {[matchattr $handle A]} {
		putserv "mode $chan +a $nick"
	}
}


This method of auto-awarding +a is not secure, as the bot is watching the users hostmask.
I think that if you want certain users, with certain flags, to be able to get +a, then it would be better for these users to have to identify themselves with a password.

On the one network I tried the above script on, I could not fully test it.
This was because the bot was not the channel owner, and only the channel owner can award +a there.
I could see that the bot did try to award +a though, and was denied.
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

With something like this script below, your users that you set +A, could send a /msg to the bot, using their password, and the bot would award them +a (if the server allows it)

Code: Select all


# Tell the user to send:
# /msg <botnick> #channel <password_here>
# ( User must have +A, else script will not award +a)
#
# Example:
#          /msg AnyBot #chittychat xyz123abc
#


bind msg - "!sop" SOPviamsg



proc SOPviamsg {nick uhost handle text} {
global botnick

	set chan [lindex [split $text] 0]


	if {![botonchan $chan]} {
		putserv "privmsg $nick :$botnick is not on channel $chan"
		return 0
	   }


	if {[passwdok $handle [lindex [split $text] 1]] && [matchattr $handle A]} {
		putserv "mode $chan +a $nick"
		} else {
		putserv "privmsg $nick :Syntax: /msg $botnick #channel <password_here> "
		}
}






Again, this could not be fully tested, as the bot was not the channel owner in the test channel I used.
Post Reply