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

Post Reply
Guilend
Posts: 36
Joined: Fri Mar 09, 2018 1:21 am

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

Post by Guilend » Sat Dec 29, 2018 4:06 am

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%
---------------------------------------------------------------------------------

Guilend
Posts: 36
Joined: Fri Mar 09, 2018 1:21 am

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

Post by Guilend » Sat Dec 29, 2018 10:00 pm

Never mind, Someone from the Starmourn discord made it for me.

User avatar
Zaphob
Posts: 136
Joined: Wed May 09, 2012 8:07 am
Location: mg.mud.de

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

Post by Zaphob » Sun Dec 30, 2018 3:02 am

For the sake of sharing, would you publish your solution?

Guilend
Posts: 36
Joined: Fri Mar 09, 2018 1:21 am

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

Post by Guilend » Sun Dec 30, 2018 5:45 am

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)

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests