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.

bind pub weather alert[solved]

Help for those learning Tcl or writing their own scripts.
Post Reply
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

bind pub weather alert[solved]

Post by blake »

Hey

How can I go about this I have a little code below

Code: Select all

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: Select all

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
Last edited by blake on Sun Jul 29, 2012 10:28 am, edited 1 time in total.
w
willyw
Revered One
Posts: 1204
Joined: Thu Jan 15, 2009 12:55 am

Re: bind pub weather alert

Post by willyw »

blake wrote: ...
I want it to trigger on Weather Alert
...

Experiment with pubm

Code: Select all

bind pubm -|- "% weather alert*" alert_proc 
The trailing wildcard is probably necessary.

Ref:
http://www.eggheads.org/support/egghtml ... mands.html
and find:
bind pubm
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

Code: Select all


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
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

try this:)

Post by SpiKe^^ »

Try This:)

Code: Select all

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
.
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

Excellent that has worked thank you SpiKe^^
Post Reply