runtime.globalVars.textBoard = chess.ascii();
how can I save chess.ascii() in textBoard directly?
That was saving chess.ascii() in textBoard directly.
You don't need Javascript knowledge, I don't have it either.
few things which I didn't made yet, restricted moves for king, castling and en passent square.
You think there are only a few things left, but you don't realize how many different rules and restrictions there are in chess. If you look at the chess.js code, there are over 1900 lines of code! It's much easier to use the library, than creating all this logic yourself.