Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on script load:
- set {_letters} to "Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz"
- set {_letter-pairs::*} to {_letters} split at " "
- loop {_letter-pairs::*}:
- set {_pair::*} to loop-value split at ""
- set {_uppercase} to {_pair::1}
- set {_lowercase} to {_pair::2}
- set {letters::uppercase::%{_lowercase}%} to {_uppercase}
- set {letters::lowercase::%{_uppercase}%} to {_lowercase}
- on script unload:
- delete {letters::*}
- function switchCaseFor(text: text, to-uppercase: boolean) :: text:
- set {_characters::*} to {_text} split at ""
- set {_new} to ""
- loop {_characters::*}:
- set {_char} to loop-value
- if {_to-uppercase} is false:
- set {_char} to {letters::lowercase::%loop-value%}
- set {_new} to "%{_new}%%{_char}%"
- return {_new}
- function lowercase(text: text) :: text:
- return switchCaseFor({_text}, false)
- function contains(list: objects, check: object) :: boolean:
- loop {_list::*}:
- if loop-value is {_check}:
- return true
- return false
- function nickfix(nick: text) :: text:
- set {_} to "abcdefghijklmnopqrstuvwxyz0123456789"
- set {_1} to {_nick}
- set {_2} to {_nick}
- set {_l::*} to {_} split at ""
- loop {_l::*}:
- replace every loop-value with "" in {_1}
- set {_l2::*} to {_1} split at ""
- loop {_l2::*}:
- replace every loop-value with "" in {_2}
- return {_2}
Add Comment
Please, Sign In to add comment