What have you tried? Show me.
You have been given a script, read it thru, try and understand how it works.
Implement it into your own code, test it. If it doesn't work add "echo -a something" and test it again, find out where it stops, and why.
I have noticed, that I haven't given you the correct script, mine is channel based, if you try and use the "," it would be easier to read.
- Code: Select all
alias -l ::channel { return #channel }
alias -l ::filename { return request.txt }
alias -l ::text { return Applications pending $+([,$lines($::filename),]) }
alias -l ::seperator { return $asc(|) }
on *@:TEXT:!apply & & &:?: {
var %hostname = $address($nick,1)
if ($read($::filename, w, %hostname)) {
return
}
if ($me !isop $::channel) { msg $::channel I need operator status. | return }
var %topic = $chan($::channel).topic
.write $::filename $nick $1-4 %hostname
if ($numtok(%topic,$::seperator) == 1) {
.topic $::channel %topic $+($chr(32),$chr($::seperator),$chr(32),$::text)
}
else {
var %x = $numtok(%topic,$::seperator)
var %topic = $deltok(%topic,$+(%x,-),$::seperator)
.topic $::channel %topic $+($chr(32),$chr($::seperator),$chr(32),$::text)
}
}