miniConsole text positioning

Post Reply
Drevarr
Posts: 43
Joined: Tue Aug 06, 2013 12:07 am
Location: GA, USA

miniConsole text positioning

Post by Drevarr »

Can you position the text sent to a miniconsole? I currently capture an overland map to a miniconsole but would like to center the text within the console based on the map size. The length of the lines and number of lines varies based on terrain, time of day and specific active/innate skills.

If possible could someone provide an example that I could poke on to learn.


example contents of the text captured between tags:
Code: [show] | [select all] lua
EXAMPLE_1
<map>
   ****...    
 ***...^. ..  
 ****..... ...
 *****.... ...
 ******@^.M ..
 ******P... ..
 ******.... ..
 *****.... .  
   *****.^.    
</map>

EXAMPLE_2
<map>
 **...
 **@P^
 ***.. 
</map>

EXAMPLE_3
<map>
 **********.  
^*********..^
...********..
^.^^..@P.***.
^..^****.....
..****^*****.
 ***********  
</map>

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: miniConsole text positioning

Post by Vadi »

You can, just prefix it with the amount of appropriate spaces.

Drevarr
Posts: 43
Joined: Tue Aug 06, 2013 12:07 am
Location: GA, USA

Re: miniConsole text positioning

Post by Drevarr »

Follow up question, I am attempting to capture a overland map within <map> and </map> tags.
Code: [show] | [select all] lua
Example:
<map>
   ^...+...     
  .M^.M+.....   
 ....M.+..^...  
 **.^.^+..^...  
 ++++++@.....^  
 .****.+......  
 *....^+....^.  
  .^MM.+.^^..   
   M^..+....    
   </map>

<map>		Substring|Filter

clearUserWindow("Box5MC")

   
(.*)		Perl regex
   
local z = tonumber(string.len(matches[1]))
selectCurrentLine()
copy()
addSpace(z)
GUI.Box5MC:appendBuffer()


</map>		Substring
setTriggerStayOpen("MapCapture", 0)
However it keeps missing the first line of the map. Instead of
Image

I get the following:
Image

What am I overlooking?

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: miniConsole text positioning

Post by Vadi »

Is your (.*) Perl regex always on? I doubt it would be. Check that whatever is turning it on, if thats the case, is not doing it a line late?

Post Reply