Jump to content

Szhlopp

Active Members
  • Posts

    443
  • Joined

  • Last visited

Profile Information

  • Member Title
    DC Talk JF
  • Location
    Milky Way

Recent Profile Visitors

895 profile views

Szhlopp's Achievements

Universalist

Universalist (7/7)

19

Reputation

  1. Sorry guys, Should have made that more clear. This is NOT error proofed and none of the data is being checked (validated). This is simply an example of how to do this. Yes, it is a working 'example UDF(user defined function)', meaning the calls inside are meant to be modified to fit your needs =) Hope that clears up the issues. Szh
  2. Hey guys, I was PM'ed about how to get a list of friends off of facebook. I developed a couple of sample UDF's on how to do that as well as a few functions to get information (like a phone number or email address). What you need to know: 1) I am requiring you to be on the persons friends page (navigate to your/their profile and click the 'Friends (100)' link on the left hand column). If you want to automate this, it's as simple as adding a line to navigate to it everytime. 2) For speed, you may want to store the list you get someplace and work off of it instead of loading it everytime (load takes about 20sec - 1 minute depending on friends list size) 3) this is a sample UDF. If you have questions feel free to ask, but I am not advertising a finished product here Enjoy! #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: Szhlopp Script Function: Simple facebook friends 'screen scraper'. This is mostly an example set of UDF's that you can easily expand upon. #ce ---------------------------------------------------------------------------- #include "IE.au3" #include <Array.au3> ; ; ; YOU need to make sure you're logged in. $oIE = _IEAttach("facebook", "URL") ;Get the array $FriendsArray = FBGetFriends($oIE) ;Count the number of friends MsgBox(0, "", "Number of friends: " & UBound($FriendsArray) / 2) ;Get their UID by name MsgBox(0, "", FBGetUIDByName($FriendsArray, "Bob Smith")) ; Navigate to a persons info page to scrape a number or email addresses _IENavigate($oIE, FBBuildFriendsInfoURL(FBGetUIDByName($FriendsArray, "Bob Smith"))) FBGetEmailAddresses($oIE) ; MUST be on info page FBGetPhoneNumber($oIE) ; MUST be on info page ; returns an array of [n] UID [n + 1] Name Func FBGetFriends($oIE) $FriendsCount = 0 If StringInStr(_IEPropertyGet($oIE, "locationurl"), "friends") >= 1 Then $pass = 1 $scrollmore = True while $scrollmore = True $CurrCount = _FBGetFriendsCount($oIE) If $CurrCount = $FriendsCount Then $pass += 1 If _FBCheckFullList($oIE) = 1 Then $oIE.document.parentwindow.scroll(0, 0) EndIf Else $pass = 1 EndIf $FriendsCount = $CurrCount $oIE.document.parentwindow.scroll(0, 900000) Sleep(250) If $pass >= 5 then $scrollmore = False WEnd $SRE = StringRegExp(_IEBodyReadHTML($oIE), '(?i)eng\_tid\"\:(\d*)\,\"eng\_data\"\:\[\]\}\}\' & "'\>([^\<].*?)\<", 3) ;(?i)eng\_tid\"\:(\d*)\,\"eng\_data\"\:\[\]\}\}\'\>([^\<].*?)\< Return $SRE Else MsgBox(0, "", "Please load up facebook, go to the persons facebook page and click 'Friends (100)' on the left hand side") EndIf EndFunc ; Returns the navigation url to a friends info page Func FBBuildFriendsInfoURL($ID) Return "facebook.com/profile.php?id=" & $ID & "&sk=info" EndFunc ; Returns an array of phone numbers Func FBGetPhoneNumber($oIE) $SRE = StringRegExp(_IEBodyReadHTML($oIE), "(?i)phone.*?uiListVertical.*?\>(.*?)\<SPAN", 3) Return $SRE EndFunc ; Returns an array of address Func FBGetEmailAddresses($oIE) $SRE = StringRegExp(_IEBodyReadHTML($oIE), '(?i)LI\sclass\=\"uiListItem\s\s?\s?uiListVerticalItemBorder\"\>([^\<].*?)\<\/LI', 3) Return $SRE EndFunc ; returns the UID Func FBGetUIDByName($aFriendsArray, $sFriendsName) $index = _ArraySearch($aFriendsArray, $sFriendsName) Return $aFriendsArray[$index - 1] EndFunc ;Internal func _FBCheckFullList($oIE) $oLinks = _IELinkGetCollection($oIE) for $link in $oLinks if StringInStr($link.outerText, "see more") >= 1 and StringInStr($link.href, "list/friends/all") >= 1 then Return 1 EndIf Next Return 0 EndFunc func _FBGetFriendsCount($oIE) $SRE = StringRegExp(_IEBodyReadHTML($oIE), '(?i)eng\_data\"' & "\:\[\]\}\}\'" & '\>([^\<].*?)\<', 3) Return UBound($SRE) EndFunc
  3. Hey Autoit forum members! So it's been a while since I've posted anything, but I feel like I should share this one Spellchecking that WORKS! Finally a really easy and simple way to add spellchecking to a GUI. Looks nice, feels comfortable, and is completely editable(the appearance). How does it works? Googiespell and Google have provided an awesome way to integrate a multilingual spellcheck textbox into any standard html page. Using an embedded browser and custom made html document(done in expression web 4), it makes a really nice looking spellcheck to use in your gui. Try it out! ZIP contains: Spellchecksample.au3 <-- The autoit script, duh SpellChecker.html <-- The custom html page(edit this to change colors / look and feel) Googiespell(folder) <-- All of the Javascript, images, and other random crap Googiespell has provided us with. Enjoy! If you have any questions or comments feel free to ask. SpellCheck.zip (READ! This is free to use if NOT for commercial purposes) Licensed under Creative Common Non Commercial license: http://creativecommons.org/licenses/by-nc-sa/3.0/ to buy a LICENSE for commercial use: http://orangoo.com/labs/GoogieSpell/ --Making changes to spellchecker-- Q. How do I add more languages? A. Under spellchecker.html, you can add or remove any of these languages: Q. How do I change the colors of the spellchecker? A. Googiespell.css is a stylesheet. Want to change the way it appears when the spelling is 'okay'? There are a few inpage styles for looks as well(spellchecker.html), body { margin: 0px; background-color: #FFFFFF; } h1, h2 { font-size: 18px; font-family: verdana, helvetica, sans-serif; color: #333; margin: 0px; padding: 0px; padding-bottom: 10px; } h3 { font-size: 14px; color: #333; margin: 0px; padding-top: 15px; padding-bottom: 2px; } pre { margin-top: 5px; padding: 4px; background-color: #e3e2c6; border: 1px solid #999; } .textarea { /* START GoogieSpell reqs.*/ line-height: 13px; font-size: 13px; padding: 0px; font-family: sans-serif; /* END GoogieSpell reqs.*/ width: 400px; height: 300px; } .inputbox { /* START GoogieSpell reqs.*/ line-height: 13px; font-size: 13px; padding: 2px; font-family: sans-serif; /* END GoogieSpell reqs.*/ width: 200px; } Getting and setting the data: Func GuiCtrlIERead() Return _IEPropertyGet($oTextArea, "innertext") EndFunc Func GuiCtrlIESet($string) _IEPropertySet($oTextArea, "innertext", $string) EndFunc The default text is stored in the HTML: <textarea id="ta2" class="textarea" style="border: 0px">Ths is a tst</textarea>
  4. I downloaded the most recent Autoit version at the church computer and started to write a little lyrics helper. I think I came across a problem when I got the point of replacing LineFeeds. Here's the code: ; Easy Worship Slides Helper #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <String.au3> #include <Array.au3> ; Global $CorrectCaseArray[12] = ["I", "You", "God", "Savior", "Saviour", "Lord", "Almighty", "Father", "Son", "Holy", "Spirit", "Jehovah"] ; Jehovah $hGUIMain = GUICreate("Form1", 433, 364, 192, 124) $EditMain = GUICtrlCreateEdit("", 8, 40, 409, 257) GUICtrlSetData(-1, "EditMain") $btnCorrectCapital = GUICtrlCreateButton("Correct Capitalization", 8, 312, 113, 33, $WS_GROUP) $btnSpelling = GUICtrlCreateButton("Spelling", 128, 312, 121, 33, $WS_GROUP) $inputLyric = GUICtrlCreateInput("Input1", 320, 312, 97, 21) $btnLyric = GUICtrlCreateButton("Lyric Find", 320, 336, 97, 21, $WS_GROUP) $lblInfo = GUICtrlCreateLabel("Use to help enter worship slides!!", 16, 8, 388, 25) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btnCorrectCapital WriteDataToUser(CorrectCapital(GUICtrlRead($EditMain))) EndSwitch WEnd func CorrectCapital($StringText) ; lower case it all $StringText = StringLower($StringText) ; Double linefeeds/ double spaces $StringText = StringRegExpReplace($StringText, "\n\s?\n\s?", @CRLF) ; correct single words $WordsArray = StringRegExp($StringText, "(\w*)\s?", 3) For $I = 0 to UBound($WordsArray) - 1 if $WordsArray[$I] <> "" and $WordsArray <> " " Then $index = _ArraySearch($CorrectCaseArray, StringStripWS($WordsArray[$I], 8)) if not @error Then $WordsArray[$I] = _StringProper($WordsArray[$I]) $StringText = StringReplace($StringText, $WordsArray[$I] & " ", $CorrectCaseArray[$index] & " ") $StringText = StringReplace($StringText, " " & $WordsArray[$I], " " & $CorrectCaseArray[$index]) Else $WordsArray[$I] = StringLower($WordsArray[$I]) EndIf EndIf Next ; bad characters for $I = 128 to 255 $StringText = StringRegExpReplace($StringText, Chr($I), "") Next for $I = 0 to 31 If $I <> 10 and $I <> 13 Then $StringText = StringRegExpReplace($StringText, Chr($I), "") ;MsgBox(0, $I, $StringText) EndIf Next return $StringText EndFunc func WriteDataToUser($String) GUICtrlSetData($EditMain, $String) EndFunc Enter anything in the edit control, put a few lines, and press the 'correct capitalization' button. You'll notice in the newest version of Autoit it doesn't display LF's right(ASCII 13), It displays them as '[]' boxes. I think it has to do with StringRegEx, because my regex tester on the church computer was returning a garbage-load of those 'unprintable' characters too. Before I submit a bug request, could I get someone to check this and make sure I'm not going insane?(MUST have the newest AU3). I would update here on my main computer to try, but I'd like to finish this up without hitting bugs. Thanks for the help! EDIT: To clarify, I am NOT having this issue under Autoit 3.3.6.1
  5. holy bologna! I've written a few little GDI examples and had fun with it... But this TOTALLY blows my mind. I had no idea you could get something like this through Autoit! 10 stars for sure.
  6. This DOES work. Let me explain Avati's post... When you see the AllocationBase in CE, it's FOR that memory section. So yes, they don't always match, but it doesn't matter, as this provides you with the one you need. If for some reason it doesn't return the right value(I've seen it twice in all the things I've hacked), edit the IV_start address or whatever it's called. Should be like 0x00100000, change it to 0x00500000. But as I said, that shouldn't be nescessary. If ANYONE is having problems reading the address, use my function http://www.autoitscript.com/forum/index.php?showtopic=99631 Sorry I've been gone for 5 months. So I having been on at all=)
  7. This is a great little UDF. But I'm having the same problem everyone else is. "The transport failed to connect to the server" FIXED - I updated to Jos's latest version (Had one that was a lot older) - I wasn't passing integers for the IP and SSL. =) Szh
  8. Yeah it is... #include <GUIConstants.au3> #Include <GuiListView.au3> #include <NomadMemory.au3> #include <Array.au3> ; $PID = WinGetProcess("InkBall") $OpenMem = _MemoryOpen($PID) ScanMemory($OpenMem, 2) Func _ScanReadableMemory($Handle) Local $StartMemory = Dec("00400000") Local $EndMemory = Dec("7FFFFFFF") Local $Address, $LastAddress, $Progress Local $Buffer = DllStructCreate('dword;dword;dword;dword;dword;dword;dword') Local $BufferScan2 = DllStructCreate('dword;dword;dword;dword;dword;dword;dword') Local $ReturnArray[1][2] $Address = '0x' & Hex($StartMemory) While 1 DllCall($Handle[0], 'int', 'VirtualQueryEx', 'int', $Handle[1], 'int', $Address, 'ptr', DllStructGetPtr($Buffer), 'int', DllStructGetSize($Buffer)) Local $BaseAddress = '0x' & Hex(DllStructGetData($Buffer, 1)); + 0) Local $AllocBase = '0x' & Hex(DllStructGetData($Buffer, 2)) Local $AllocProtect = Hex(DllStructGetData($Buffer, 3)) Local $RegionSize = DllStructGetData($Buffer, 4) Local $State = '0x' & Hex(DllStructGetData($Buffer, 5)) Local $Protect = Hex(DllStructGetData($Buffer, 6)) Local $Type = '0x' & Hex(DllStructGetData($Buffer, 7)) $LastAddress = $Address $Address = '0x' & Hex($BaseAddress + $RegionSize) If $Address = $LastAddress Then ExitLoop EndIf #cs Select Case $AllocProtect = 0x00 $AllocProtect = '' Case $AllocProtect = 0x01 $AllocProtect = 'No Access' Case $AllocProtect = 0x02 $AllocProtect = 'Read' Case $AllocProtect = 0x04 $AllocProtect = 'Read+Write' Case $AllocProtect = 0x08 $AllocProtect = 'Write-Copy' Case $AllocProtect = 0x10 $AllocProtect = 'Execute' Case $AllocProtect = 0x20 $AllocProtect = 'Exe-Read' Case $AllocProtect = 0x40 $AllocProtect = 'Exe-Read+Write' Case $AllocProtect = 0x80 $AllocProtect = 'Exe-Write-Copy' EndSelect Select Case $State = 0x1000 $State = 'Commit' Case $State = 0x2000 $State = 'Reserve' Case $State = 0x10000 $State = 'Free' EndSelect Select Case $Protect = 0x00 $Protect = '' Case $Protect = 0x01 $Protect = 'No Access' Case $Protect = 0x02 $Protect = 'Read' Case $Protect = 0x04 $Protect = 'Read+Write' Case $Protect = 0x08 $Protect = 'Write-Copy' Case $Protect = 0x10 $Protect = 'Execute' Case $Protect = 0x20 $Protect = 'Exe-Read' Case $Protect = 0x40 $Protect = 'Exe-Read+Write' Case $Protect = 0x80 $Protect = 'Exe-Write-Copy' EndSelect Select Case $Type = 0x20000 $Type = 'Private' Case $Type = 0x40000 $Type = 'Mapped' Case $Type = 0x1000000 $Type = 'Image' EndSelect #ce $AddressScan2 = "0x" & Hex(Dec(StringTrimLeft($BaseAddress, 2)) + $RegionSize) DllCall($Handle[0], 'int', 'VirtualQueryEx', 'int', $Handle[1], 'int', $AddressScan2, 'ptr', DllStructGetPtr($BufferScan2), 'int', DllStructGetSize($BufferScan2)) Local $AllocBase2 = '0x' & Hex(DllStructGetData($BufferScan2, 2)) Local $AllocProtect2 = Hex(DllStructGetData($BufferScan2, 3)) Local $State2 = '0x' & Hex(DllStructGetData($BufferScan2, 5)) Local $Protect2 = Hex(DllStructGetData($BufferScan2, 6)) ;First set If $AllocBase <> 0x0 And $State = 0x1000 And $RegionSize > 282624 Then If $AllocProtect <> 0 And $AllocProtect <> 0x1 Then If $Protect <> 0 And $Protect <> 0x1 Then ReDim $ReturnArray[UBound($ReturnArray) + 1][2] $ReturnArray[UBound($ReturnArray) - 1][0] = $BaseAddress $ReturnArray[UBound($ReturnArray) - 1][1] = Hex($RegionSize) EndIf EndIf EndIf If $BaseAddress < 0 Then $BaseAddress = 2147483648 + ($BaseAddress) + 2147483648 EndIf If ($BaseAddress + $RegionSize) >= $EndMemory Then ExitLoop EndIf WEnd Return $ReturnArray EndFunc Func ScanMemory($aOpenMemory, $vValue, $sType = 'dword') Local $ReturnAddressList[1][2] ; Get the scannable memory $aRet = _ScanReadableMemory($OpenMem) _ArrayDisplay($aRet) For $I = 1 To UBound($aRet) - 1 $StartMem = Dec(StringTrimLeft($aRet[$I][0], 2)) $EndMemory = $StartMem + Dec($aRet[$I][1]) $CurrentAddress = $StartMem ;MsgBox(0, "", Hex($StartMem) & "/" & Hex($EndMemory)) While $CurrentAddress <> $EndMemory If _MemoryRead("0x" & Hex($CurrentAddress), $aOpenMemory, $sType) = $vValue Then ReDim $ReturnAddressList[UBound($ReturnAddressList) + 1][2] $ReturnAddressList[UBound($ReturnAddressList) - 1][0] = "0x" & Hex($CurrentAddress) $ReturnAddressList[UBound($ReturnAddressList) - 1][0] = $vValue EndIf $CurrentAddress += 1 TrayTip("Address", "0x" & Hex($CurrentAddress), 15) WEnd _ArrayDisplay($ReturnAddressList) Next EndFunc This is still slow. But miles faster than what you have now. The problem is, AU3 isn't made to be the fastest programming language on the planet.
  9. Hey all Here is something I had written a long time ago. It worked but was VERY slow. I recently had a few ideas to improve it's speed and it seems to work very well on my pc. Well enough of that... Let's get onto the application Facebook Paint draws a 'clone' of the selelected image. The clone isn't an exact copy, it's more of an artistic spotted painting. Still makes a very cool effect. Setup Guide: *** Facebook paint by Szhlopp *** Graffiti Draw Application (Tested on Vista/IE7) Step 1) Create an image that is 510x270 (Graffiti canvas size). -Anything larger than 510x270 will be cutoff. -Whitespace is ignored. 0xFFFFFF is effectively transparent. Step 2) Color in the entire canvas with 0x000000 (Black) -The opacity MUST be 100% - Make sure the upper left corner is completely filled in with black Step 3) Run the program and place your mouse close the upper left part of the canvas, press F9 - Program auto-detects the borders based on the the least X,Y coordinate of black pixels. Step 4) Select an image to draw Step 5) While the image is being loaded into memory, sorted and being setup, Fill in the canvas with white - Opacity 100%, color 0xFFFFFF Step 6) Ready to start! '1' - Start the application '2' - Any point during the draw will cancel and quit the script *Few fast tips* - Make sure Facebook is the active window before you start ('1') - Make sure there aren't any other windows overlapping IE - This ONLY works if the graffiti paint window is full size (No scrollbars to move around the image. Don't draw from the 'home' page) - If the progran isn't detecting the black, make sure the opacity slider IS all the way to the right and that your color IS #000000 Enjoy! Script: #include <misc.au3> #include <GDIplus.au3> #include <color.au3> #include <Array.au3> ; Global $TopLeft[2] ; X Y Global $TopRight[2] Global $BottomLeft[2] Global $BottomRight[2] Global $ColorIcon[2] Global $PixelData[510 * 270]; Holds every pixel Global $EndOfPixel = 137699 Global $LastColor = 99999999999999999 Global $hWndWindow = 0 Global $MouseClickColor = 50; - 50 Global $MouseClickPaint = 85; Time the mouse is held down - 85 Global $PixelWidth = 6; - 6 Global $PixelAllow = 2000 ; Difference in pixel before change - 2000 ; 510x270 Opt("SendKeyDelay", 10) Opt("SendKeyDownDelay", 15) Opt("MouseClickDownDelay", $MouseClickPaint) Opt("MouseClickDelay", 25) $ExitLoop = 1 TrayTip("Mouse", "Press F9 to start auto-detect." & @CRLF & "(Please read the setup guide to get started.)", 30) While $ExitLoop = 1 Sleep(50) If _IsPressed(78) Then ; F9 $mousePos = MouseGetPos() If Not PixelGetColor($mousePos[0], $mousePos[1]) = 0 Then MsgBox(0, "Error", "Mouse is not over the upper left black pixel") Else Local $PixelCheck = 0 Local $X = $mousePos[0] Local $Y = $mousePos[1] ; Loop for X While $PixelCheck <> 16777215 $X -= 1 $PixelCheck = PixelGetColor($X, $Y) WEnd $X += 1 $TopLeft[0] = $X $PixelCheck = 0 ; Loop for Y While $PixelCheck <> 16777215 $Y -= 1 $PixelCheck = PixelGetColor($X, $Y) WEnd $Y += 1 $TopLeft[1] = $Y ; Sets other coordinates $TopRight[0] = $TopLeft[0] + 509 $TopRight[1] = $TopLeft[1] $BottomLeft[0] = $TopLeft[0] $BottomLeft[1] = $TopLeft[1] + 269 $BottomRight[0] = $TopRight[0] $BottomRight[1] = $BottomLeft[1] ;MsgBox(0, "", $TopLeft[0] & "," & $TopLeft[1] & "|" & $TopRight[0] & "," & $TopRight[1] & "|" & $BottomLeft[0] & "," & $BottomLeft[1] & "|" & $BottomRight[0] & "," & $BottomRight[1]) MouseMove($TopRight[0], $TopRight[1]) MouseMove($BottomRight[0], $BottomRight[1]) MouseMove($BottomLeft[0], $BottomLeft[1]) MouseMove($TopLeft[0], $TopLeft[1]) $ExitLoop = 0 EndIf While _IsPressed(78) Sleep(20) WEnd EndIf WEnd ; Set the color icon $ColorIcon[0] = $BottomLeft[0] + 98 $ColorIcon[1] = $BottomLeft[1] + 45 ;Color set _ChangeColorEx("FFFFFF") ;Get location TrayTip("Image", "Please select the image(Remember it HAS to be 510x270)", 30) $FOD = FileOpenDialog("Image", @DesktopDir, "JPG (*.jpg)", 3) If @error = 1 Then Exit EndIf $hMainGUI = GUICreate("Loading Data... Please wait", 510, 270, @DesktopWidth * .2, @DesktopHeight * .5) GUISetState(@SW_SHOW) TrayTip("Loading", "Loading image into memory. Please wait...", 15) ; Start GDI _GDIPlus_Startup() $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hMainGUI) $hImage = _GDIPlus_ImageLoadFromFile($FOD) $iImageWidth = _GDIPlus_ImageGetWidth($hImage) $iImageHeight = _GDIPlus_ImageGetHeight($hImage) _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, 0, 0, $iImageWidth, $iImageHeight) $dc = _GDIPlus_GraphicsGetDC($hGraphics) $dll = DllOpen("Gdi32.dll") ; Load into memory $PixelDataInt = 0 For $w = 0 To 510 - 1 For $h = 0 To 270 - 1 $temp = DllCall($dll, "int", "GetPixel", "ptr", $dc, "int", $w, "int", $h) $R = _ColorGetRed($temp[0]) $G = _ColorGetGreen($temp[0]) $B = _ColorGetBlue($temp[0]) $PixelData[$PixelDataInt] = Hex($R + 256 * $G + 256 * 256 * $B,6) & "~" & $w & "," & $h $PixelDataInt += 1 Next Next _GDIPlus_GraphicsReleaseDC($hGraphics, $dc) DllClose($dll) ; Hide GUI GUISetState(@SW_HIDE, $hMainGUI) ;Sort TrayTip("Sorting", "Started the pixel sort... Please wait", 30) _ArraySort($PixelData) ;Don't write FFFFFF TrayTip("Final process", "Setting the end point... Please wait", 30) For $I = 0 To UBound($PixelData) - 1 $SS = StringSplit($PixelData[$I], "~") If $SS[1] = "FFFFFF" Then $EndOfPixel = $I ExitLoop EndIf Next ;Ready TrayTip("Ready", "Ready to start. Press 1 when ready to begin, 2 to exit the app at any point. (Make sure facebook is the active window!)", 15) ;Wait to start While 1 Sleep(20) If _IsPressed(31) Then ; 1 Start While _IsPressed(31) Sleep(50) WEnd ;Width 3 MouseClick("Primary", $ColorIcon[0] + 50, $ColorIcon[1] - 10) ;Opacity set MouseClick("Primary", $ColorIcon[0] + 87, $ColorIcon[1] + 33) StartDrawEx() EndIf WEnd Func StartDrawEx() TrayTip("Starting", "Starting in 5 seconds...", 30) Sleep(5000) $Total = $EndOfPixel For $I = 0 To $EndOfPixel Step $PixelWidth If $PixelData[$I] <> "FFFFFF" Then $SS = StringSplit($PixelData[$I], "~") If $SS[0] = 2 Then $XY = StringSplit($SS[2], ",") ; Color difference $ColorDiff = Abs(Dec($LastColor) - Dec($SS[1])) If $ColorDiff > $PixelAllow Then ;Status TrayTip("", "", 1) TrayTip("Status", $I & "/" & $Total & " complete. " & Round($I / $Total, 4) * 100 & "%", 15) ;Color change _ChangeColorEx($SS[1]) EndIf ; Set the last color $LastColor = $SS[1] ;Paint it _PaintAtEx($XY[1], $XY[2]) If _IsPressed(32) Then ; 2 Stop Exit While _IsPressed(32) Sleep(50) WEnd EndIf EndIf EndIf Next EndFunc Func _ChangeColorEx($Color) $Mpos = MouseGetPos() $Wait = 1 While $Wait >= 1 And $Wait < 5 $Mposcheck = MouseGetPos() If $Mposcheck[0] = $Mpos[0] And $Mposcheck[1] = $Mpos[1] Then $Wait += 1 Else $Wait = 0 EndIf Sleep(100) WEnd Opt("MouseClickDownDelay", $MouseClickColor) Sleep(50) MouseClick("Primary", $ColorIcon[0], $ColorIcon[1], 1, 0) Sleep(200) Send("^A") Sleep(100) Send("{Backspace}") Sleep(100) Send($Color) Sleep(150) Send("{enter}") Sleep(50) Opt("MouseClickDownDelay", $MouseClickPaint) Return 0 EndFunc Func _PaintAtEx($x, $y) MouseMove($x + $TopLeft[0], $y + $TopLeft[1], 0) ;Sleep(15) MouseDown("Primary") Sleep($MouseClickPaint) MouseUp("Primary") EndFunc If anyone has improvements to the script feel free to post them here Szhlopp
  10. Care to further explain what it is you're trying to do? If you're trying to monitor the 'activity on my keyboard', then you won't get any help. That's what we call a 'Keylogger'. And they aren't accepted here. I can easily show you how to run notepad, type text in it, save a txt file or any other process mentioned above. But I don't know what it is exactly you want Szh
  11. Cool redesign. Here is my question on it, how are you going to scan the memory? I've written AU3 memory scanners using all the tweaks I can find to speed it up and it's still stupidly slow. It DOES return the same addresses CE does, so it works, but it's slow. If the point of redesigning it is to allow for further automation and implementation of CE, I would highly recommend putting work into... Making a scanner DLL. If someone who knew Delphi AND C++ could take the work that the CE team has already done and create a DLL from their source. It would allow projects like this and many other to even be possible. Thanks! Szh
  12. =) You use FF eh? Convert the script to use the firefox methods of what I do here. All it does it grab the HTML off of the page and use SRE to get the info I need. Here is the script, one more time with the error checking on the '$count' #include <IE.au3> #include <Array.au3> ; Global $Friends[1][2] ; Attach/Read $oIE = _IEAttach("facebook.com", "URL") $Text = _IEBodyReadHTML($oIE) ; Set count $Count = StringRegExp($Text, 'count\_num\>\(<STRONG>(.*?)\<', 1) If Not @error Then $Friends[0][0] = $Count[0] If $Friends[0][0] >=1 Then ; Get Name/Status $OnlineFriends = StringRegExp($Text, 'buddy\_list\_item\_name\_(\d*?)\>(.*?)\<', 3) For $I = 0 To UBound($OnlineFriends) - 1 Step 2 $Name = $OnlineFriends[$I + 1] $ID = $OnlineFriends[$I] ; Redim/Set Name ReDim $Friends[UBound($Friends) + 1][2] $Friends[UBound($Friends) - 1][0] = $Name ;Get Status $Status = StringRegExp($Text, $ID & '\s(?:.*?)\<A\sclass\=clearfix\stitle\=\"(.*?)onclick', 1) If Not @error Then $Friends[UBound($Friends) - 1][1] = StringTrimRight($Status[0], 2) EndIf Next EndIf _ArrayDisplay($Friends) If you still can't make it work with FireFox, send me a PM with whatever the '_FFGetHTML command' returns. I'll make sure my SRE patterns are returning right. Szh
  13. Here ya go man. I would put it in a function if I knew how you were going to use it... But this works. $Friends[0][0] = Count $Friends[n][0] = Name $Friends[n][1] = Status Don't know how this reacts when nobody is on, or how it reacts if you're offline. I just made it work >_< #include <IE.au3> #include <Array.au3> ; Global $Friends[1][2] ; Attach/Read $oIE = _IEAttach("facebook.com", "URL") $Text = _IEBodyReadHTML($oIE) ; Set count $Count = StringRegExp($Text, 'count\_num\>\(<STRONG>(.*?)\<', 1) $Friends[0][0] = $Count[0] If $Count >=1 Then ; Get Name/Status $OnlineFriends = StringRegExp($Text, 'buddy\_list\_item\_name\_(\d*?)\>(.*?)\<', 3) For $I = 0 To UBound($OnlineFriends) - 1 Step 2 $Name = $OnlineFriends[$I + 1] $ID = $OnlineFriends[$I] ; Redim/Set Name ReDim $Friends[UBound($Friends) + 1][2] $Friends[UBound($Friends) - 1][0] = $Name ;Get Status $Status = StringRegExp($Text, $ID & '\s(?:.*?)\<A\sclass\=clearfix\stitle\=\"(.*?)onclick', 1) If Not @error Then $Friends[UBound($Friends) - 1][1] = StringTrimRight($Status[0], 2) EndIf Next EndIf _ArrayDisplay($Friends) GL EDIT: Only gets names if 1 or more is on. Also fixed the status updates Szh
  14. Like this: #include <GuiTab.au3> ; Run("msconfig.exe") WinWait("System Configuration") Sleep(500) $hSysConfig = WinGetHandle("System Configuration") $hTab = ControlGetHandle($hSysConfig, "", "SysTabControl321") ;Click services _GUICtrlTab_ClickTab($hTab, 2) Sleep(50) ;Check the hide ControlCommand($hSysConfig, "", "Button3", "Check") Sleep(50) ;Disable all ControlClick($hSysConfig, "", "Button2") Sleep(50) ;Click startup _GUICtrlTab_ClickTab($hTab, 3) Sleep(50) ;Disable all ControlClick($hSysConfig, "", "Button2") Sleep(50) ; Apply ControlClick($hSysConfig, "", "Button22") Sleep(50)
×
×
  • Create New...