より簡単に参照できるように思われる変数がたくさんありますが、その方法がわかりません。変数名は座標系のエントリに関連付けられており、それらが書き込まれる場所も座標ベースです。Google で検索してみたり、Lua のドキュメントを調べたりしましたが、何を探しているのかわからないため、検索が妨げられていると思います。私のコードの抜粋で変数がどのように見えるかを次に示します。
-- バンク 1
local Object111 = sItem.getTargetDetails("-4,3,-4")
local Object112 = sItem.getTargetDetails("-5,3,-4")
local Object113 = sItem.getTargetDetails("-6,3,-4")
local Object114 = sItem.getTargetDetails("-7,3,-4")
local Object115 = sItem.getTargetDetails("-8,3,-4")
local Object121 = sItem.getTargetDetails("-4,4,-4")
local Object122 = sItem.getTargetDetails("-5,4,-4")
local Object123 = sItem.getTargetDetails("-6,4,-4")
local Object124 = sItem.getTargetDetails("-7,4,-4")
local Object125 = sItem.getTargetDetails("-8,4,-4")
local Object131 = sItem.getTargetDetails("-4,5,-4")
local Object132 = sItem.getTargetDetails("-5,5,-4")
local Object133 = sItem.getTargetDetails("-6,5,-4")
local Object134 = sItem.getTargetDetails("-7,5,-4")
local Object135 = sItem.getTargetDetails("-8,5,-4")
-- バンク 2
local Object211 = sItem.getTargetDetails("-4,3,1")
local Object212 = sItem.getTargetDetails("-5,3,1")
local Object213 = sItem.getTargetDetails("-6,3,1")
local Object214 = sItem.getTargetDetails("-7,3,1")
local Object215 = sItem.getTargetDetails("-8,3,1")
local Object221 = sItem.getTargetDetails("-4,4,1")
local Object222 = sItem.getTargetDetails("-5,4,1")
local Object223 = sItem.getTargetDetails("-6,4,1")
local Object224 = sItem.getTargetDetails("-7,4,1")
local Object225 = sItem.getTargetDetails("-8,4,1")
local Object231 = sItem.getTargetDetails("-4,5,1")
local Object232 = sItem.getTargetDetails("-5,5,1")
local Object233 = sItem.getTargetDetails("-6,5,1")
local Object234 = sItem.getTargetDetails("-7,5,1")
local Object235 = sItem.getTargetDetails("-8,5,1")
次に、これらの変数のそれぞれを関数で呼び出します。画面上の位置は名前の数字の関数であり、最初の 2 つの数字は x 座標に関連し、最後の数字は y 座標に関連しています。
mon.setCursorPos(4,4)
mon.write(Object111.StoredPercentage)
mon.setCursorPos(10,4)
mon.write(Object112.StoredPercentage)
mon.setCursorPos(16,4)
mon.write(Object113.StoredPercentage)
...
mon.setCursorPos(8,4)
mon.write(Object121.StoredPercentage)
mon.setCursorPos(8,4)
mon.write(Object121.StoredPercentage)
...
mon.setCursorPos(36,4)
mon.write(Object211.StoredPercentage)
mon.setCursorPos(42,4)
mon.write(Object212.StoredPercentage)
mon.setCursorPos(48,4)
mon.write(Object213.StoredPercentage)
etc....
これはオンザフライで生成できるはずですが、手動で呼び出さないとどこから始めればよいかわかりません。私のコードがよりきれいであれば、私はそれを好むでしょう。この段階では、釣り方を教えてもらう必要があります。誰かが私がやろうとしていることを行う方法を説明するドキュメントを教えてくれれば、私はとても感謝しています.