;
;usage $new.topic.string(<channel>,<?|-|+|N>)
;
alias new.topic.string {
if ($chan($1) == $1) {
if (TTG:* * iswm $chan($1).topic) {
var %num = $mid($gettok($chan($1).topic),1,32),5)
if ($2 == ?) { return %num }
if ($2 == -) { dec %num }
if ($2 == +) { inc %num }
if ($2 isnum) { var %num = $2 }
return $+(TTG:,%num $gettok($chan($1).topic),2-,32))
}
}
}
* untested *
This does not set the topic but returns with a new topic string that you can set or do what ever you want with, that or it returns with the NUMBER from the topic
examples below... assume topic of #channelname is "TTG:90 blah blah blah" (the topic must start with TTG: then have one or more words to it.)
//echo -a $new.topic.string(#channelname,?)
90
//echo -a $new.topic.string(#channelname,-)
TTG:89 blah blah blah
//echo -a $new.topic.string(#channelname,+)
TTG:91 blah blah blah
//echo -a $new.topic.string(#channelname,88)
TTG:88 blah blah blah