Sign in to follow this  
Followers 0
t0ddie

calling coordinates as a variable

10 posts in this topic

#1 ·  Posted (edited)

im trying to create a loop to eliminate excess code.

i want to do this

$1 = "188,264"

$test = pixelgetcolor ($1)

but i get an error

please tell me whats wrong here, thanks

Todd

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites



pixelgetcolor will not work with a string. You saved the number 188,264 as a string. Try it without the quotes.

Share this post


Link to post
Share on other sites

cause theres a comma in there

i would need to create 2 variables. so, i cant string it huh


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

2 variables will have to do.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

/\/,Dec 6 2004, 04:39 PM]2 variables will have to do.

<{POST_SNAPBACK}>

yep, but i was just thinking, i could make one variable, then stringtrim it and use it again.

seems like it might makes things less bulky. i got alot of coordinates here

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

When you string trim it wouldn't you still end up with a string? It will not accept any strings. So even if you do that, you would still be left with a string.

Share this post


Link to post
Share on other sites

CyberSlug, just wondering, but is it possible to "cast" a String data type into an int/double/long/short type? If this is possible then you might be able to do something like that.

Share this post


Link to post
Share on other sites

CyberSlug, just wondering, but is it possible to "cast" a String data type into an int/double/long/short type? If this is possible then you might be able to do something like that.

<{POST_SNAPBACK}>

If you look at what he did above. He made the string into a number with the Number() command.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

t0ddie,

it seems you need to read up on arrays

$pq[1][0]=188 ; first point x

$pq[1][1]=264 ; first point y

Return PixelGetColor( $pq[1][0] ,$pq[1][1] )

if it is a lot of points create a text file of points and load up the array at the beggining

of your script

also if your points have a constant increment you could use a for...next loop

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
Sign in to follow this  
Followers 0