local Menu = gg.choice({"Menu A","Menu B"}, nil, "Main")
if Menu == 1 then MenuA() end
if Menu == 2 then MenuB() end
if Menu == 3 then os.exit() end
XGCK=-1
end
function MenuA()
local A = gg.choice(menuNames)
if A ~= nil then
TenQV = menuNames[choice]
IDAP = menuID[choice]
ModAPet()
end
end
function MenuB()
-- I want to create a menu from items selected in MenuA()
-- and when i select the item in MenuB it will also do TenQV = menuNames[choice], IDAP = menuID[choice] and ModAPet() same as in MenuA()
end
while(true)do
if gg.isVisible(true) then
XGCK=1
gg.setVisible(false)
end
gg.clearResults()
if XGCK==1 then
Main()
end
I want to create a menu from items selected in MenuA() and when i select the item in MenuB it will also do TenQV, IDAP and ModAPet() same as in MenuA()
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Question
hoangninyb
gg.refineNumber("5", gg.TYPE_DWORD)
local count = gg.getResultsCount()
local results = gg.getResults(count)
for i, v in ipairs(results) do
v.address = v.address + -16
end
local values_1 = gg.getValues(results)
gg.refineNumber("6", gg.TYPE_DWORD)
local count = gg.getResultsCount()
local results = gg.getResults(count)
for i, v in ipairs(results) do
v.address = v.address + -16
end
local values_2 = gg.getValues(results)
function ModAPet()
local P = gg.prompt({"🄸🄽🅂🄴🅁🅃 🄸🄳 🅅🄰🄻🅄🄴🅂\n •━━━ ✽ • ✽ ━━━•\n\nSKILL - 1","SKILL - 2","SKILL - 3"},{"1111","1112","1113"},{"number","number","number"})
gg.clearResults()
gg.loadResults(gg.getListItems())
gg.refineNumber(IDAP, gg.TYPE_DWORD)
local count = gg.getResultsCount()
local results = gg.getResults(count)
local values = {}
for i, v in ipairs(results) do
local index = (i - 1) * 4
local addr = v.address
values[index + 1] = {address = addr + 48, flags = gg.TYPE_DWORD, value = P[1], freeze = true}
values[index + 2] = {address = addr + 64, flags = gg.TYPE_DWORD, value = P[2], freeze = true}
values[index + 3] = {address = addr + 80, flags = gg.TYPE_DWORD, value = P[3], freeze = true}
values[index + 4] = {address = addr + 96, flags = gg.TYPE_DWORD, value = "0", freeze = true}
end
gg.setValues(values)
gg.addListItems(values)
end
local mapping = {
[11920]={name_1 ="Jock 5", name_2 ="Jock 6", IDAP = "10111"},
[11921]={name_1 ="Mick 5", name_2 ="Mick 6", IDAP = "10112"},
[11922]={name_1 ="Key 5", name_2 ="Key 6", IDAP = "10113"},
[11923]={name_1 ="Jonseen 5", name_2 ="Jonseen 6", IDAP = "10114"},
[11924]={name_1 ="Brickey 5", name_2 ="Brickey 6", IDAP = "10115"}
}
local menuNames = {}
local menuFunctions = {}
local menuID = {}
for i, v in ipairs(values_1) do
local item = mapping[v.value]
if item ~= nil then
table.insert(menuNames, item.name_2)
table.insert(menuFunctions, item.func)
table.insert(menuID, item.IDAP)
end
end
for i, v in ipairs(values_1) do
local item = mapping[v.value]
if item ~= nil then
table.insert(menuNames, item.name_1)
table.insert(menuFunctions, item.func)
table.insert(menuID, item.IDAP)
end
end
for i, v in ipairs(values_2) do
local item = mapping[v.value]
if item ~= nil then
table.insert(menuNames, item.name_2)
table.insert(menuFunctions, item.func)
table.insert(menuID, item.IDAP)
end
end
function Main()
local Menu = gg.choice({"Menu A","Menu B"}, nil, "Main")
if Menu == 1 then MenuA() end
if Menu == 2 then MenuB() end
if Menu == 3 then os.exit() end
XGCK=-1
end
function MenuA()
local A = gg.choice(menuNames)
if A ~= nil then
TenQV = menuNames[choice]
IDAP = menuID[choice]
ModAPet()
end
end
function MenuB()
-- I want to create a menu from items selected in MenuA()
-- and when i select the item in MenuB it will also do TenQV = menuNames[choice], IDAP = menuID[choice] and ModAPet() same as in MenuA()
end
while(true)do
if gg.isVisible(true) then
XGCK=1
gg.setVisible(false)
end
gg.clearResults()
if XGCK==1 then
Main()
end
I want to create a menu from items selected in MenuA() and when i select the item in MenuB it will also do TenQV, IDAP and ModAPet() same as in MenuA()
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.