|
Post by samadeli2017 on Feb 1, 2024 17:20:32 GMT
I'm a beginner in programming and am having trouble executing type() successfully. I want to use numberOCR to read numbers and then input those numbers into an input field. The numbers are being read correctly, but when I try to use type() to input them, I get an "invalid no such method error" and it doesn't execute. Below is the script I have created.
Settings:setCompareDimension(true, 1280)
Settings:setScriptDimension(true, 1280)
Settings:set("MinSimilarity", 0.7)
local region = Region(569, 335, 143, 44)
local imagePrefix = "num"
local number = numberOCR(region, imagePrefix)
if number then
print("Number read: " .. number)
local inputFieldRegion = Region(501, 401, 271, 48)
click(inputFieldRegion)
wait(1)
type(num)
else
print("Failed to read number.")
end
|
|
|
Post by AnkuLua on Feb 2, 2024 13:06:05 GMT
First it's number, not num And type() expects string, not number.
You could use the following type("" .. number)
|
|