t0ddie Posted December 7, 2004 Share 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. Link to comment Share on other sites More sharing options...
Guest Py7|-|[]/\/ Posted December 7, 2004 Share 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. Link to comment Share on other sites More sharing options...
t0ddie Posted December 7, 2004 Author Share 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. Link to comment Share on other sites More sharing options...
Guest Py7|-|[]/\/ Posted December 7, 2004 Share Posted December 7, 2004 2 variables will have to do. Link to comment Share on other sites More sharing options...
t0ddie Posted December 7, 2004 Author Share 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. Link to comment Share on other sites More sharing options...
Guest Py7|-|[]/\/ Posted December 7, 2004 Share 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. Link to comment Share on other sites More sharing options...
CyberSlug Posted December 7, 2004 Share 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! Link to comment Share on other sites More sharing options...
Guest Py7|-|[]/\/ Posted December 7, 2004 Share 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. Link to comment Share on other sites More sharing options...
JSThePatriot Posted December 7, 2004 Share 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 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) Link to comment Share on other sites More sharing options...
normeus Posted December 7, 2004 Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now