Jump to content

Dec Variable problem


Recommended Posts

If (PixelGetColor($ThiredLaserIcon[0], $ThiredLaserIcon[1]) = Dec("000000"))

Can someone explain this line to me.

$thiredlasericon[0] is a X cordinate and $thiredLaserIcon[1] is a y cordinate

But what i dont under stand is the Dec part of this

Helpfile says Returns a numeric representation of a hexadecimal string.

But that looks like a html Color code to me.

The peace of code is sposta work like this

Check x,y if number = green then

I didnt write this peace of code but i am trying to understand how that is going to work.

can Anyone give me some help?

thanks

Blacksniper

Link to comment
Share on other sites

Thats not a hex code. You also can't put quotes around the parameter for Dec(). Should be Dec(0x0000FF)

Wow, that's not right!

Dec(0xf) gives 21 = wrong

Dec("0f") gives 15 = correct

Dec(0x0000ff) gives 597 = wrong

Dec("0000ff") gives 255 = correct

The parameter should be a hex string as stated in the help. The code in the OP is correct.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Wow, that's not right!

Dec(0xf) gives 21 = wrong

Dec("0f") gives 15 = correct

Dec(0x0000ff) gives 597 = wrong

Dec("0000ff") gives 255 = correct

The parameter should be a hex string as stated in the help. The code in the OP is correct.

You are correct sir. I think I was thinking of Int().

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...