• 0

# gg.prompt error

## Question

gg .prompt({"text"},{[1]="text"},{[1]="number"})[1]

function USELESS()
HB = gg.choice({
"放置斜坡方块(难用)",
"地图所有车飞天(主端)",
"人裂开(多人,易晕)",
"视角转360°(易晕)",
"载具轮胎大拐弯",
}, nil, "选个功能吧")
if HB == 1 then
if xp == nil then
gg.clearResults()
gg.setRanges(gg.REGION_ANONYMOUS)
gg.searchNumber("4,806,466,702,311,161,856Q;90F;0Q;0F;0Q;0F::25",gg.TYPE_FLOAT,false,gg.SIGN_EQUAL,0, -1)
gg.refineNumber("0",gg.TYPE_FLOAT,false,gg.SIGN_EQUAL,0,-1)
gg.getResults(1000)
else
gg.clearResults()
gg.setRanges(gg.REGION_ANONYMOUS)
gg.searchNumber("4,806,466,702,311,161,856Q;90F;0Q;"..xp..";0Q;"..xp.."::25",gg.TYPE_FLOAT,false,gg.SIGN_EQUAL,0, -1)
gg.refineNumber(xp,gg.TYPE_FLOAT,false,gg.SIGN_EQUAL,0,-1)
gg.getResults(1000)
end
xp = gg.prompt({"原数值已经准备就绪了，等待输入修改数值\nTip:x改成前后方向的倾斜角度，y改成左右方向的倾斜角度，不得留空，不然会出问题，留空也得 x;0 或者 0;y。"},{[1]="x;y"--[[编辑框文字]]},{[1]="number"})[1]
if xp == nil then goto e end
gg.editAll(xp,gg.TYPE_FLOAT)
gg.toast("开启")
::e::
end

Script error: luaj.LuaError: @/storage/emulated/0/AR/Minebox.lua:71

` xp = gg.prompt({"原数值已经准备就绪了，等待输入修改数值\nTip:x改成前后方向的倾斜角度，y改成左右方向的倾斜角度，不得留空，不然会出问题，留空也得 x;0 或者 0;y。"},{[1]="x;y"--[[编辑框文字]]},...`

attempt to index ? (a nil value) with key '1'

level = 1, pc = 104

stack traceback:

/storage/emulated/0/AR/Minebox.lua:71 in function 'USELESS'

/storage/emulated/0/AR/Minebox.lua:15 in function 'Main'

/storage/emulated/0/AR/Minebox.lua:419 in main chunk

[Java]: in ?

at luaj.LuaValue.error(LuaValue.java:986)

at luaj.LuaValue.indexerror(LuaValue.java:2807)

at luaj.LuaValue.gettable(LuaValue.java:2714)

at luaj.LuaValue.get(LuaValue.java:1089)

at luaj.LuaClosure.execute(LuaClosure.java:296)

at luaj.LuaClosure.call(LuaClosure.java:145)

at luaj.LuaValue.callNotNull(LuaValue.java:3117)

at luaj.LuaClosure.execute(LuaClosure.java:456)

at luaj.LuaClosure.call(LuaClosure.java:145)

at luaj.LuaValue.callNotNull(LuaValue.java:3117)

at luaj.LuaClosure.execute(LuaClosure.java:456)

at luaj.LuaClosure.call(LuaClosure.java:145)

at android.ext.Script.runScript(Script.java:5600)

Edited by xX_Hobo_Xx

## Recommended Posts

• 0

no full code, add nil checking.

##### Share on other sites

• 0

7 minutes ago, Rs92ks said:

Ok, I have added the complete one now. What is the problem with this?

Edited by xX_Hobo_Xx
##### Share on other sites

• 0

Remove [1] from prompt

```[1]="number"})->[1]<- remove this
if xp == nil then goto e end```

##### Share on other sites

• 0
16 hours ago, Rs92ks said:

`  `

Thank you

## Create an account

Register a new account

• ### Similar Content

• #### Error'?

By endyajah,

• 492 views
• #### Gg.prompt multiple Action

By hacker6999,

• 79 views
• #### Why error ?

By ENDUNDER,

• 378 views
• #### Script error

By EggyWee,

• 692 views
• #### Octopus error

By malekpw,