| View previous topic :: View next topic |
| Author |
Message |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Wed Mar 11, 2015 9:57 am Post subject: [SOLVED] only from nick i choose |
|
|
Can i get some help in adding a function so i can choose what nicks to listen to?
| Code: | bind pubm - "*!rss*" send:rss
proc send:rss {nick host hand chan text} {
set trigger [join [lrange [split $text] 0 0]]
set message [join [lrange [split $text] 1 end]]
putlog "sent $text"
putbot "rssdb" "addrss $trigger $message"
}
putlog "SentAddrss.Tcl" |
Edit:
can i do :
| Code: |
if nick == "nick" {
bind pubm - "*!rss*" send:rss
}
proc send:rss {nick host hand chan text} {
set trigger [join [lrange [split $text] 0 0]]
set message [join [lrange [split $text] 1 end]]
putlog "sent $text"
putbot "rssdb" "addrss $trigger $message"
}
putlog "SentAddrss.Tcl" |
_________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze
Last edited by Fire-Fox on Fri Mar 13, 2015 9:47 am; edited 1 time in total |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Wed Mar 11, 2015 11:02 am Post subject: |
|
|
You will want the process to figure out if the text is from an allowed nick.
Maybe something more like this... | Code: |
set allowedNicks "ted bart Fire-Fox"
#### END OF SETTINGS ####
bind pubm - "*!rss*" send:rss
proc send:rss {nick host hand chan text} {
if {[lsearch -exact -nocase [split $::allowedNicks] $nick] == "-1"} { return 0 }
set trigger [join [lrange [split $text] 0 0]]
set message [join [lrange [split $text] 1 end]]
putlog "sent $text"
putbot "rssdb" "addrss $trigger $message"
}
putlog "SentAddrss.Tcl"
|
_________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Wed Mar 11, 2015 3:53 pm Post subject: |
|
|
Thanks
I'll have a go at it  _________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Mar 12, 2015 1:45 am Post subject: |
|
|
Other ways to get this without much hassle, meaning having to edit the script when you wish to maintain the list:
- add a new user and add it a custom flag that the bind will trigger on
- make a custom channel flag (setudef str) and have the nicks in there
| Code: |
setudef str myTrigger
|
add nicks to this from DCC Chat with .chanset #channel myTrigger "ted bart Fire-Fox" for instance, and in the proc:
| Code: |
if {[lsearch -nocase [channel get $chan myTrigger] $nick] == -1} return
|
Btw, what's with the pubm bind instead of pub and splitting text twice and not reuse it?
Edit: Fixed typo. _________________ Once the game is over, the king and the pawn go back in the same box.
Last edited by caesar on Fri Mar 13, 2015 11:22 am; edited 1 time in total |
|
| Back to top |
|
 |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Fri Mar 13, 2015 9:46 am Post subject: |
|
|
@SpiKe^^
Works fine
@caesar
Thanks for the input  _________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze |
|
| Back to top |
|
 |
|