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.
Old posts that have not been replied to for several years.
arfer
Master
Posts: 436 Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK
Post
by arfer » Sun Jan 16, 2005 12:04 pm
I've made a pretty stupid mistake, I know it. Cant get this to work though
bind MODE - * pDemote
proc pDemote {nick uhost hand chan mode victim} {
global botnick
if {$victim == $botnick && $mode == +o} {
pushmode $chan -o $botnick
putserv "PRIVMSG $chan :Please don't Op me, I'm not experienced enough"
}
if {$victim == $botnick && $mode == +v} {
pushmode $chan -v $botnick
putserv "PRIVMSG $chan :Please don't Voice me, I find it a bit scary"
}
}
I get
Tcl error [pDemote]: syntax error in expression "$victim == $botnick && $mode == +o": variable references require preceding $
I just cant see the error
spock
Master
Posts: 319 Joined: Thu Dec 12, 2002 8:40 pm
Post
by spock » Sun Jan 16, 2005 12:53 pm
$var == "whatever" <- note the ""
other than that, i would suggest using [isbotnick $victim]
photon?
avilon
Halfop
Posts: 64 Joined: Tue Jul 13, 2004 6:58 am
Location: Germany
Post
by avilon » Sun Jan 16, 2005 12:55 pm
Code: Select all
if {[isbotnick $victim] && ($mode == "+o")} {
Last edited by
avilon on Sun Jan 16, 2005 2:24 pm, edited 1 time in total.
arfer
Master
Posts: 436 Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK
Post
by arfer » Sun Jan 16, 2005 1:11 pm
Thanks avilon/spock. Incorperated your 2 suggestions and dont get an error now. Howeverr, whilst the channel message is displayed, the demotion doesn't occur.
bind MODE - * pDemote
proc pDemote {nick uhost hand chan mode victim} {
global botnick
if {[isbotnick $victim] && $mode == "+o"} {
pushmode $chan -o $botnick
putserv "PRIVMSG $chan :Please don't Op me, I'm not experienced enough"
}
if {[isbotnick $victim] && $mode == "+v"} {
pushmode $chan -v $botnick
putserv "PRIVMSG $chan :Please don't Voice me, I find it a bit scary"
}
}
spock
Master
Posts: 319 Joined: Thu Dec 12, 2002 8:40 pm
Post
by spock » Sun Jan 16, 2005 1:23 pm
works for me. try adding a "flushmode $chan" (shouldnt really be needed)
or use putserv "MODE $chan -o $victim" instead of pushmode
as for devoicing itself when it wont allow itself to be opped, that wont work unless it's halfopped (or some other funky stuff)
edit: speelingg broken
photon?
arfer
Master
Posts: 436 Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK
Post
by arfer » Sun Jan 16, 2005 2:17 pm
silly me
yeh the op/deop works but it cant devoice if it doesnt have ops
I'll just go crawl down a hole somewhere
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Sun Jan 16, 2005 4:11 pm
i think you could do this as well
id say thats a pretty right way to use it .. the bind that is..
XplaiN but think of me as stupid