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.

+v-v $nick $nick in one line

Help for those learning Tcl or writing their own scripts.
Post Reply
n
neoclust
Halfop
Posts: 55
Joined: Fri Aug 14, 2009 11:03 am

+v-v $nick $nick in one line

Post by neoclust »

Hello can i use pushmode $chan +v-v $nick $nick in one line ?
L
Luminous
Op
Posts: 146
Joined: Fri Feb 12, 2010 1:00 pm

Post by Luminous »

Not exactly... pushmode is intended to lump several mode commands into a single line. Not sure why you would want to cancel out a mode like that, but this would probably work:

Code: Select all

pushmode $chan +v $nick
pushmode $chan -v $nick
n
neoclust
Halfop
Posts: 55
Joined: Fri Aug 14, 2009 11:03 am

Post by neoclust »

I tried that but it does not work :
utimer 10 [list pushmode $chan +v $nick]
utimer 1 [list pushmode $chan -v $nick]

the result :
[11:20] *** Eggy sets mode: +v neoclust
L
Luminous
Op
Posts: 146
Joined: Fri Feb 12, 2010 1:00 pm

Post by Luminous »

Back to back timers causes issues for me.. try something like this instead, even though its ugly:

Code: Select all

... code....
 utimer 10 [list cancel_mode $nick $chan]
... rest of code....
}
proc cancel_mode {nick chan} {
 pushmode $chan +v $nick
 pushmode $chan -v $nick
}
If that doesn't do it... I don't know.. :\
w
willyw
Revered One
Posts: 1209
Joined: Thu Jan 15, 2009 12:55 am

Re: +v-v $nick $nick in one line

Post by willyw »

neoclust wrote:Hello can i use pushmode $chan +v-v $nick $nick in one line ?
If you want to get it on one line, try:

Code: Select all

putserv "mode #chan -v+v $firstnick $secondnick"
but, did you mean to use the same nick twice? Nothing will happen if you use the same nick twice. ... maybe I'm not understanding the goal.
L
Luminous
Op
Posts: 146
Joined: Fri Feb 12, 2010 1:00 pm

Post by Luminous »

Yeah, puserv/quick/help would work just fine with that. I did a mode +b-b *!*@* *!*@* in one line in my egg a minute ago and it worked fine, aside from freaking out another bot that was on the channel, haha.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

The problem is pushmode will stack modes and wait for either the end of the invoked procedure, or flushmode before it actually sends them to the server. Modes enabling/negating the same thing get stripped naturally. To get around this, you can flushmode after the pushmode.

Code: Select all

pushmode $chan +v $nick
flushmode $chan
pushmode $chan -v $nick
flushmode $chan
n
neoclust
Halfop
Posts: 55
Joined: Fri Aug 14, 2009 11:03 am

Post by neoclust »

Hello i'm using

Code: Select all

utimer 10 [list cancel_mode $nick $chan]

proc cancel_mode {nick chan} {
        pushmode $chan +v $nick
        putlog "up"
        flushmode $chan
        pushmode $chan -v $nick
        putlog "down"
        flushmode $chan
}
I received the message putlog but remains devoice which was not the case
[22:37] ((nino): [21:37] Userfile loaded, unpacking...
[22:37] ((nino): [21:37] up
[22:37] ((nino): [21:37] down
[22:37] ((nino): [21:37] #test: mode change '+v fg' by nino !blah@blah.com
[22:40] ((nino): [21:40] @#test (+smtDn) : [m/3 o/1 h/0 v/2 n/0 b/0 e/- I/-]
In channel :
[22:37] *** [#test] users- 1 op(s) 33.33% - 1 voice(s) 33.33% - 1 other(s) 33.33%
[22:37] *** ········································
[22:37] *** nino sets mode: +v fg
n
neoclust
Halfop
Posts: 55
Joined: Fri Aug 14, 2009 11:03 am

Post by neoclust »

The objective of this script is to publish the users who are in hidden mode in the presence of mode +Dm of the canal and keep only those identified in X and that *.users.undernet.org in their Host I hope you understand me
Post Reply