t0ddie 0 Posted December 7, 2004 (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 December 7, 2004 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
Guest Py7|-|[]/\/ Posted December 7, 2004 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
t0ddie 0 Posted December 7, 2004 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
Guest Py7|-|[]/\/ Posted December 7, 2004 2 variables will have to do. Share this post Link to post Share on other sites
t0ddie 0 Posted December 7, 2004 (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 December 7, 2004 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
Guest Py7|-|[]/\/ Posted December 7, 2004 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 6 Posted December 7, 2004 You could make your own function and call it: Func _myPixelGetColor($coord) Local $p = StringSplit($coord, ",") Return PixelGetColor( Number($p[1]) , Number($p[2]) ) EndFunc Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Share this post Link to post Share on other sites
Guest Py7|-|[]/\/ Posted December 7, 2004 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
JSThePatriot 18 Posted December 7, 2004 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 LinksFile-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.ComputerGetInfo UDF's Updated! 11-23-2006External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Share this post Link to post Share on other sites
normeus 0 Posted December 7, 2004 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 http://www.autoitscript.com/autoit3/scite/...iTe4AutoIt3.exe Share this post Link to post Share on other sites