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.
Help for those learning Tcl or writing their own scripts.
-
Fire-Fox
- Master
- Posts: 299
- Joined: Sat Sep 23, 2006 9:01 pm
- Location: /dev/null
Post
by Fire-Fox »
Can i get some help in adding a function so i can choose what nicks to listen to?
Code: Select all
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: Select all
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"
Last edited by
Fire-Fox on Fri Mar 13, 2015 9:47 am, edited 1 time in total.
-
SpiKe^^
- Owner
- Posts: 831
- Joined: Fri May 12, 2006 10:20 pm
- Location: Tennessee, USA
-
Contact:
Post
by SpiKe^^ »
You will want the process to figure out if the text is from an allowed nick.
Maybe something more like this...
Code: Select all
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"
-
Fire-Fox
- Master
- Posts: 299
- Joined: Sat Sep 23, 2006 9:01 pm
- Location: /dev/null
Post
by Fire-Fox »
Thanks
I'll have a go at it

-
caesar
- Mint Rubber
- Posts: 3778
- Joined: Sun Oct 14, 2001 8:00 pm
- Location: Mint Factory
Post
by caesar »
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
add nicks to this from DCC Chat with .chanset #channel myTrigger "ted bart Fire-Fox" for instance, and in the proc:
Code: Select all
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.
Last edited by
caesar on Fri Mar 13, 2015 11:22 am, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.
-
Fire-Fox
- Master
- Posts: 299
- Joined: Sat Sep 23, 2006 9:01 pm
- Location: /dev/null
Post
by Fire-Fox »
@SpiKe^^
Works fine
@caesar
Thanks for the input
