Realtime Pixel color and Mouse cords IN a macro

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
WantedMan_

Realtime Pixel color and Mouse cords IN a macro

Post by WantedMan_ » Tue Nov 30, 2004 7:32 pm

what I would like to do is create a macro that outputs the mouse position and pixel number in realtime. just like how the macro properties works. but this has to in a macro. anyway to do this?

Here is my macro here. Obviously I can get the pixel color. but would like to have it display in realtime ALSO (just like the macro properties window)

Dialog>Dialog1
Caption=GetPixel
Top=212
Width=264
Left=639
Height=113
Label=X,232,8
Label=Y,232,32
Button=Update,16,8,75,25,5
Button=Exit,16,48,75,25,6
Edit=PixelX,104,8,121,
Edit=PixelY,104,32,121,
Edit=PixelNumber,104,56,121,

EndDialog>Dialog1


Show>Dialog1

Label>ActionLoop
GetDialogAction>Dialog1,r
if>r=5,Update
if>r=6,Close
if>r=2,exit
Goto>ActionLoop
Label>exit

SRT>Update
GetPixelColor>%Dialog1.PixelX%,%Dialog1.PixelY%,Pixel
Let>Dialog1.PixelNumber=%Pixel%
ResetDialogAction>Dialog1
END>Update

SRT>Close
CloseDialog>Dialog1
Let>r=2
END>Close

-=DJ=-

Post by -=DJ=- » Mon Feb 21, 2005 6:01 pm

Here you go

////This will give you the real time color of one position
////However you can add more positions if you need to
////Just add anoter edite box and do for example gpc>123,123,PC2 and add let>Dialog1.msEdit2=PC to the color loop
Dialog>Dialog1
Caption=Get Color
Top=-2
Width=193
Left=5
Height=128
Label=Real Time Color,59,8
Edit=msEdit1,36,32,121,
Button=Stop,59,64,75,25,2
EndDialog>Dialog1
show>Dialog1
label>color loop
wait>.0005
gda>Dialog1,r
if>r=2,2
gpc>577,521,PC
let>Dialog1.msEdit1=PC
rda>Dialog1
goto>color loop
label>2

http://www.cp-autos.com is my website you can reach me there for more help

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Feb 21, 2005 6:40 pm

I think the original poster wanted to track and display the mouse position and get the color at that point. If so here's a modified version of the script that does that. Just run it and move the mouse around and it will show you x,y,color:

Dialog>Dialog1
Caption=Get Color
Top=-2
Width=193
Left=5
Height=128
Label=Real Time Color,59,8
Edit=msEdit1,36,32,121,
Button=Stop,59,64,75,25,2
EndDialog>Dialog1

show>Dialog1
label>colorloop
Wait>0.05
gda>Dialog1,r
if>r=2,end
Gcp>x,y
gpc>x,y,PC
let>Dialog1.msEdit1=%x%,%y%,%PC%
rda>Dialog1
goto>colorloop

label>end
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts