So I have been following Nick Gammons guide on making an inventory capture to a miniwindow and I can not get it to detect my prompt to end the capture
Here is what my inventory list displays as
[You are carrying 4 of 41 items]
[You have a total weight of 633/1260]
a Transporter device
a juicy apple
a bottle of cod liver oil
a Dark Void
4742H 98310M 45075V (100) Can Now RemortTNL Level: 50 [Inside] [Day]->
And here is my code
If I change it so it ends at (a Dark Void) it works correctly.
so im not sure what im doing wrong here. Is it possible to have it end at the blank line before my prompt?
I checked my regexp converstion of my prompt at regexr.com and it detects the prompt. Ive even tried adding ^ to the start. any help would be much appreciated.
Also i dont even get a fail message when I have my prompt in there.
Here is what my inventory list displays as
[You are carrying 4 of 41 items]
[You have a total weight of 633/1260]
a Transporter device
a juicy apple
a bottle of cod liver oil
a Dark Void
4742H 98310M 45075V (100) Can Now RemortTNL Level: 50 [Inside] [Day]->
And here is my code
require "wait"
wait.make (function () -- coroutine starts here
local win = GetPluginID () .. ":inventory"
local font = "f"
if not WindowInfo (win, 1) then
WindowCreate (win, 0, 0, 0, 0, 6, 0, 0)
WindowFont (win, font, "Lucida Console", 9)
end -- if
-- request inventory
Send "inventory"
-- wait for inventory to start
local x = wait.match ("[You are carrying * of * items] " , 10)
if not x then
ColourNote ("white", "blue", "No Inventory")
end -- if
local inv = {}
local max_width = WindowTextWidth (win, font, "Inventory")
-- loop untinl end of inventory
while true do
local line, wildcards, styles = wait.match ("*")
-- see if end of inventory
if string.match (line, "(\d+)H (\d+)M (\d+)V \(\d+\) .+ [\w+]\-\>") then
break
end -- if
-- save inventory line
table.insert (inv, styles)
-- work out max width
max_width = math.max (max_width, WindowTextWidth (win, font, line))
end -- while loop
require "tprint"
tprint (inv)
end) -- end of coroutine
If I change it so it ends at (a Dark Void) it works correctly.
so im not sure what im doing wrong here. Is it possible to have it end at the blank line before my prompt?
I checked my regexp converstion of my prompt at regexr.com and it detects the prompt. Ive even tried adding ^ to the start. any help would be much appreciated.
Also i dont even get a fail message when I have my prompt in there.