Jump to content

Recommended Posts

Posted (edited)

I have tried many times but can not find the value, if found also can not edit, so I need help from you

 

 

 

 gg.setVisible(false)
gg.searchNumber('0.8;1.9;3.25', gg.TYPE_FLOAT)
local results = gg.getResults(100) 

for i, v in ipairs(results) do
         if v.value == '0.8' then
             v.value = '1.49'
  elseif v.value == '1.9' then
             v.value = '2.4'
  elseif v.value == '3.25' then
             v.value = '3.59' end
end

gg.setValues(results)


while true do 
  if gg.isVisible() then
      break
    else
      gg.sleep(100);
    end
end

os.exit()

Edited by TisNquyen
Misspell
Posted
  On 6/16/2018 at 3:20 PM, Enyby said:

Dword can not be fractional.

Expand  

I'm sorry for the wrong writing, but I still need your help

gg.searchNumber('0.8;1.9;3.25',gg.TYPE_FLOAT)

  • Administrators
Posted
  On 6/16/2018 at 11:26 PM, TisNquyen said:

I still need your help

Expand  

I do not see what.

  On 6/16/2018 at 12:19 PM, TisNquyen said:

if v.value == '0.8' then

Expand  

You need read about float and it precision. Possible this compare not work. Try use number, not string.

Also maybe it not work too. In general compare for equal fractional values is bad idea.

It is known issue with fractional values. So you can use Internet for search solution. For example: http://lua.2524044.n2.nabble.com/Float-numbers-equality-td7651382.html

Posted
  On 6/17/2018 at 12:57 AM, Enyby said:

I did not found.

You need to read about phao and precision. This comparison is not work. Try to use number, not a string.

Cũng có thể nó cũng không hoạt động. Nói chung so sánh các giá trị phân số bằng nhau là ý tưởng tồi.

Nó được biết đến vấn đề với các giá trị phân đoạn. Vì vậy, bạn có thể sử dụng Internet cho giải pháp tìm kiếm. Ví dụ: http://lua.2524044.n2.nabble.com/Float-numbers-equality-td7651382.html

Expand  

I still do not understand!

Can you guide me in detail?

  • Administrators
Posted

@TisNquyen I can not go the way for you. You must go through it yourself.
In short, fractional numbers should be compared approximately like this:

if math.abs(x - 3.4) < 0.00001 then -- here compare x with 3.4
  -- do something if x equal 3.4
end

 

Posted
  On 6/17/2018 at 8:11 AM, Enyby said:

@TisNquyen I can not go the way for you. You must go through it yourself.
In short, fractional numbers should be compared approximately like this:

if math.abs(x - 3.4) < 0.00001 then -- here compare x with 3.4
  -- do something if x equal 3.4
end

 

Expand  

Thank you! You do not understand this, I do not understand. Because I do not understand high education. So do not understand, whether you reply to me

Thank you!

  • Administrators
Posted

@TisNquyen I wrote you all above. Even the link gave. Do not be so helpless - try yourself to look for information on the Internet. This is done very simply.

Posted
  On 6/17/2018 at 8:36 AM, Enyby said:

@TisNquyen Tôi đã viết tất cả các bạn ở trên. Ngay cả liên kết đã cho. Đừng quá bất lực - hãy thử tìm kiếm thông tin trên Internet. Điều này được thực hiện rất đơn giản.

Expand  

Without the script template, nothing is simple

Posted
  On 6/17/2018 at 9:19 AM, Enyby said:

@TisNquyen Điều này không đúng. Tìm hiểu lua. Tìm hiểu cách sử dụng tìm kiếm trên Internet và bạn sẽ không cần mẫu.

Expand  

Sorry! I'm a beginner in scripting so I do not understand much and have tried many ways, but many places do not have a place to guide.

Since and I recently posted this article to ask if anyone was guiding me, but still have not found a good answer, I am very disappointed!

  • Administrators
Posted

@TisNquyen This is not a school, or a kindergarten. This is the Internet. No one will nurse you. You must train yourself. There is enough information on the Internet for this. It's silly to expect that someone will teach you on the Internet.
If you are not able to learn by yourself - hire a tutor who will teach you and to whom you will pay money.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.