Page 1 of 1

copy() and paste() - newline

Posted: Thu Aug 18, 2016 8:48 pm
by dzordzyk
Hi,

I'm trying to get copy() and paste() working, but I'm experiencing problems with newline. In other topic on the forum I found that to not select the new line before copy(), I should use selectString(line, 1), so that's what I'm using. My code in the trigger is:
Code: [show] | [select all] lua
selectString(line, 1)
copy()
local str_replace = "[2/6] "
replace(str_replace)
paste("main")
However, for some reason, there is an extra newline. Image The reason I'm using copy/paste is because I want to preserve the original coloring from the MUD. Can anyone help here?

Thanks!

Moderator Edit: brought screen shot image into post... :)