Jump to content
mhmd320666

Script wrong

Recommended Posts

Hello i  maked script yesterday but somthing is wrong let me explain what the problem

First of all that is my script

gg.clearResults()
  gg.setRanges(gg.REGION_C_ALLOC)
  gg.searchNumber("0,0;0,0;0,0;0,0;0,0;-0,0;0,5;-360,0;360,0;740,0;0,5;-740,0;0,0;0,0;0,0;0,0;0,0;1,0;1,0;0,0;0,0;0,0;0,0;0,0;1,0;1,0;1,0;1,0;0,0;0,0;0,0;1,0:133", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)
    gg.searchNumber("0.5", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)
    t = gg.getResults(10)
    gg.editAll("0", gg.TYPE_FLOAT)
    t[1].value = "0"
    t[2].value = "0.5"
    t[3].value = "0"
    t[4].value = "0.5"
    t[1].freeze = true
    t[2].freeze = true
    t[3].freeze = true
    t[4].freeze = true
    print("addListItems: ", gg.addListItems(t))
    gg.toast(" + ")

Now the script muss to search at fist value the to 0.5 and freeze 2 from 4 result

But gg when he search for first value it says 0 founded while searching to100%

When searching finish is then it shows 72 results 

For this problem when i run script he search to first value then he dont find result but actually there is 72 results normally 

Then he search to 0.5 and i get 300 result 

Because he dont found somthing on fiest value

 

Share this post


Link to post
Share on other sites

Use refineNumber if you need refine.

Share this post


Link to post
Share on other sites
2 hours ago, Enyby said:

Use refineNumber if you need refine.

How can i do it can youplease fix script the script is in my text

Share this post


Link to post
Share on other sites

Use refineNumber instead of second searchNumber.

Share this post


Link to post
Share on other sites
34 minutes ago, Enyby said:

Use refineNumber instead of second searchNumber.

What is false now after refline i muss to get 4 result then it muss freeze the first and the third result but script wrong

Screenshot_20190514-120324_QuickEdit.jpg

Screenshot_20190514-120336_QuickEdit.jpg

Screenshot_20190514-120336_QuickEdit.jpg

Share this post


Link to post
Share on other sites

1. Scripts work always in English locale. So 0.5 must use dot, not a comma.

2. You must check count of found results. Not blind load all and work with it. It can be zero results. So you try index not exists results and all go to hell.

Share this post


Link to post
Share on other sites

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...