Hello, AHK users, I have been using AHK for a while but only hotkeys and hotstrings and I am wondering how (which commands I would use) I would go about doing the following:
I have a string: r1bq1rk1/1RB2RK1
And I want to turn that into this: black rook, one square, black bishop, black queen, one square, black rook, black king, one square, next rank, one square, white rook, black bishop, two squares, white rook, white king, one square
First, is this possible with AHK? And which command will I need to use? Thank you very much.
PS If you think this is the wrong approach and that doing it with some other program is better please let me know.
*SOLVED* Changing a string of letters into something more readable Topic is solved
*SOLVED* Changing a string of letters into something more readable
Last edited by daniel on 26 Apr 2017, 16:33, edited 1 time in total.
- FanaticGuru
- Posts: 1906
- Joined: 30 Sep 2013, 22:25
Re: Changing a string of letters into something more readable Topic is solved
This is one way.
FG
Code: Select all
Array := ComObjCreate("Scripting.Dictionary")
Array.item("1") := "one square"
Array.item("2") := "two squares"
Array.item("/") := "next rank"
Array.item("r") := "white rook"
Array.item("b") := "white bishop"
Array.item("k") := "white king"
Array.item("q") := "white queen"
Array.item("R") := "black rook"
Array.item("B") := "black bishop"
Array.item("K") := "black king"
Array.item("Q") := "black queen"
String := "r1bq1rk1/1RB2RK1"
Loop, Parse, String
Output .= Array.item(A_LoopField) ", "
Output := Trim(Output, " ,")
MsgBox % Output
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
Re: *SOLVED* Changing a string of letters into something more readable
Thank you, FanaticGuru!!
You are the man. Checking out your other stuff; dictionary's awesome.
Have a great day.
You are the man. Checking out your other stuff; dictionary's awesome.
Have a great day.