# Channel flag.
setudef flag monitorText2
# Subchannel.
set subchannel2 #football2
# Bind all text in all channels.
bind pubm - * monitorProc2
proc monitorProc2 {nick uhost hand chan text} {
global subchannel2
# Check channel flag.
if {![channel get $chan monitorText2]} {
return 0
}
# Check text for matching values.
if {[string match "*DEAL DONE:*" $text] } {
# Send matching text to subchannel.
putserv "PRIVMSG #football :$text"
}
And I'm looking for a modification to the script - that it will not relay a URL when it's in the end of the message
For example, it currently relays this message:
<DiMarzio> Transfer News Live: DEAL DONE: Napoli have signed Adam Ounas from Bordeaux for €10m, rising to €12m on a 5-year contract. (Source: BWFC) https://t.co/SekHZY3hIs
and I want it to relay it without the url.
Expected result:
<DiMarzio> Transfer News Live: DEAL DONE: Napoli have signed Adam Ounas from Bordeaux for €10m, rising to €12m on a 5-year contract. (Source: BWFC)
If the URL is the last thing in the sentence, it will be removed.
If there is text remaining after the URL, the URL will remain.
Replace your putserv with the code below:
You aren't missing anything cos that regexp doesn't seem to be working, at least I tried with the text you said in first post.
Anyway, if the text you want to rely has that url at the end and all you want is to relay the same text but without the url at the end then woudln't it be simplier to go with something like:
<DiMarzio> Transfer News Live: DEAL DONE: Napoli have signed Adam Ounas from Bordeaux for €10m, rising to €12m on a 5-year contract. (Source: BWFC) https://t.co/SekHZY3hIs
into:
<DiMarzio> Transfer News Live: DEAL DONE: Napoli have signed Adam Ounas from Bordeaux for €10m, rising to €12m on a 5-year contract. (Source: BWFC)
Once the game is over, the king and the pawn go back in the same box.