Jump to content

Sapient

Members
  • Posts

    18
  • Joined

  • Last visited

Sapient's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Yeah, that was not available until Chrome Version 11, which was released five months after I originally wrote this. Regardless, I am very glad that SpyVsSpy.exe is now irrelevant, and at last Google has added an officially supported way of disabling the Chrome incognito mode. Thanks for posting this link.
  2. I for one would like to see AutoIt support object orientation, but of course it should be builtin and not require an extra module.
  3. True, but my solution only works for binary numbers that are up to 32 bits. If you want to compare larger binaries (e.g. graphics files) a special function could still be needed.
  4. I must be getting rusty if I had forgotten that. Thanks for reminding me, though.
  5. "verify if a number is contained in binary number" ? I think you are attempting to describe the following bitwise operation: return (BitOR($whole, $part) = $whole) ; edited according to comment below ; replaced == with = comparison operator which could also be written: return NOT(BitXOR($whole, BitOR($whole, $part)))
  6. Hi, that could happen for a couple of reasons. You could be using an odd skin that makes it fail the color reference checks. Or your computer is very slow and so it can't sample a valid color reference within the allowed threshold of time. Or your version of chrome renders the browser differently from mine. The first thing I would try is go back to the default skin and increase the $ref_fails threshold. Find the line where it says $ref_fails > 4 and increase that number to 8, then recomopile. If that doesn't solve your problem then uncomment both of the MsgBox lines, recompile, and let me know what messages pop up. Also, remember you have to kill the running SpyVsSpy program and restart it for the changes to take effect. If it turns out the problem was the skin, please let me know which skin you were using so I can adjust the algorithm. So far it works for all the ones I tested.
  7. You can't die exactly, you just get stopped by or stuck inside your tail. BTW, I found another bug. There's actually a race condition that can occur if you change direction of the snake after $nX has been modified but before $nY has been modified. It's so rare you would almost never see it, but it did occur for me once. You can prevent this by setting the boolean that prevents changing direction before calling Move, like so: Func LOOP () $bIS_TURNING = True Local $nX = Move(0,$nCURRENT_X,$nCURRENT_Y) Local $nY = Move(1,$nCURRENT_X,$nCURRENT_Y) $bIS_TURNING = False TURN_SNAKE($nNEXT_DIRECTION) ...
  8. Nice program. It's very concise and also fun. I noticed it couldn't handle fast turning, though. If people have very nimble fingers you need to store the next direction before it has moved forward. I modified the part that handles turning as follows: Func INPUT () If _IsPressed ('57') Then TURN_SNAKE(0) ElseIf _IsPressed ('44') Then TURN_SNAKE(1) ElseIf _IsPressed ('53') Then TURN_SNAKE(2) ElseIf _IsPressed ('41') Then TURN_SNAKE(3) EndIf EndFunc Func TURN_SNAKE ($nDIRECTION) If $bIS_TURNING Then $nNEXT_DIRECTION = $nDIRECTION ElseIf Mod($nDIRECTION - $nCURRENT_DIRECTION, 2) <> 0 Then $nCURRENT_DIRECTION = $nDIRECTION $nNEXT_DIRECTION = $nDIRECTION $bIS_TURNING = True EndIf EndFunc ;==>TURN_SNAKE Then I added the following global variables: Global $nNEXT_DIRECTION = 1 Global $bIS_TURNING = False Finally I changed the LOOP function to turn to the next direction (if any): Func LOOP () Local $nX = Move(0,$nCURRENT_X,$nCURRENT_Y) Local $nY = Move(1,$nCURRENT_X,$nCURRENT_Y) $bIS_TURNING = False TURN_SNAKE($nNEXT_DIRECTION) ...
  9. Create a local temporary HTML file with Javascript that calls the actionscript method. If you don't know how to do that, google for "call actionscript function from javascript" Also, by responding to your post I am not indicating support for that news organization. To be fair, though, it's probably better than FOX News.
  10. All common databases are "SQL databases." You could be a bit more specific.
  11. There have been a lot of advance PixelSearch routines posted on the forums. I did a quick forum search and this was the first one that turned up:
  12. This is not a general support forum! Forum Rules state that this forum is for users to share their working scripts with other users who may find them useful. Do not post general support questions here, instead use the v3 Support forum. Use ControlSend. From AutoIt Help file: "ControlSend works in a similar way to Send but it can send key strokes directly to a window/control, rather than just to the active window." As for pixels, I don't think you can do that without activating the window.
  13. Hi, there is a built-in function PixelSearch that uses an internal calculation "number of shades of variation of the red, green, and blue components of the colour", however I didn't see any separate function available to calculate such color differences independently. This is a fairly simple thing to calculate, but since I needed it for my Disable Chrome Incognito script I thought I would include it here in case anyone else finds it useful. My apologies if someone already posted something similar, but I did a quick search and didn't see it. #include <Math.au3> ; Note: Math.au3 needed for _Max() Func _ColorDiff($color1, $color2, $min_return = 0) If $color1 = $color2 Then Return $min_return EndIf Return _ColorDiff(BitShift($color1,8), BitShift($color2,8), _Max($min_return, Abs(BitAnd($color1, 0xFF) - BitAnd($color2, 0xFF)))) EndFunc Note: my version returns the max shade difference across R G and B (not the sum of the three differences).
  14. Thanks for the feedback. I went with that simplistic approach because I didn't want to worry about all the possible skins out there or potential artistic tweaks to the incognito icon which may be pushed with future google updates. However, here is version 2.2 below and it does address your concerns (and detects another vulnerability you didn't mention yet). ; SpyVsSpy.au3, version: 2.2 ; author: Patrick Parker <patrick_x99 (email at) hotmail.com> ; this code is provided free for personal use and provided as-is with no warranty or promise of fitness for any purpose #NoTrayIcon #include <Misc.au3> #include <Math.au3> if _Singleton("SpyVsSpy",1) = 0 Then Exit ; already running EndIf $loop = 1 $hat_fails = 0 $ref_fails = 0 While $loop $wins = WinList("[REGEXPCLASS:Chrome.*; REGEXPTITLE:.* - Google Chrome]") For $i = 1 to $wins[0][0] $win = $wins[$i][1] ; save the handle If IsVisible($win) and IsActive($win) Then $dim = WinGetPos($win) If IsMaximized($win) Then $hat_x = 20 $hat_y = 2 $ref_x = 75 $ref_y = 28 Else $hat_x = $dim[0] + 25 $hat_y = $dim[1] + 15 $ref_x = $dim[0] + 80 $ref_y = $dim[1] + 44 EndIf $checksum = PixelChecksum($hat_x, $hat_y, $hat_x+8, $hat_y+5, 1, $win) ; MsgBox(0, "Details", "Title=" & $wins[$i][0] & @LF & "Handle=" & $win & @LF & "The color checksum is " & $checksum) ; Exit If $checksum = 3044775763 Then $hat_fails = $hat_fails+1 ; detected checksum of incognito hat, as sampled from Chrome 9.0.597.94 Else $hat_fails = 0 EndIf $colordiff = ColorDiff(PixelGetColor( $ref_x , $ref_y , $win), PixelGetColor( $ref_x , $ref_y+11 , $win)) ; MsgBox(0, "Details", "Title=" & $wins[$i][0] & @LF & "Handle=" & $win & @LF & "The color 0x" & Hex(PixelGetColor($ref_x,$ref_y,$win),6) & " at " & $ref_x & "," & $ref_y & " is " & $colordiff & " shades different from color 0x" & Hex(PixelGetColor($ref_x,$ref_y+11,$win),6) & " at " & $ref_x & "," & ($ref_y+11)) ; Exit If $colordiff < 31 Then $ref_fails = $ref_fails+1 ; unable to sample pixels because active window is obscured Else $ref_fails = 0 EndIf If $hat_fails > 0 Or $ref_fails > 4 Then WinKill($win) $hat_fails = 0 $ref_fails = 0 EndIf EndIf Next Sleep(500) ; 1/2 second WEnd Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc Func IsActive($handle) If BitAnd( WinGetState($handle), 8 ) Then Return 1 Else Return 0 EndIf EndFunc Func IsMaximized($handle) If BitAnd( WinGetState($handle), 32) Then Return 1 Else Return 0 EndIf EndFunc Func ColorDiff($color1, $color2, $min_return = 0) If $color1 = $color2 Then Return $min_return EndIf Return ColorDiff(BitShift($color1,8), BitShift($color2,8), _Max($min_return, Abs(BitAnd($color1, 0xFF) - BitAnd($color2, 0xFF)))) EndFunc
  15. Hey snowboarder. Sorry I just noticed this reply. Looks like you've done everything correctly so far, but the Task Scheduler in Windows 7 is a pain to configure correctly (I know because I'm also using Windows 7). My guess is that SpyVsSpy.exe isn't even running. Try double-clicking SpyVsSpy.exe to run it, so that way you at least know it is running. Then see if you can launch incognito windows. This way you can isolate the problem to the script or the task scheduler. I'm not an expert on the Windows Task Scheduler so I will only be able to give limited advice on it, but there are other resources and forums out there if that is the issue. I will say to make sure you turn off all conditions that disable the task, for example when on battery power, when idle, etc. I set it to run every five minutes and at logon.
×
×
  • Create New...