Jump to content
  • 0

My interesting problem with gg prompt,


KarimIdris999997

Question

Posted

I have read the gg references.

function E()
local input = gg.prompt({
[1]="put value",
[2]="bobo lu",
[3]="bobo la",
[4]="bobo li",
[5]="exit"},
{nil},
{"number","checkbox","checkbox","checkbox","checkbox"}) 
if input == nil then return else
if input[1] then 
gg.toast("value is"..input[1].."")
end
if input[2] then
gg.sleep(1000)
gg.toast("bobo lu")
end
if input[3] then
gg.sleep(1000)
gg.toast("bobo la")
end
if input[4] then
gg.sleep(1000)
gg.toast("bobo li")
end
if input[5] then
HOME()
end
end
end

The problem is.if i only checked any menu except menu1 ,it will gg.toast the menu1 first ,then after it ,it gg.toast the checked menu.

I know i can simply fix it like this.Just check on menu2 to edit and menu1 is the value.

if input[1] and [2] then 
gg.toast("nilai ialah "..input[1].."")
end

But how to fix it.menu2 is menu2,i tap menu2 it must only gg.toast menu2 without gg.toast menu1 first even if i put any value in number box or leave it nil.

1 answer to this question

Recommended Posts

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.