Page 1 of 1

Making a list of items into each item being a clickable link.

Posted: Sat Dec 29, 2018 4:06 am
by Guilend
In Starmourn there are Incursions and to find out how far they are away you have to enter STARCHART <coord>, but I was wondering if it was possible to make an alias to turn on a trigger, send incursion list and have the list of incursions as clickable links to send STARCHART <coord> so i don't have to do it by hand, i can just click on the one i want to see where it is? Here is an example of the list.

-----------------------------< Current Incursions >------------------------------
Zone Type Potential Danger Time Rem Enemies Rem
---------------------------------------------------------------------------------
RS-5450 Breakers Hard 31% 100%
Hiza Nabians Easy 91% 100%
RS-4448 Loroi Easy 11% 100%
RS-5053 Leviathan Easy 38% 100%
RS-4251 Trinaries Easy 5% 0%
RS-6343 Trinaries Medium 11% 100%
RS-5344 Miningdrone Easy 93% 100%
CS-5237 Rogueai Easy 20% 0%
---------------------------------------------------------------------------------

Re: Making a list of items into each item being a clickable link.

Posted: Sat Dec 29, 2018 10:00 pm
by Guilend
Never mind, Someone from the Starmourn discord made it for me.

Re: Making a list of items into each item being a clickable link.

Posted: Sun Dec 30, 2018 3:02 am
by Zaphob
For the sake of sharing, would you publish your solution?

Re: Making a list of items into each item being a clickable link.

Posted: Sun Dec 30, 2018 5:45 am
by Guilend
Sure, it took two triggers.
Code: [show] | [select all] lua
^(\w+|\w+ \w+)(\s+)(\w+)(\s+)(Easy|Medium|Hard)

local destination = matches[2]
local true_dest = destination

if destination == "Eta Zeniah" then
	true_dest = "Eta"
end

local pos = string.find(line, destination)+string.len(destination)
local remainder = string.sub(line, pos)

deleteLine()
echoLink("\n"..destination, [[send("SHIP TRAVEL TO ]]..true_dest..[[")]], "SHIP TRAVEL TO "..destination)
echo(remainder)
Code: [show] | [select all] lua
^(\w+)(-)(\d+|\w+)(\s+)(\w+)(\s+)(Easy|Medium|Hard)

local quadrant = matches[2]
local coordinates = matches[4]

local pos = string.find(line, coordinates)+string.len(coordinates)
local remainder = string.sub(line, pos)

local full_dest = quadrant.."-"..coordinates

deleteLine()
echoLink("\n"..quadrant.."-"..coordinates, [[send("SHIP TRAVEL TO ]]..full_dest..[[")]], "SHIP TRAVEL TO "..full_dest)
echo(remainder)