Topic Section Changer
Posted by HellRaz0r
Friday, July 20, 2007
Description: Changes Section if specified otherwise changes whole topic.
;/_Topic <Channel> [Section] <Text>
;<> means required, [] means optional.
;If you specify section it will change topic text after "Section:"
alias _topic {
var %chan = $$1, %section = $$2, %text = $3-
var %topic = $chan(%chan).topic, %exp = /\Q $+ %section $+ \E:(?=(.*?)[^\s]+:|(.+))/i
if ($regex(%topic,%exp)) if ($regsubex(%topic,/( $+ %section $+ :)(.*?)((\S+:)|$)/i,\1 %text \3)) topic %chan $v1
else topic %chan $2-
}