egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

bind pub weather alert[solved]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
blake
Master


Joined: 23 Feb 2009
Posts: 201

PostPosted: Tue Jul 24, 2012 3:37 pm    Post subject: bind pub weather alert[solved] Reply with quote

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
View user's profile Send private message Visit poster's website
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Tue Jul 24, 2012 4:08 pm    Post subject: Re: bind pub weather alert Reply with quote

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
View user's profile Send private message
blake
Master


Joined: 23 Feb 2009
Posts: 201

PostPosted: Tue Jul 24, 2012 5:21 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Tue Jul 24, 2012 6:27 pm    Post subject: try this:) Reply with quote

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
View user's profile Send private message Visit poster's website
blake
Master


Joined: 23 Feb 2009
Posts: 201

PostPosted: Tue Jul 24, 2012 6:35 pm    Post subject: Reply with quote

Excellent that has worked thank you SpiKe^^
_________________
Blake
UKEasyHosting UKStormWatch
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber