moveCursor failing
-
- Posts: 334
- Joined: Thu Mar 05, 2015 2:53 am
moveCursor failing
I'm having some problems with moveCursor - It's failing. What am I missing?
Re: moveCursor failing
moveCursor() moves the cursor (which you can't see) within the buffer/miniconsole, display() on it won't do anything as the function doesn't return anything.
Try using http://wiki.mudlet.org/w/Manual:Technic ... urrentLine to select the entire line the cursor is on now, copy() and paste() what you've selected.
Try using http://wiki.mudlet.org/w/Manual:Technic ... urrentLine to select the entire line the cursor is on now, copy() and paste() what you've selected.
-
- Posts: 334
- Joined: Thu Mar 05, 2015 2:53 am
Re: moveCursor failing
I understand that display won't do anything about the cursor, the problem i'm running into is the results coming back from the display are false.
Adjusting it slightly to
moveCursor("sys", 1,1)
cinsertText("sys", "<white>This is a test")
moveCursor("sys", 2,2)
cinsertText("sys", "<white>This is a test")
Is just displaying "This is a testThis is a test" in the top left hand corner of the window.
Adjusting it slightly to
moveCursor("sys", 1,1)
cinsertText("sys", "<white>This is a test")
moveCursor("sys", 2,2)
cinsertText("sys", "<white>This is a test")
Is just displaying "This is a testThis is a test" in the top left hand corner of the window.
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: moveCursor failing
How many lines are already present in the "sys" console. I'm guessing zero (or possibly one) and it is not inserting (whether it should is a different question) an additional line to enable you to move the cursor to line 2...
Are the results the same if you include a "\n" at the end of your strings - that won't solve every usage case but it might make a difference in this one, if I have read the situation right?
Are the results the same if you include a "\n" at the end of your strings - that won't solve every usage case but it might make a difference in this one, if I have read the situation right?
-
- Posts: 334
- Joined: Thu Mar 05, 2015 2:53 am
Re: moveCursor failing
You caught it right there: Thanks. And yes, there were 0 lines present (I hadn`t written anything to that window)SlySven wrote:How many lines are already present in the "sys" console. I'm guessing zero
Neither cinsertText or insertText support newline characters. I used echo to get a newline to print out to the window. After printing a series of newlines, movecursor functioned properly on all lines that had been written to.