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.

set channel mode with no prefixed public command

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
simo
Revered One
Posts: 1073
Joined: Sun Mar 22, 2015 2:41 pm

set channel mode with no prefixed public command

Post by simo »

anyway to change this to have it set modes in the manner of for example:


+m
+vvvvvv nick nick nick nick nick
+l 120
+k secretkey
+M
+i
-i
+i
+b *!*@host

and so on, with the criteria of first char should be a + or - to determine its a mode setting

Code: Select all

bind pubm o|o * chan:modes

proc chan:modes { user host ident chan arg } {
  set mode [lindex [split $arg] 0] 
  putserv "MODE $chan :$mode" 
}


 
because as the code is it sets modes even if regular words are written

like im ok tnx and how about u ( it will set +im and so on while there was no + - used )
Last edited by simo on Thu Feb 28, 2019 4:29 pm, edited 1 time in total.
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Re: set mode settings

Post by willyw »

Perhaps something here would be useful, in testing that first character:

http://www.tcl.tk/man/tcl8.6/TclCmd/string.htm


How about? :
http://www.tcl.tk/man/tcl8.6/TclCmd/string.htm#M9
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

bind mode request.

Post by SpiKe^^ »

Try replacing this one line...

Code: Select all

bind pubm o|o * chan:modes
with these 2 lines...

Code: Select all

bind pubm o|o "#% +?*" chan:modes
bind pubm o|o "#% -?*" chan:modes
and restart the bot, to unload the old bind and add these 2.
Last edited by SpiKe^^ on Thu Feb 28, 2019 7:22 pm, edited 1 time in total.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
simo
Revered One
Posts: 1073
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

hm ok tried your suggestion SpiKe^^ and it didnt do anything and no errors
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Updated the above code. Try again.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
simo
Revered One
Posts: 1073
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

tried it and seems to work well thnx SpiKe^^ apreciated as always
s
simo
Revered One
Posts: 1073
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i had just one small detail , in the case of mentioning a voiced nick in the first parameter might result in a false positive for example:

if a chanop or me would type

+mike are u around buddy

and mike would be in channel and voiced that would trigger this tcl and set channelmodes +mi in channel wich is an unwanted effect perhaps its an idea to check if there is a nick in first parameter that is in channel present to then ignore the function of setting mode if that to be the case
Post Reply