I am trying to write a remote that will replace "90 degrees" etc. with 90(degree sign, which is $chr(176)). I'm not sure how to go about finding the word "degrees" and making the replacement, thanks.
I decided to use an alias to do this, but now I want to know if there is a way I can have it find the number in the sentence so I can have the temp anywhere in a sentence? This is the alias how it is now:
/temp { msg $chan $1- $+ $chr(176)
I want to be able to say "It will be 90 degrees today" or "It is 90 degrees" and have it find the number and replace "degrees" with the sign. Thanks.
Try this. I'm not positive the halting is set up correctly right now and can't test it.
Code:
on ^*:input:*:{
if (*degrees* iswm $1-) {
say $replace($1-,degrees,$chr(0176))
halt
}
}
on ^*:text:*degrees*:*:{
echo $target $replace($1-,degrees,$chr(0176))
halt
}