Jump to content
Sign in to follow this  
GodForsakenSoul

when it's done, beep like crazy [not solved]

Recommended Posts

GodForsakenSoul

here's part of my code, the part that doesn't work.

func wakeupcall()
while $l2=1
if pixelgetcolor(477,333)=$1 and pixelgetcolor(474,336)=$2 and pixelgetcolor(477,336)=$3 and pixelgetcolor(480,336)=$4 and _
pixelgetcolor(477,339)=$5 then
sleep(5000)
else
beep (250,100)
beep (500,100)
beep (250,100)
beep (1000,100)
beep (750,100)
$l2=0

now, when i call this function, it does nothing. there is no error and the colors that i sampled are the color that need to be looked for

any suggestions on how to solve this or suggestions on something that works better?

edit: i accidentally pressed submit thread rather then preview ._.;

Edited by GodForsakenSoul

Share this post


Link to post
Share on other sites
Andreik

Your function is incomplete.

Edited by Andreik

When the words fail... music speaks

Share this post


Link to post
Share on other sites
PsaltyDS

here's part of my code, the part that doesn't work.

func wakeupcall()
while $l2=1
if pixelgetcolor(477,333)=$1 and pixelgetcolor(474,336)=$2 and pixelgetcolor(477,336)=$3 and pixelgetcolor(480,336)=$4 and _
pixelgetcolor(477,339)=$5 then
sleep(5000)
else
beep (250,100)
beep (500,100)
beep (250,100)
beep (1000,100)
beep (750,100)
$l2=0

now, when i call this function, it does nothing. there is no error and the colors that i sampled are the color that need to be looked for

any suggestions on how to solve this or suggestions on something that works better?

edit: i accidentally pressed submit thread rather then preview ._.;

Ah, I psychically see the problem! Besides the missing EndIf, WEnd, and EndFunc, you have a bad array reference at line 213...

:)

All seriousness aside, how do you expect any help without showing the complete function, how it's called, where variables like $1, $2, etc. where set, if the many "And" conditions were met, etc., etc., ....


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
GodForsakenSoul

er... i forgot to close some things in the post... crap...

the function is being called from a hotkey.

hotkeyset ("^{F7}", "wakeupcall")

dim $l=1
dim $l2=1
dim const $min=60000

while $l=1;this saves my work once every 15 minutes. i forget to save
   sleep(min*15)
   send ("^s")
wend

func wakeupcall()
while $l2=1
if pixelgetcolor(477,333)=$1 and pixelgetcolor(474,336)=$2 and pixelgetcolor(477,336)=$3 and pixelgetcolor(480,336)=$4 and _
pixelgetcolor(477,339)=$5 then;check to see if the "tracing image" window is still there"
sleep(5000)
else;if it's not there, raise the alarm!
beep (250,100)
beep (500,100)
beep (250,100)
beep (1000,100)
beep (750,100)
$l2=0
endif
endfunc

the point of this is that when i work in flash and trace the image, it takes some time to trace it (literally, about 20 minutes). during that time i go watch tv. this thing supposed to call me once the tracing is done.

varibles $1 to $5 are what i got from doing pixelgetcolor(x,y) on some points on the window. they're not important.

Edited by GodForsakenSoul

Share this post


Link to post
Share on other sites
therms

Where's the closing WEnd for "while $l2=1"?

Edited by therms

Share this post


Link to post
Share on other sites
crzftx

Make sure you're pressing the right hotkey. You could add a notification when the function is correctly called. I don't see the point of all of the pixelgetcolor's. To see if a window still exists use "If WinExists()" If the window doesn't close, this function really shouldn't accomplish anything. Instead of waiting to see if the current changes, wait for the future to happen; what I mean is, instead of waiting for pixels to change, wait for a completion window to open (or whatever is supposed to happen when the actions are complete).

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  

×