archer Posted January 20, 2009 Report Share Posted January 20, 2009 Simple question but I can't get it going... I currently have: Repeat until n1<>n1 get pixel of screen coords into n1 repeat end I just want it to stop if the pixel color changes. And also when stopping can it play an Audible Alarm? Also, I was wondering if I could have it check two parts of the screen.? Ending if either does not equal the correct color. Also, is there a way to repeat a command until something doesn't exist (pixel color) then continue with the script? Thank you, Quote Link to comment Share on other sites More sharing options...
stevecasper Posted January 20, 2009 Report Share Posted January 20, 2009 Simple question but I can't get it going... I currently have: Repeat until n1<>n1 get pixel of screen coords into n1 repeat end I just want it to stop if the pixel color changes. And also when stopping can it play an Audible Alarm? The problem you're experiencing is that N1 will ALWAYS equal N1, even if N1 changes within the repeat, when the Macro checks to see if N1 equals N1, it will... because N1 = N1 What you want to do is something along these lines: Get Pixel: Screen Coords: 424,432 into %N1% Repeat Until %T1% <> %T1% Get Pixel: Screen Coords: 424,432 into %N2% If Variable %N1% <> variable %N2% Break End If Repeat End <GETPX:1:S:000424:000432><REP3:08:000002:000001:0001:1:01:T1><GETPX:2:S:000424:000432><IFVAR2:5:01:2:N2><BREAK><ENDIF><ENDREP> This way the macro will repeat until N1 does not equal N2, because N1 is set before the Repeat Loop begins, it will never change. N2, on the other hand, will only equal N1 until that pixel changes, at which point the Loop will break, and the rest of the macro can continue. Also, you can add a sound to the macro using the Sound Beep command or the Sound Wave File command (located under the Multimedia category by default). Quote Link to comment Share on other sites More sharing options...
kevin Posted January 20, 2009 Report Share Posted January 20, 2009 Or you might try something like this: Get Pixel: Screen Coords: 424,432 into %N1% Variable Modify Integer: Copy %N1% to %N2% Repeat Until %N1% <> %N2% Get Pixel: Screen Coords: 424,432 into %N1% Repeat End Quote Link to comment Share on other sites More sharing options...
archer Posted January 20, 2009 Author Report Share Posted January 20, 2009 Thank you both, I will try it out shortly. With that logic can I also specify two different points for it to make sure has the correct color? Can I have the sound go off if the macro is ended? (So I wake up..or can hear it beeping) I understand the one Kevin posted a bit more I think I could put two points into it... And I just put that code anywhere in my script? Then when that script stops repeating can I make it audible beeps? Quote Link to comment Share on other sites More sharing options...
archer Posted January 21, 2009 Author Report Share Posted January 21, 2009 Thank you both, I will try it out shortly. With that logic can I also specify two different points for it to make sure has the correct color? Can I have the sound go off if the macro is ended? (So I wake up..or can hear it beeping) I understand the one Kevin posted a bit more I think I could put two points into it... And I just put that code anywhere in my script? Then when that script stops repeating can I make it audible beeps? Update-- I worked with both of them but didn't get it working, probably inserted incorrectly. This is just a check for pixel change along with a long script for a videogame. Quote Link to comment Share on other sites More sharing options...
archer Posted January 21, 2009 Author Report Share Posted January 21, 2009 Any idea's I can't get the script to end on pixel color change and another biggie was if the pixel color changes and the macro ends can i play audible repetitive beeps to alert me to the ending. Thanks all! Quote Link to comment Share on other sites More sharing options...
stevecasper Posted January 21, 2009 Report Share Posted January 21, 2009 Any idea's I can't get the script to end on pixel color change and another biggie was if the pixel color changes and the macro ends can i play audible repetitive beeps to alert me to the ending. Thanks all! To help us understand what might be going wrong, please provide the macro code inside [ codebox ] and [ /codebox ] tags (remove the spaces). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.