Jump to content
Sign in to follow this  
amberjo

alarm when certain part of browser turns red

Recommended Posts

amberjo

basically what i need is something that makes beeping noise when a certain spot on my screen turns red. it will alert me that i'm being attacked on a game.

my brother told me to download this and figure it out. but i have no idea what the hell i'm doing.

any help would be appreciated.

thanks <3

amber

Share this post


Link to post
Share on other sites
Xandy

;here you can use this script to mouseover a pixel and retrieve values for the xy location of the mouse as well as the pixel color under the mouse

;you can use

;$col = PixelGetColor(x, y)

;if($col==TheRedColorYourTestingFor) then Beep(4000, 2000)

;after you figure out the pixel location and color your looking for

$done=0

hotkeyset("{PAUSE}", "endscript")

hotkeyset("{HOME}", "getxy")

do

until $done=1

;use this function to display mouse coords

Func getxy()

$pos = MouseGetPos()

$col = PixelGetColor($pos[0], $pos[1])

;tooltip($pos[0] & " " & $pos[1] & $col)

MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1] & ",color=" & $col)

EndFunc

Func endscript()

tooltip("")

$done=1

exit

EndFunc ;end endscript()

;please let me know if I can be more specific

;also please let me know if I was useful in this case

Edited by songersoft

Share this post


Link to post
Share on other sites
amberjo

hmm I think it is useful, I just can't figure it out... can you be more specific? I haven't really done this before. I put

Func getxy()

$pos = MouseGetPos()

$col = PixelGetColor($pos[0], $pos[1])

;tooltip($pos[0] & " " & $pos[1] & $col)

MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1] & ",color=" & $col)

EndFunc

Func endscript()

tooltip("")

$done=1

exit

EndFunc ;end endscript()

in the autoit thing, saved it, right clicked on the file in explorer and compiled, and then clicked on it and it did nothing. I'm really a n00b at this....

Share this post


Link to post
Share on other sites
Xandy

;ok we need to setup hotkeys to call the functions:

hotkeyset("{PAUSE}", "endscript")

hotkeyset("{HOME}", "getxy")

$done=0;unnecessary variable used to flag script as done

;then we need a loop to trap the script while we find mouse locations and colors:

do

until $done=1

;i put my functions here at the bottom

Func endscript()

tooltip("");removes tooltips

$done=1

exit

EndFunc ;end endscript()

Func getxy()

$pos = MouseGetPos()

$col = PixelGetColor($pos[0], $pos[1])

;tooltip($pos[0] & " " & $pos[1] & $col);use can use this tooltip instead of the msgbox if you want

MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1] & ",color=" & $col)

EndFunc

this script is only meant to help you find coords and colors to check for

while the script is running pressing the "home key" will display the mouse x, y and color below mouse

"pause key" will end the script

once you have the x, y location of the pixel color you wish to check you use:

if(PixelGetColor(x, y)==TheColorYourCheckingFor) then beep(4000, 2000)

Edited by songersoft

Share this post


Link to post
Share on other sites
amberjo

okay so what i have in there is:

hotkeyset("{PAUSE}", "endscript")

hotkeyset("{HOME}", "getxy")

Func endscript()

tooltip("");removes tooltips

$done=1

exit

EndFunc ;end endscript()

Func getxy()

$pos = MouseGetPos()

$col = PixelGetColor($pos[0], $pos[1])

;tooltip($pos[0] & " " & $pos[1] & $col);use can use this tooltip instead of the msgbox if you want

MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1] & ",color=" & $col)

EndFunc

until $done=1

and it says error: "until" statement with no matching "do" statement on lines 13 and 18

line 13 is $col = PixelGetColor($pos[0], $pos[1])

line 18 is until $done=1

Share this post


Link to post
Share on other sites
Xandy

;this is the script, please copy all code below this line and paste it into your autoit program

hotkeyset("{PAUSE}", "endscript")

hotkeyset("{HOME}", "getxy")

$done=0;unnecessary variable used to flag script as done

do

until $done=1

Func endscript()

tooltip("");removes tooltips

$done=1

exit

EndFunc ;end endscript()

Func getxy()

$pos = MouseGetPos()

$col = PixelGetColor($pos[0], $pos[1])

;tooltip($pos[0] & " " & $pos[1] & $col);you can use this tooltip instead of the msgbox if you want

MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1] & ",color=" & $col)

EndFunc

Edited by songersoft

Share this post


Link to post
Share on other sites
amberjo

awesome, thanks so much! that worked, i got the x and y and the color, now how do i do the alarm part?

Share this post


Link to post
Share on other sites
Xandy

;well i'm not sure right now how to write all your code but I do know that you'll want a loop that checks for the color and beeps when the color is found

; code below

hotkeyset("{PAUSE}", "endscript")

$done=0

do

if(PixelGetColor(the_x, the_y)==the_color) Then beep(4000, 2000)

until $done=1

Func endscript()

tooltip("")

$done=1

exit

EndFunc ;end endscript()

;i had $done=1 at the begining opps i fixed it

Edited by songersoft

Share this post


Link to post
Share on other sites
amberjo

thanks SOOO much! you're the best!

one more question, if i wanted it to beep on either of 2 colors, how would i do that?

Share this post


Link to post
Share on other sites
Xandy

hotkeyset("{PAUSE}", "endscript")

$done=0

do

if(PixelGetColor(the_x, the_y)==the_color) Then beep(4000, 2000)

if(PixelGetColor(the_x2, the_y2)==the_color2) Then beep(4000, 2000)

until $done=1

Func endscript()

tooltip("")

$done=1

exit

EndFunc ;end endscript()

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.