egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

set channel mode with no prefixed public command

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
simo
Master


Joined: 22 Mar 2015
Posts: 315

PostPosted: Thu Feb 28, 2019 11:10 am    Post subject: set channel mode with no prefixed public command Reply with quote

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:

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
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1008

PostPosted: Thu Feb 28, 2019 11:18 am    Post subject: Re: set mode settings Reply with quote

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 !
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 597
Location: Tennessee, USA

PostPosted: Thu Feb 28, 2019 2:14 pm    Post subject: bind mode request. Reply with quote

Try replacing this one line...
Code:
bind pubm o|o * chan:modes


with these 2 lines...
Code:
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.
_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.


Last edited by SpiKe^^ on Thu Feb 28, 2019 7:22 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
simo
Master


Joined: 22 Mar 2015
Posts: 315

PostPosted: Thu Feb 28, 2019 4:10 pm    Post subject: Reply with quote

hm ok tried your suggestion SpiKe^^ and it didnt do anything and no errors
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 597
Location: Tennessee, USA

PostPosted: Thu Feb 28, 2019 7:22 pm    Post subject: Reply with quote

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
.
Back to top
View user's profile Send private message Visit poster's website
simo
Master


Joined: 22 Mar 2015
Posts: 315

PostPosted: Fri Mar 01, 2019 9:38 am    Post subject: Reply with quote

tried it and seems to work well thnx SpiKe^^ apreciated as always
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 315

PostPosted: Thu Mar 21, 2019 7:55 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber