 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
trueski
Joined: 08 Apr 2008 Posts: 32
|
Posted: Thu Aug 07, 2008 7:17 pm Post subject: ImageSearch not working correctly?... Syntax?.. |
|
|
I'm trying to make a script that will take and save screenshots of a specific window every 200ms, As long as it is different from the last 5... I can't seem to get it to work...
| Code: | #Persistent
#SingleInstance force
FileCreateDir, ScreenShots
loop
{
IfWinNotActive, Window Title
{
Sleep, 200
Continue
}
LastPic := A_Index - 1
LastPic2 := A_Index - 2
LastPic3 := A_Index - 3
LastPic4 := A_Index - 4
LastPic5 := A_Index - 5
Loop
{
ImageSearch, OutputVarX1, OutputVarY, 0, 0, A_ScreenWidth, A_ScreenHeight, *150 ScreenShots\%LastPic%.gif
ImageSearch, OutputVarX2, OutputVarY, 0, 0, A_ScreenWidth, A_ScreenHeight, *150 ScreenShots\%LastPic2%.gif
ImageSearch, OutputVarX3, OutputVarY, 0, 0, A_ScreenWidth, A_ScreenHeight, *150 ScreenShots\%LastPic3%.gif
ImageSearch, OutputVarX4, OutputVarY, 0, 0, A_ScreenWidth, A_ScreenHeight, *150 ScreenShots\%LastPic4%.gif
ImageSearch, OutputVarX5, OutputVarY, 0, 0, A_ScreenWidth, A_ScreenHeight, *150 ScreenShots\%LastPic5%.gif
IfEqual, OutputVarX1,
IfEqual, OutputVarX2,
IfEqual, OutputVarX3,
IfEqual, OutputVarX4,
IfEqual, OutputVarX5,
Break
Sleep, 200
}
run, i_view32.exe "/capture=2 /convert=ScreenShots\%A_index%.gif" , ,hide
Sleep, 200
}
return |
_________________ -Trueski- |
|
| Back to top |
|
 |
trueski
Joined: 08 Apr 2008 Posts: 32
|
Posted: Thu Aug 07, 2008 9:30 pm Post subject: |
|
|
Updated... Still doesn't work
| Code: | #Persistent
#SingleInstance force
FileCreateDir, ScreenShots
loop
{
WinWaitActive, NW956s1.WS
IfLess, A_Index, 6
{
run, i_view32.exe "/capture=2 /convert=ScreenShots\%A_Index%.gif" , ,hide
Sleep, 200
Continue
}
LastPic := A_Index - 1
LastPic2 := A_Index - 2
LastPic3 := A_Index - 3
LastPic4 := A_Index - 4
LastPic5 := A_Index - 5
Loop
{
TotalError := 0
ImageSearch, OutputVarX, OutputVarY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *5 ScreenShots\%LastPic%.gif
IfEqual, ErrorLevel, 1
TotalError += 1
Sleep, 200
ImageSearch, OutputVarX, OutputVarY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *5 ScreenShots\%LastPic2%.gif
IfEqual, ErrorLevel, 1
TotalError += 1
Sleep, 200
ImageSearch, OutputVarX, OutputVarY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *5 ScreenShots\%LastPic3%.gif
IfEqual, ErrorLevel, 1
TotalError += 1
Sleep, 200
ImageSearch, OutputVarX, OutputVarY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *5 ScreenShots\%LastPic4%.gif
IfEqual, ErrorLevel, 1
TotalError += 1
Sleep, 200
ImageSearch, OutputVarX, OutputVarY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *5 ScreenShots\%LastPic5%.gif
IfEqual, ErrorLevel, 1
TotalError += 1
Sleep, 200
IfEqual, TotalError, 5
Break
}
run, i_view32.exe "/capture=2 /convert=ScreenShots\%A_index%.gif" , ,hide
Sleep, 200
} |
_________________ -Trueski- |
|
| Back to top |
|
 |
Superfraggle
Joined: 02 Nov 2004 Posts: 970 Location: London, UK
|
|
| Back to top |
|
 |
trueski
Joined: 08 Apr 2008 Posts: 32
|
Posted: Thu Aug 07, 2008 9:39 pm Post subject: |
|
|
Got it working, forgot,
| Code: | | CoordMode, Pixel, Screen |
The CPU load is extremely high however _________________ -Trueski- |
|
| Back to top |
|
 |
trueski
Joined: 08 Apr 2008 Posts: 32
|
Posted: Thu Aug 07, 2008 9:40 pm Post subject: |
|
|
sweet, thanks _________________ -Trueski- |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Aug 07, 2008 9:58 pm Post subject: |
|
|
lmao you pwned yourself made me laugh, Thx  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|