priMELval

conversion macro

Jan 6th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. $${
  2.  
  3. // Bind to onSendChatMessage
  4. // Converts Celsius to Fahrenheit ie "1c (32f)"
  5. // Will probs convert more in the future but lazy af
  6. STRIP(&chat,%CHAT%)
  7. IFMATCHES(%&chat%,"([0-9]+)c\b")
  8. MATCH(%&chat%,"(-?[0-9]+)c",{#ctemp})
  9.  
  10. #ftemp = ((#ctemp * 9) / 5) + 32
  11. REPLACE(&chat,"%#ctemp%c","%#ctemp%c (%#ftemp%f)")
  12. FILTER
  13. ECHO(%&chat%)
  14. ENDIF
  15. }$$
Advertisement
Add Comment
Please, Sign In to add comment