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.

correct use of 'bind mode'

Old posts that have not been replied to for several years.
Locked
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

correct use of 'bind mode'

Post by arfer »

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
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

$var == "whatever" <- note the ""

other than that, i would suggest using [isbotnick $victim]
photon?
User avatar
avilon
Halfop
Posts: 64
Joined: Tue Jul 13, 2004 6:58 am
Location: Germany

Post by avilon »

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.
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

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"
}
}
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

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?
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

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
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

i think you could do this as well

Code: Select all

bind mode o|o "* -o" command
id say thats a pretty right way to use it .. the bind that is..
XplaiN but think of me as stupid
Locked