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.

public commands & userflags

Old posts that have not been replied to for several years.
Locked
R
RaeTheGit

Post by RaeTheGit »

hi,

I'm a quite newbie on tcl and have a question on a script i created copying parts of another one.

the basic thing i have a problem with is, that i added a public fun-kick command, but i want to prevent global and channel +m and +n as well as bots from being kicked.

so far, global owners and bots dont get kicked.

(i dont understand every option/argument/whatever from this script as i copied the relevant bits, so please have mercy if theres something horribly wrong or complicated with this script)

this is, how far i have come with that target, i'd be thankfull for any help on this.

Code: Select all

set vampy_flags "Bmnfb|Bmnfb"
set no_vampy "#novamp"
.
.
.
bind pub - !beiss pub_beiss
proc pub_beiss {nick uhost hand chan arg} {
global no_vampy vampy_flags
if {[matchattr $arg $vampy_flags $chan] || [matchattr $arg $vampy_flags]} { return 0 }
putlog "$nick used !beiss $arg"

putchan $chan "blablabla with $arg"
puthelp "KICK $chan $arg :moreblabla"
putnotc $arg "still some more blabla"

}
proc vampyflagcheck {user chan} {
global vampy_flags
set protected 0
set user [nick2hand $user]
 if {[matchattr $user $vampy_flags $chan] || [matchattr $user $vampy_flags]} {
  set protected 1
 }
 return $protected
}
thanks in advance for helping me

oh, and i need to prevent the bot from kicking itself ... it does that :sad:

<font size=-1>[ This Message was edited by: RaeTheGit on 2002-03-03 21:25 ]</font>
W
Wcc
Master
Posts: 278
Joined: Sun Oct 28, 2001 8:00 pm
Location: USA
Contact:

Post by Wcc »

Try this:

Code: Select all

set vampy_flags "Bmnfb|Bmnfb"
set no_vampy "#novamp"

bind pub - !beiss pub_beiss

proc pub_beiss {nick uhost hand chan arg} {
	global no_vampy vampy_flags
	set arg [lindex [split $arg] 0]
	if {[matchattr [nick2hand $arg] $vampy_flags $chan] || [isbotnick $arg]} { return 0 }
	putlog "$nick used !beiss $arg"
	putserv "PRIVMSG $chan :blablabla with $arg"
	putserv "KICK $chan $arg :moreblabla"
	putserv "NOTICE $arg :still some more blabla"
}
R
RaeTheGit

Post by RaeTheGit »

thanks a lot!

u dont know how happy u made some people :smile::)

it works just perfekt :eek:)
Locked