Floppy Posted August 18, 2009 Share Posted August 18, 2009 (edited) Hi, what I'm trying to create is a program to automatize the registration on a website. The problem in this website is there's a captcha that should be typed in an inputbox to prevent bots. My idea is to create a GUI with the captcha image and an inputbox where user should type the captcha. The registration page is: http://oknotizie.virgilio.it/register.html.php I tried getting captcha image with _IEImgGetCollection, but it gets the PHP captcha generator script address. Browsing the forum I found this script that work great. #include <IE.au3> #include <Clipboard.au3> #include <GDIPlus.au3> #Include <Memory.au3> $oIE = _IECreate('http://oknotizie.virgilio.it/register.html.php') $oImg = _IEImgGetCollection($oIE, 0) $oRange = $oIE.document.Body.CreateControlRange() $oRange.Add($oImg) $oRange.ExecCommand('Copy') $hImage = _ClipBoard_GetData($CF_BITMAP) _GDIPlus_Startup() $oBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hImage) $nHeight = _GDIPlus_ImageGetHeight($oBitmap) $nWidth = _GDIPlus_ImageGetWidth($oBitmap) $Gui = GUICreate('IE Image', $nWidth, $nHeight, 250, 250) GUISetState() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($Gui) _GDIPlus_GraphicsDrawImage($hGraphic, $oBitmap, 0, 0) Sleep(5000) _GDIPlus_ImageDispose($oBitmap) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() The problem is that puts the image into Clipboard and the previously datas in Clipboard are deleted. My question is: Is there a different way to get the same captcha showed on the web page? Or, is there a way to not copy the image into Clipboard? Thanks for help in advance! >_< Edited August 18, 2009 by FSoft Link to comment Share on other sites More sharing options...
WolfWorld Posted August 18, 2009 Share Posted August 18, 2009 $sOldClipBoardData = ClipGet() ClipPut("Your Image") Do something with the Image ClipPut($sOldClipBoardData) Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! Link to comment Share on other sites More sharing options...
Floppy Posted August 18, 2009 Author Share Posted August 18, 2009 I though at that solution, but the problem is: "If in that moment the user paste to Clipboard...?" Is there a way to don't put the image into Clipboard? Link to comment Share on other sites More sharing options...
BrettF Posted August 18, 2009 Share Posted August 18, 2009 Please see: http://www.autoitscript.com/forum/index.php?showtopic=29053. I'm not sure if there is an elegant way to be honest. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Floppy Posted August 18, 2009 Author Share Posted August 18, 2009 I've the same problem of my solution. It downloads the php script and not the image. Any solution? Link to comment Share on other sites More sharing options...
Floppy Posted August 19, 2009 Author Share Posted August 19, 2009 Solutions??? Link to comment Share on other sites More sharing options...
WolfWorld Posted August 19, 2009 Share Posted August 19, 2009 ask yourself $sOldClipBoardData = ClipGet() ClipPut("Your Image") Do something with the Image ClipPut($sOldClipBoardData) How long will Do something with the Image takes? Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! Link to comment Share on other sites More sharing options...
Floppy Posted August 19, 2009 Author Share Posted August 19, 2009 (edited) Yes, but think if the user in that moment copy or paste something!?! All fails... The thing I don't understand is: Why is needed to put the image to Clipboard and then pick it again? Edited August 19, 2009 by FSoft Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now