Jump to content
  • 0

Error in object finder script


DimoNULL

Question

Posted

If script started i getting error`local pos1 = gg.prompt("Enter XYZ", "", gg.TYPE_FLOAT)`

bad argument #1 to 'gg.prompt' (string: table expected, got string) (field 'prompt')

 

Script:

 

gg.toast("Enter XYZ:")

local pos1 = gg.prompt("X:", nil, gg.TYPE_FLOAT)

local pos2 = gg.prompt("Y:", nil, gg.TYPE_FLOAT)

local pos3 = gg.prompt("Z:", nil, gg.TYPE_FLOAT)

 

local search_string = string.format("%.2f~%.2f;%.2f~%.2f;%.2f~%.2f:9", pos1-0.02, pos1+0.02, pos2-0.02, pos2+0.02, pos3-0.02, pos3+0.02)

gg.setRanges(gg.REGION_ANONYMOUS)

gg.searchNumber(search_string, gg.TYPE_FLOAT)

 

gg.toast("Finished")

 

Where the error?

1 answer to this question

Recommended Posts

Posted
gg.setRanges(gg.REGION_ANONYMOUS)
gg.toast("Enter XYZ:")

local pos = gg.prompt({"X:","Y:","Z:"},{0,0,0})

local searchString = string.format("%.2f~%.2f;%.2f~%.2f;%.2f~%.2f:9", pos[1] - 0.02, pos[1] + 0.02, pos[2] - 0.02, pos[2] + 0.02, pos[3] - 0.02, pos[3] + 0.02)

gg.alert("Search = "..searchString)

gg.searchNumber(searchString, gg.TYPE_FLOAT)

gg.toast("Finished")

 

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.