Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #cs ----------------------------------------------------------------------------
- AutoIt Version: 3.3.15.0 (Beta)
- Author: 0xNOP
- Script Function:
- Converts normal text into its regional indicator representation.
- e.g. Turn 'sexy' into :regional_indicator_s: :regional_indicator_e: :regional_indicator_x: :regional_indicator_y:
- Script Usage:
- Simply highlight a text, then press Alt + S (make sure if you run this inside a program, it doesn't interfere with the programs hotkeys.)
- #ce ----------------------------------------------------------------------------
- ; Script Start - Add your code below here
- Global $g_bPaused = False
- HotKeySet("{PAUSE}", "HotKeyPressed")
- HotKeySet("{ESC}", "HotKeyPressed")
- HotKeySet("!s", "HotKeyPressed")
- While 1
- Sleep(100)
- WEnd
- Func HotKeyPressed()
- Switch @HotKeyPressed
- Case "{PAUSE}"
- $g_bPaused = Not $g_bPaused
- While $g_bPaused
- Sleep(100)
- ToolTip('Script is "Paused"', 0, 0)
- WEnd
- ToolTip("")
- Case "{ESC}"
- Exit
- Case "!s"
- doTxt2RegionalCode()
- EndSwitch
- EndFunc ;==> HotKeyPressed
- Func doTxt2RegionalCode()
- Send("^x")
- $string = ClipGet()
- $length = StringLen($string)
- $char = ''
- $result = ""
- For $i = 1 To $length
- $char = StringLower(StringMid($string, $i, 1))
- if($char == 'a') Then
- $result &= ":regional_indicator_a: "
- ElseIf($char == 'b') Then
- $result &= ":regional_indicator_b: "
- ElseIf($char == 'c') Then
- $result &= ":regional_indicator_c: "
- ElseIf($char == 'd') Then
- $result &= ":regional_indicator_d: "
- ElseIf($char == 'e') Then
- $result &= ":regional_indicator_e: "
- ElseIf($char == 'f') Then
- $result &= ":regional_indicator_f: "
- ElseIf($char == 'g') Then
- $result &= ":regional_indicator_g: "
- ElseIf($char == 'h') Then
- $result &= ":regional_indicator_h: "
- ElseIf($char == 'i') Then
- $result &= ":regional_indicator_i: "
- ElseIf($char == 'j') Then
- $result &= ":regional_indicator_j: "
- ElseIf($char == 'k') Then
- $result &= ":regional_indicator_k: "
- ElseIf($char == 'l') Then
- $result &= ":regional_indicator_l: "
- ElseIf($char == 'm') Then
- $result &= ":regional_indicator_m: "
- ElseIf($char == 'n') Then
- $result &= ":regional_indicator_n: "
- ElseIf($char == 'o') Then
- $result &= ":regional_indicator_o: "
- ElseIf($char == 'p') Then
- $result &= ":regional_indicator_p: "
- ElseIf($char == 'q') Then
- $result &= ":regional_indicator_q: "
- ElseIf($char == 'r') Then
- $result &= ":regional_indicator_r: "
- ElseIf($char == 's') Then
- $result &= ":regional_indicator_s: "
- ElseIf($char == 't') Then
- $result &= ":regional_indicator_t: "
- ElseIf($char == 'u') Then
- $result &= ":regional_indicator_u: "
- ElseIf($char == 'v') Then
- $result &= ":regional_indicator_v: "
- ElseIf($char == 'w') Then
- $result &= ":regional_indicator_w: "
- ElseIf($char == 'x') Then
- $result &= ":regional_indicator_x: "
- ElseIf($char == 'y') Then
- $result &= ":regional_indicator_y: "
- ElseIf($char == 'z') Then
- $result &= ":regional_indicator_z: "
- EndIf
- ClipPut($result)
- Next
- Send("^v")
- EndFunc ; ==> doTxt2RegionalCode
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement