| View previous topic :: View next topic |
| Author |
Message |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Tue Jul 24, 2012 3:37 pm Post subject: bind pub weather alert[solved] |
|
|
Hey
How can I go about this I have a little code below
| Code: | bind pub -|- alert alert_proc
proc alert_proc { nick uhost hand chan arg } {
set text [lrange [split $arg] 0 end]
puthelp "privmsg $chan :$text"
} |
I want it to trigger on Weather Alert
| Code: | bind pub -|- Weather Alert alert_proc
proc alert_proc { nick uhost hand chan arg } {
set text [lrange [split $arg] 0 end]
puthelp "privmsg $chan :$text"
} |
If Weather Alert some txt is typed in the channel it will then message another channel _________________ Blake
UKEasyHosting UKStormWatch
Last edited by blake on Sun Jul 29, 2012 10:28 am; edited 1 time in total |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Tue Jul 24, 2012 4:08 pm Post subject: Re: bind pub weather alert |
|
|
| blake wrote: |
...
I want it to trigger on Weather Alert
...
|
Experiment with pubm
| Code: |
bind pubm -|- "% weather alert*" alert_proc
|
The trailing wildcard is probably necessary.
Ref:
http://www.eggheads.org/support/egghtml/1.6.21/tcl-commands.html
and find:
bind pubm |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Tue Jul 24, 2012 5:21 pm Post subject: |
|
|
| Code: |
bind pubm -|- "% weather alert*" alert_proc
proc alert_proc { nick uhost hand chan arg } {
set text [lrange [split $arg] 0 end]
puthelp "privmsg $chan :$text"
} |
Okay I have the above working only problem is I dont want the Weather Alert part relayed to the channel it currently shows this
<user1> Weather Alert Flood warn issued
i just want it to relay the text after Weather Alert text is not always the same _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Tue Jul 24, 2012 6:27 pm Post subject: try this:) |
|
|
Try This:)
| Code: | bind pubm -|- "% weather alert*" alert_proc
proc alert_proc { nick uhost hand chan arg } {
set text [join [lrange [split $arg] 2 end]]
puthelp "privmsg $chan :$text"
} |
_________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Tue Jul 24, 2012 6:35 pm Post subject: |
|
|
Excellent that has worked thank you SpiKe^^ _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
|