What I'm basically trying to do is get a list of all the mobs in a current room and throw them into a table (to show in a miniwindow).
Problem is the room description, the weather (if any), and the mobs are all together.
Here's an example of what a room looks like on a MUD I play.
I'm not too sure if this is possible, but figured I'd ask since the mob names are always in a dark purple color thinking it might be possible using something like GetStyles, but I just have no clue where to begin on something like this since the column numbers would always be different plus since it would be multiple lines and no specific words to match on.
Thinking out loud here (feel free to ignore everything below this).
Perhaps have a trigger for exits to set a variable like start_reading = true then when a blank line shows up (since there is always a blank line before room description/weather/mobs) if that start_reading variable is true to start somehow putting every line into its own variable until the prompt which would change the start_reading variable to false. Then get the style of each line and only print out the ones in the dark purple color, which would be the mobs in the room.
What if I made a trigger in regex like ^$ that would set start_reading = true, and when it sees your prompt it would turn it back off.
Maybe a series of triggers like when that blank line is matched that turns start_reading to true to have it turn on a trigger, something like ^(.+)$ then when matched, it puts all that into a variable, lets say line_one = %1, turns that trigger off, and turns another similar trigger on except the variable in that one would be line_two = %1 and make like 20 or 30 triggers to make sure I capture every line in the room.
Lets say a room only has 9 lines then I could just put an if statement in the line_one line_two and so on variables like if start_reading = true so it doesnt run through all of them for smaller rooms. Then maybe some sort of failsafe like have the prompt turn all of those ^(.+)$ triggers off...
Yeah I'm pretty lost and just babbling on... got to be an efficient way to accomplish this... but then again if I can't match the colors to get those mobs its all pointless anyways or maybe Im just way overthinking this. Any ideas?
Problem is the room description, the weather (if any), and the mobs are all together.
Here's an example of what a room looks like on a MUD I play.
An Entrance to the Caverns
[Exits: north up]
Partially hidden by the brush on the side of the mountain, a large cave opens
before you. Seeming to appear right out of the rock and brush, guards confront
you as you try to enter the caves.
The sky is cloudless and a cold northern gust blows.
A small dog sniffs around here.
A ranger guard stands here, keeping watch.
A ranger guard stands here, keeping watch.
I'm not too sure if this is possible, but figured I'd ask since the mob names are always in a dark purple color thinking it might be possible using something like GetStyles, but I just have no clue where to begin on something like this since the column numbers would always be different plus since it would be multiple lines and no specific words to match on.
Thinking out loud here (feel free to ignore everything below this).
Perhaps have a trigger for exits to set a variable like start_reading = true then when a blank line shows up (since there is always a blank line before room description/weather/mobs) if that start_reading variable is true to start somehow putting every line into its own variable until the prompt which would change the start_reading variable to false. Then get the style of each line and only print out the ones in the dark purple color, which would be the mobs in the room.
What if I made a trigger in regex like ^$ that would set start_reading = true, and when it sees your prompt it would turn it back off.
Maybe a series of triggers like when that blank line is matched that turns start_reading to true to have it turn on a trigger, something like ^(.+)$ then when matched, it puts all that into a variable, lets say line_one = %1, turns that trigger off, and turns another similar trigger on except the variable in that one would be line_two = %1 and make like 20 or 30 triggers to make sure I capture every line in the room.
Lets say a room only has 9 lines then I could just put an if statement in the line_one line_two and so on variables like if start_reading = true so it doesnt run through all of them for smaller rooms. Then maybe some sort of failsafe like have the prompt turn all of those ^(.+)$ triggers off...
Yeah I'm pretty lost and just babbling on... got to be an efficient way to accomplish this... but then again if I can't match the colors to get those mobs its all pointless anyways or maybe Im just way overthinking this. Any ideas?