reply script with setable replies per channel. (help needed)

Old posts that have not been replied to for several years.
Locked
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

reply script with setable replies per channel. (help needed)

Post by dotslasher »

Code: Select all

set replychan "#UT"
set yourmsg "I collect stats for this channel and they can be viewed here: http://www.staticbox.com/ut/"
bind pub m "!stats" crappy:reply
bind pub m "!poop" crappy:reply

proc crappy:reply { nickname hostname handle channel arguments } {
global replychan
global yourmsg
puthelp "PRIVMSG $replychan :$yourmsg"
}
how could i make it have a different reply on different channels?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

by specifying different replies for different channels (possibly in array or list) and showing the appropriate reply depending on 'channel' parameter of proc crappy:reply
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

Post by dotslasher »

well i wouldnt be asking for help if i knew how to do that :p
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

set reply(#foo) "got this on channel #foo"
set reply(#bar) "that was said on #bar"

bind pub m !one smart:reply
bind pub m !two smart:reply
proc smart:reply {n u h c t} {
  foreach {chan reply} [array get ::reply] {
    if [string equal -nocase $chan $c] {
      puthelp "privmsg $c :$reply"; return
    }
  }
}
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

Post by dotslasher »

tnx demond :)
Locked