Jump to content

Cooltext Client


Recommended Posts

Here is my script

;===============================================================================
;
; Program Name: CoolText Client
; Description:: Uses www.cooltext.com to generate images
; Requirement(s):  AutoIt
; Author(s):       RazerM
;
;===============================================================================
;

#include <GUIConstants.au3>
#include <IE.au3>

GUICreate("CoolText Client", 600, 500)
;style
GUICtrlCreateLabel("Style:", 10, 13)
$style = GUICtrlCreateCombo("3D Outline Gradient", 60, 10, 130)
$styles = "3D Outline Textured|Alien Glow|Animated Glow|Blended|Bovinated|Burning|Carved|Chalk|Chrome One|Chrome Two|Comic" & _
"|Cool Metal|Crystal|Cutout|Felt|Fire|Glossy|Glowing Hot|Glowing Steel|Gradient Bevel|Neon|Nova|Old Stone|Outline|Simple|Slab|Starburst|Textured"
GUICtrlSetData($style, $styles)

;text
GUICtrlCreateLabel("Text:", 200, 13)
$text = GUICtrlCreateInput("", 230, 10, 350)

;text size
GUICtrlCreateLabel("Text Size:", 10, 43)
$textsize = GUICtrlCreateInput(70, 60, 40, 65)

;File format
GUICtrlCreateLabel("File Format:", 170, 43)
$format = GUICtrlCreateCombo("", 230, 40, 240)
GUICtrlSetData($format, ".GIF|.GIF with Transparency|.GIF with Transparency, No Dither|.JPG|.PNG|.PNG with Transparency (Not supported in IE)|.PSD (Photoshop with Layers)", ".PNG")

;render button
$render = GUICtrlCreateButton("Render", 10, 440, 80, 25)
GUISetState()
;~ _Render()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $render
            $file = GUICtrlRead($format)
            If $file = ".GIF" Then $fileformat = 1
            If $file = ".GIF with Transparency" Then $fileformat = 2
            If $file = ".GIF with Transparency, No Dither" Then $fileformat = 3
            If $file = ".JPG" Then $fileformat = 4
            If $file = ".PNG" Then $fileformat = 5
            If $file = ".PNG with Transparency (Not supported in IE)" Then $fileformat = 6
            If $file = ".PSD (Photoshop with Layers)" Then $fileformat = 7
            _Render(GUICtrlRead($style), GUICtrlRead($text), GUICtrlRead($textsize), $fileformat)
;~      Case 
;~      Case 
;~      Case 
    EndSwitch
WEnd

Func _Render($style, $s_text, $i_size, $i_file)
; open IE
    $ie = _IECreate();NOTE Set to 0 for program's 'desired' result but IE is blocking download
;navigate to cooltext
    _IENavigate($ie, "http://www.cooltext.com", 1)
;two if statements to fix style bug
    If $style = "Textured" Then _IEClickImg($ie, $style, "alt", 1, 1)
    If $style <> "Textured" Then _IEClickImg($ie, $style, "alt", 0, 1)
;retrieve form
    $form = _IEFormGetObjByIndex($ie, 0)
;retrieve text field
    $text = _IEFormElementGetObjByName($form, "Text")
;set value
    _IEFormElementSetValue($text, $s_text)
;retrieve fontsize field
    $size = _IEFormElementGetObjByName($form, "FontSize")
;setvalue
    _IEFormElementSetValue($size, $i_size)
;retrieve file format field
    $fileformat = _IEFormElementGetObjByName($form, "FileFormat")
;set value
    _IEFormElementSetValue($fileformat, $i_file)
;click render button using loop (i had trouble using other ways)
    $Inputs = _IETagNameGetCollection($form.document, "input")
    For $Input in $Inputs
        If String($Input.value) = "Render Logo Design" Then 
            $Input.click
            ExitLoop
        EndIf
    Next
;keep clicking every 4 seconds until download box appears
    Do
    _IEClickLinkByText($ie, "Download Image", 0, 0)
    Sleep(4000)
    Until WinActive("File Download")
EndFunc

IE blocks the click on Download Image so if IE is hidden the user cannot click 'download file' in the pop up bar

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

why not just try and see if theres a way to get the image and not even have to both with clicking the download file, and just get the image urself and have something pop up saying file created complete or something

and with running it sumtimes it doesnt even click the image cuz it takes a lil while for it to load.. so id say have it navigate to instead

http://cooltext.com/LogoEdit.aspx?Style=(style goes here with out spaces)

by the way is animated alien glow :think:

just download the image got this from dales examples in IE

#include <IE.au3>

$sImgDir = "c:\foo\"; Please make certain this folder already exists (silent failure if not)
$sWebPage = "http://www.autoitscript.com/forum/index.php?"; webpage with images

$oIE = _IECreate()
_IENavigate($oIE, $sWebPage)
$oIMGs = _IETagNameGetCollection($oIE.document, "img")

; Loop through all IMG tags and save file to local directory using INetGet
For $oIMG in $oIMGs
    $sImgUrl = $oIMG.src
    $sImgFileName = $oIMG.nameProp
    INetGet($sImgUrl,  $sImgDir & $sImgFileName)
Next
Edited by thatsgreat2345
Link to comment
Share on other sites

I have it working, i am finishing up a few things right now.

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Ah, I was going to suggest to do something like this:

Do
    Sleep(2000)
    $page_source = _IEBodyReadHTML ($ie)
    $img_url = StringRegExp($page_source, '(http://.*?/rendered/.*?\..{3})', 1)
    $img_name = StringRegExp($page_source, '(?:http://.*?/rendered/)(.*?\..{3})', 1)
Until IsArray($img_url) = 1
InetGet($img_url[0], @ScriptDir & "\" & $img_name[0])

Have it get the source, and parse that source for the download link. Then, if there is a download link do an InetGet on it, with the appropriate file name.

Untested. Grats on getting it to work.

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

i thought it was pretty cool also... and thought of parsing the url

this works... just a bit longer because i just added functions from welcome to autoit 123

;===============================================================================
;
; Program Name: CoolText Client
; Description:: Uses www.cooltext.com to generate images
; Requirement(s):  AutoIt
; Author(s):       RazerM
;
;===============================================================================
;

#include <GUIConstants.au3>
#include <IE.au3>

Dim $ie, $file, $Found

GUICreate("CoolText Client", 600, 500)
;style
GUICtrlCreateLabel("Style:", 10, 13)
$style = GUICtrlCreateCombo("3D Outline Gradient", 60, 10, 130)
$styles = "3D Outline Textured|Alien Glow|Animated Glow|Blended|Bovinated|Burning|Carved|Chalk|Chrome One|Chrome Two|Comic" & _
"|Cool Metal|Crystal|Cutout|Felt|Fire|Glossy|Glowing Hot|Glowing Steel|Gradient Bevel|Neon|Nova|Old Stone|Outline|Simple|Slab|Starburst|Textured"
GUICtrlSetData($style, $styles)

;text
GUICtrlCreateLabel("Text:", 200, 13)
$text = GUICtrlCreateInput("Valuater", 230, 10, 350)

;text size
GUICtrlCreateLabel("Text Size:", 10, 43)
$textsize = GUICtrlCreateInput(70, 60, 40, 65)

;File format
GUICtrlCreateLabel("File Format:", 170, 43)
$format = GUICtrlCreateCombo("", 230, 40, 240)
GUICtrlSetData($format, ".GIF|.GIF with Transparency|.GIF with Transparency, No Dither|.JPG|.PNG|.PNG with Transparency (Not supported in IE)|.PSD (Photoshop with Layers)", ".PNG")

;render button
$render = GUICtrlCreateButton("Render", 10, 440, 80, 25)
GUISetState()
;~ _Render()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $render
            $file = GUICtrlRead($format)
            If $file = ".GIF" Then $fileformat = 1
            If $file = ".GIF with Transparency" Then $fileformat = 2
            If $file = ".GIF with Transparency, No Dither" Then $fileformat = 3
            If $file = ".JPG" Then $fileformat = 4
            If $file = ".PNG" Then $fileformat = 5
            If $file = ".PNG with Transparency (Not supported in IE)" Then $fileformat = 6
            If $file = ".PSD (Photoshop with Layers)" Then $fileformat = 7
            _Render(GUICtrlRead($style), GUICtrlRead($text), GUICtrlRead($textsize), $fileformat)
;~       Case
;~       Case
;~       Case
    EndSwitch
WEnd

Func _Render($style, $s_text, $i_size, $i_file)
; open IE
    $ie = _IECreate();NOTE Set to 0 for program's 'desired' result but IE is blocking download
;navigate to cooltext
    _IENavigate($ie, "http://www.cooltext.com", 1)
;two if statements to fix style bug
    If $style = "Textured" Then _IEClickImg($ie, $style, "alt", 1, 1)
    If $style <> "Textured" Then _IEClickImg($ie, $style, "alt", 0, 1)
;retrieve form
    $form = _IEFormGetObjByIndex($ie, 0)
;retrieve text field
    $text = _IEFormElementGetObjByName($form, "Text")
;set value
    _IEFormElementSetValue($text, $s_text)
;retrieve fontsize field
    $size = _IEFormElementGetObjByName($form, "FontSize")
;setvalue
    _IEFormElementSetValue($size, $i_size)
;retrieve file format field
    $fileformat = _IEFormElementGetObjByName($form, "FileFormat")
;set value
    _IEFormElementSetValue($fileformat, $i_file)
;click render button using loop (i had trouble using other ways)
    $Inputs = _IETagNameGetCollection($form.document, "input")
    For $Input in $Inputs
        If String($Input.value) = "Render Logo Design" Then
            $Input.click
            ExitLoop
        EndIf
    Next
;keep clicking every 4 seconds until download box appears
     _IELoadWait($ie)
     Sleep(7000)
    
    _IEClickLinkByText($ie, "Download Image", 0, 0)
    Sleep(3000)
    Get_Loc()
    Sleep(2000)
    $web_loc = $Found & (StringLower($file))
    MsgBox(0,0, $web_loc)

    InetGet( $web_loc, "test" & $file)

    Run(@ComSpec & " /c Start " & "test" & $file, "", @SW_HIDE)
    
EndFunc


Func Get_Loc()
    
; demonstration to find chracters that change between to standard points
; or just find a string
;#include <IE.au3>

#Region --- IE-Builder generated code Start ---

;$oIE = _IECreate ()

;------------- User input --------------
;_IENavigate ($oIE, "http://www.autoitscript.com/"); web address
$Find = '<P><IMG src="'; my info shows after this line... or just find this line
$Before = $file; my info shows before this line... or set as ""
; ------------ End User input -------------
Sleep(1000)
$body =  _IEBodyReadHTML ($ie)
$sloc = @TempDir & "\stest.txt"
FileDelete($sloc)
FileWrite($sloc, $body)
$sfile = FileOpen($sloc, 0)
$num = 0
While 2
    $num = $num + 1
    $sline = FileReadLine($sfile, $num)
    If @error Then
        MsgBox(262208, "Fail", "The string was NOT found   ")
        FileClose($sfile)
        Exit
    EndIf
    If StringInStr($sline, $Find) Then
        MsgBox(64, "Success", "The string " & $Find & " was found   " & @CRLF & " on line # " & $num, 5)
        If $Before = "" Then ExitLoop
        $Found = stringbetween($sline, $Find, $Before)
        MsgBox(64, "Found", "The string is " & $Found & "   ", 5)
        Return $Found
        ExitLoop
    EndIf
WEnd

EndFunc

Func stringbetween($str, $start, $end)
    $pos = StringInStr($str, $start)
    If Not @error Then
        $str = StringTrimLeft($str, $pos + StringLen($start) - 1)
        $pos = StringInStr($str, $end)
        If Not @error Then
            $str = StringTrimRight($str, StringLen($str) - $pos + 1)
            Return $str
        EndIf
    EndIf
EndFunc  ;==>stringbetween

#EndRegion --- IE-Builder generated code End ---

8)

NEWHeader1.png

Link to comment
Share on other sites

Ok here is what i have come up with. For some reason if there is a space in the text input AutoIt throws an error

;===============================================================================
;
; Program Name: CoolText Client
; Description:: Uses www.cooltext.com to generate images
; Requirement(s):  AutoIt
; Author(s):       RazerM
;
;===============================================================================
;

#include <GUIConstants.au3>
#include <IE.au3>
#include <GuiCombo.au3>
#include <file.au3>
GUICreate("CoolText Client", 600, 500)
$error = ObjEvent("AutoIt.Error","Err")
;style
GUICtrlCreateLabel("Style:", 10, 13)
$style = GUICtrlCreateCombo("3D Outline Gradient", 60, 10, 130)
$styles = "3D Outline Textured|Alien Glow|Animated Glow|Blended|Bovinated|Burning|Carved|Chalk|Chrome One|Chrome Two|Comic" & _
"|Cool Metal|Crystal|Cutout|Felt|Fire|Glossy|Glowing Hot|Glowing Steel|Gradient Bevel|Neon|Nova|Old Stone|Outline|Simple|Slab|Starburst|Textured"
GUICtrlSetData($style, $styles)

;text
GUICtrlCreateLabel("Text:", 200, 13)
$text = GUICtrlCreateInput("", 230, 10, 350)

;text size
GUICtrlCreateLabel("Text Size:", 10, 43)
$textsize = GUICtrlCreateInput(70, 60, 40, 65)

;File format
GUICtrlCreateLabel("File Format:", 170, 43)
$format = GUICtrlCreateCombo("", 230, 40, 240)
GUICtrlSetData($format, ".GIF|.GIF with Transparency|.GIF with Transparency, No Dither|.JPG|.PNG|.PNG with Transparency (Not supported in IE)|.PSD (Photoshop with Layers)", ".PNG")

;render button
$render = GUICtrlCreateButton("Render", 10, 440, 80, 25)
GUISetState()
;~ _Render()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $render
            _Render(GUICtrlRead($style), GUICtrlRead($text), GUICtrlRead($textsize), _GUICtrlComboGetCurSel($format)+1)
;~      Case 
;~      Case 
;~      Case 
    EndSwitch
WEnd

Func _Render($style, $s_text, $i_size, $i_file)
; open IE
    $ie = _IECreate(0);NOTE Set to 0 for program's 'desired' result but IE is blocking download
;navigate to cooltext
    _IENavigate($ie, "http://www.cooltext.com", 1)
;two if statements to fix style bug
    If $style = "Textured" Then _IEClickImg($ie, $style, "alt", 1, 1)
    If $style <> "Textured" Then _IEClickImg($ie, $style, "alt", 0, 1)
;retrieve form
    $form = _IEFormGetObjByIndex($ie, 0)
;retrieve text field
    $text = _IEFormElementGetObjByName($form, "Text")
;set value
    _IEFormElementSetValue($text, $s_text)
;retrieve fontsize field
    $size = _IEFormElementGetObjByName($form, "FontSize")
;setvalue
    _IEFormElementSetValue($size, $i_size)
;retrieve file format field
    $fileformat = _IEFormElementGetObjByName($form, "FileFormat")
;set value
    _IEFormElementSetValue($fileformat, $i_file)
;click render button using loop (i had trouble using other ways)
    $Inputs = _IETagNameGetCollection($form.document, "input")
    For $Input in $Inputs
        If String($Input.value) = "Render Logo Design" Then 
            $Input.click
            ExitLoop
        EndIf
    Next
;wait for render
    Do
        Sleep(100)
    Until _IEGetProperty($ie, "locationname") = "Cool Text: Generated Image"
;split url to find image code
    $url = _IEGetProperty($ie, "locationurl")
    $code = StringRight($url, 8)
;extension
    $ext = StringLeft(GUICtrlRead($format), 4)
;download image
    $imgs = _IETagNameGetCollection($ie.document, "img")
    $save = FileSaveDialog("Save Image", @DesktopCommonDir, "Image Files (*" & $ext & ")", 16)
    Local $szDrive, $szDir, $szFName, $szExt
    $a_SplitFile = _PathSplit($save, $szDrive, $szDir, $szFName, $szExt);0 based array
    For $img In $imgs
        $url = $img.src
        $imgfile = $img.nameProp
        If StringInStr($url, $code) And StringInStr($imgfile, "cooltext") Then
            INetGet($url, $a_SplitFile[1] & $a_SplitFile[2] & $imgfile, 1, 0);only if the image has the code in it's name
            ExitLoop
        EndIf
    Next
    MsgBox(0,0,$a_SplitFile[1] & $a_SplitFile[2] & $imgfile)
    _FileRename($a_SplitFile[1] & $a_SplitFile[2] & $imgfile, $a_SplitFile[3])
EndFunc

;these are made by me
Func _FileRename($s_file, $s_name)
    If Not FileExists($s_file) Then Return 0
    Local $szDrive, $szDir, $szFName, $szExt
    $a_SplitFile = _PathSplit($s_file, $szDrive, $szDir, $szFName, $szExt)
    $s_renamed = $a_SplitFile[1] & $a_SplitFile[2] & $s_name & $a_SplitFile[4]
    If Not FileMove($a_SplitFile[0], $s_renamed) Then Return 0
    If Not FileExists($s_renamed) Then Return 0
    If FileExists($s_file) Then FileDelete($s_file)
    Return 1
EndFunc

Func Err()
    MsgBox(48, "Error", "An error occurred" & @LF & "Please try again")
EndFunc

The exact error is:

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "C:\Documents and Settings\FrazerMcLean\My Documents\AutoIt\cooltext\gui2.au3" /autoit3dir "C:\Program Files\AutoIt3\beta" /UserParams  
>Running AU3Check (1.54.1.1)  params:  from:C:\Program Files\AutoIt3\beta
+>AU3Check ended.rc:0
>Running:(3.1.1.121):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Documents and Settings\FrazerMcLean\My Documents\AutoIt\cooltext\gui2.au3"   
1C:\Program Files\AutoIt3\beta\Include\IE.au3 (848) : ==> Missing right bracket ')' in exp[b][/b]ression.: 
If IsObj($o_object.elements.item($s_name, $i_index)) Then 
If IsObj(^ ERROR
+>AutoIT3.exe ended.rc:0
>Exit code: 0   Time: 277.024

it seems to think there is a missing bracket? I have no idea why this happens

Edited by RazerM
My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Ok, I fixed the StringRegExp I made for you earlier, tested it.. and it works.

I also did a text with a space in it, "RazerM Rules". Worked like a charm.

;===============================================================================
;
; Program Name: CoolText Client
; Description:: Uses www.cooltext.com to generate images
; Requirement(s):  AutoIt
; Author(s):       RazerM
;
;===============================================================================
;

#include <GUIConstants.au3>
#include <IE.au3>

GUICreate("CoolText Client", 600, 500)
;style
GUICtrlCreateLabel("Style:", 10, 13)
$style = GUICtrlCreateCombo("3D Outline Gradient", 60, 10, 130)
$styles = "3D Outline Textured|Alien Glow|Animated Glow|Blended|Bovinated|Burning|Carved|Chalk|Chrome One|Chrome Two|Comic" & _
"|Cool Metal|Crystal|Cutout|Felt|Fire|Glossy|Glowing Hot|Glowing Steel|Gradient Bevel|Neon|Nova|Old Stone|Outline|Simple|Slab|Starburst|Textured"
GUICtrlSetData($style, $styles)

;text
GUICtrlCreateLabel("Text:", 200, 13)
$text = GUICtrlCreateInput("", 230, 10, 350)

;text size
GUICtrlCreateLabel("Text Size:", 10, 43)
$textsize = GUICtrlCreateInput(70, 60, 40, 65)

;File format
GUICtrlCreateLabel("File Format:", 170, 43)
$format = GUICtrlCreateCombo("", 230, 40, 240)
GUICtrlSetData($format, ".GIF|.GIF with Transparency|.GIF with Transparency, No Dither|.JPG|.PNG|.PNG with Transparency (Not supported in IE)|.PSD (Photoshop with Layers)", ".PNG")

;render button
$render = GUICtrlCreateButton("Render", 10, 440, 80, 25)
GUISetState()
;~ _Render()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $render
            $file = GUICtrlRead($format)
            If $file = ".GIF" Then $fileformat = 1
            If $file = ".GIF with Transparency" Then $fileformat = 2
            If $file = ".GIF with Transparency, No Dither" Then $fileformat = 3
            If $file = ".JPG" Then $fileformat = 4
            If $file = ".PNG" Then $fileformat = 5
            If $file = ".PNG with Transparency (Not supported in IE)" Then $fileformat = 6
            If $file = ".PSD (Photoshop with Layers)" Then $fileformat = 7
            _Render(GUICtrlRead($style), GUICtrlRead($text), GUICtrlRead($textsize), $fileformat)
;~       Case
;~       Case
;~       Case
    EndSwitch
WEnd

Func _Render($style, $s_text, $i_size, $i_file)
; open IE
    $ie = _IECreate();NOTE Set to 0 for program's 'desired' result but IE is blocking download
;navigate to cooltext
    _IENavigate($ie, "http://www.cooltext.com", 1)
;two if statements to fix style bug
    If $style = "Textured" Then _IEClickImg($ie, $style, "alt", 1, 1)
    If $style <> "Textured" Then _IEClickImg($ie, $style, "alt", 0, 1)
;retrieve form
    $form = _IEFormGetObjByIndex($ie, 0)
;retrieve text field
    $text = _IEFormElementGetObjByName($form, "Text")
;set value
    _IEFormElementSetValue($text, $s_text)
;retrieve fontsize field
    $size = _IEFormElementGetObjByName($form, "FontSize")
;setvalue
    _IEFormElementSetValue($size, $i_size)
;retrieve file format field
    $fileformat = _IEFormElementGetObjByName($form, "FileFormat")
;set value
    _IEFormElementSetValue($fileformat, $i_file)
;click render button using loop (i had trouble using other ways)
    $Inputs = _IETagNameGetCollection($form.document, "input")
    For $Input in $Inputs
        If String($Input.value) = "Render Logo Design" Then
            $Input.click
            ExitLoop
        EndIf
    Next
;keep clicking every 4 seconds until download box appears
  Do
    Sleep(2000)
    $page_source = _IEBodyReadHTML ($ie)
    $img_url = StringRegExp($page_source, '(?:border=1><BR><FONT size=2><A href=")(http://.*?/d.php\?renderid=[:digit:]*?&amp;extension=.{3})(?:">Download Image</A>)', 1)
    $img_name = StringRegExp($page_source, '(?:border=1><BR><FONT size=2><A href=")(?:http://.*?/d.php\?renderid=)([:digit:]*?)(?:&amp;extension=)(.{3})(?:">Download Image</A>)', 1)
Until IsArray($img_url) = 1
$img_url[0] = StringReplace($img_url[0],"&amp;","&")
InetGet($img_url[0], @ScriptDir & "\" & $img_name[0]&"."&$img_name[1])
MsgBox(0,"Testing Purposes", "Image Downloaded in Script Dir")
EndFunc

EDIT: Note: $img_url[0] contains the url of the image to be downloaded. $img_name[0] is the number of the image for its name, $img_name[1] is its extension.

Edited by Simucal
AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

@Simucal

Your script just hangs for me

I am still getting the space error with my script, could you check to see if you get an error with it.

I also sometimes get the error without using a space in the text input. I am using AutoIt beta 3.1.1.121.

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Yours gives me a series of popup errors, but no error out.. then it works.

I edited mine so it works how you have yours setup with a Save As dialog. It works for me without problems.

;===============================================================================
;
; Program Name: CoolText Client
; Description:: Uses www.cooltext.com to generate images
; Requirement(s):  AutoIt
; Author(s):       RazerM
;
;===============================================================================
;

#include <GUIConstants.au3>
#include <IE.au3>

GUICreate("CoolText Client", 600, 500)
;style
GUICtrlCreateLabel("Style:", 10, 13)
$style = GUICtrlCreateCombo("3D Outline Gradient", 60, 10, 130)
$styles = "3D Outline Textured|Alien Glow|Animated Glow|Blended|Bovinated|Burning|Carved|Chalk|Chrome One|Chrome Two|Comic" & _
        "|Cool Metal|Crystal|Cutout|Felt|Fire|Glossy|Glowing Hot|Glowing Steel|Gradient Bevel|Neon|Nova|Old Stone|Outline|Simple|Slab|Starburst|Textured"
GUICtrlSetData($style, $styles)

;text
GUICtrlCreateLabel("Text:", 200, 13)
$text = GUICtrlCreateInput("", 230, 10, 350)

;text size
GUICtrlCreateLabel("Text Size:", 10, 43)
$textsize = GUICtrlCreateInput(70, 60, 40, 65)

;File format
GUICtrlCreateLabel("File Format:", 170, 43)
$format = GUICtrlCreateCombo("", 230, 40, 240)
GUICtrlSetData($format, ".GIF|.GIF with Transparency|.GIF with Transparency, No Dither|.JPG|.PNG|.PNG with Transparency (Not supported in IE)|.PSD (Photoshop with Layers)", ".PNG")

;render button
$render = GUICtrlCreateButton("Render", 10, 440, 80, 25)
GUISetState()
;~ _Render()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $render
            $file = GUICtrlRead($format)
            If $file = ".GIF" Then $fileformat = 1
            If $file = ".GIF with Transparency" Then $fileformat = 2
            If $file = ".GIF with Transparency, No Dither" Then $fileformat = 3
            If $file = ".JPG" Then $fileformat = 4
            If $file = ".PNG" Then $fileformat = 5
            If $file = ".PNG with Transparency (Not supported in IE)" Then $fileformat = 6
            If $file = ".PSD (Photoshop with Layers)" Then $fileformat = 7
            _Render(GUICtrlRead($style), GUICtrlRead($text), GUICtrlRead($textsize), $fileformat)
;~       Case
;~       Case
;~       Case
    EndSwitch
WEnd

Func _Render($style, $s_text, $i_size, $i_file)
; open IE
    $ie = _IECreate (0);NOTE Set to 0 for program's 'desired' result but IE is blocking download
    _IELoadWait ($ie, 500)
;navigate to cooltext
    _IENavigate ($ie, "http://www.cooltext.com", 1)
;two if statements to fix style bug
    If $style = "Textured" Then _IEClickImg ($ie, $style, "alt", 1, 1)
    If $style <> "Textured" Then _IEClickImg ($ie, $style, "alt", 0, 1)
;retrieve form
    $form = _IEFormGetObjByIndex ($ie, 0)
;retrieve text field
    $text = _IEFormElementGetObjByName ($form, "Text")
;set value
    _IEFormElementSetValue ($text, $s_text)
;retrieve fontsize field
    $size = _IEFormElementGetObjByName ($form, "FontSize")
;setvalue
    _IEFormElementSetValue ($size, $i_size)
;retrieve file format field
    $fileformat = _IEFormElementGetObjByName ($form, "FileFormat")
;set value
    _IEFormElementSetValue ($fileformat, $i_file)
;click render button using loop (i had trouble using other ways)
    $Inputs = _IETagNameGetCollection ($form.document, "input")
    For $Input in $Inputs
        If String($Input.value) = "Render Logo Design" Then
            $Input.click
            ExitLoop
        EndIf
    Next
;keep checking source every 2 seconds for a download link.
    Do
        Sleep(2000)
        $page_source = _IEBodyReadHTML ($ie)
        $img_url = StringRegExp($page_source, '(?:border=1><BR><FONT size=2><A href=")(http://.*?/d.php\?renderid=[:digit:]*?&amp;extension=.{3})(?:">Download Image</A>)', 1)
    Until IsArray($img_url) = 1
    $ext = StringRight($img_url[0], 3)
    $img_url[0] = StringReplace($img_url[0], "&amp;", "&")
    $save = FileSaveDialog("Save Image", @DesktopCommonDir, "Image Files (*" & $ext & ")", 16)
    InetGet($img_url[0], $save & "." & $ext)
EndFunc ;==>_Render

EDIT: I'm using the latest BETA, just an FYI

Edited by Simucal
AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

I have reinstalled Scite and AutoIt beta. I no longer get the error. I also noticed the method i am using won't work with the psd file so I have removed it. I have fixed another bug when overwriting files.

;===============================================================================
;
; Program Name: CoolText Client
; Description:: Uses www.cooltext.com to generate images
; Requirement(s):  AutoIt Beta
; Author(s):       RazerM
;
;===============================================================================
;

#include <GUIConstants.au3>
#include <IE.au3>
#include <GuiCombo.au3>
#include <file.au3>
GUICreate("CoolText Client", 600, 500)
$error = ObjEvent("AutoIt.Error","Err")
;style
GUICtrlCreateLabel("Style:", 10, 13)
$style = GUICtrlCreateCombo("3D Outline Gradient", 60, 10, 130)
$styles = "3D Outline Textured|Alien Glow|Animated Glow|Blended|Bovinated|Burning|Carved|Chalk|Chrome One|Chrome Two|Comic" & _
"|Cool Metal|Crystal|Cutout|Felt|Fire|Glossy|Glowing Hot|Glowing Steel|Gradient Bevel|Neon|Nova|Old Stone|Outline|Simple|Slab|Starburst|Textured"
GUICtrlSetData($style, $styles)

;text
GUICtrlCreateLabel("Text:", 200, 13)
$text = GUICtrlCreateInput("", 230, 10, 350)

;text size
GUICtrlCreateLabel("Text Size:", 10, 43)
$textsize = GUICtrlCreateInput(70, 60, 40, 65)

;File format
GUICtrlCreateLabel("File Format:", 170, 43)
$format = GUICtrlCreateCombo("", 230, 40, 240)
GUICtrlSetData($format, ".GIF|.GIF with Transparency|.GIF with Transparency, No Dither|.JPG|.PNG|.PNG with Transparency (Not supported in IE)", ".PNG");|.PSD (Photoshop with Layers)", ".PNG")

;render button
$render = GUICtrlCreateButton("Render", 10, 440, 80, 25)
GUISetState()
;~ _Render()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $render
            _Render(GUICtrlRead($style), GUICtrlRead($text), GUICtrlRead($textsize), _GUICtrlComboGetCurSel($format)+1)
;~      Case 
;~      Case 
;~      Case 
    EndSwitch
WEnd

Func _Render($style, $s_text, $i_size, $i_file)
; open IE
    $ie = _IECreate(0);NOTE Set to 0 for program's 'desired' result but IE is blocking download
;navigate to cooltext
    _IENavigate($ie, "http://www.cooltext.com", 1)
;two if statements to fix style bug
    If $style = "Textured" Then _IEClickImg($ie, $style, "alt", 1, 1)
    If $style <> "Textured" Then _IEClickImg($ie, $style, "alt", 0, 1)
;retrieve form
    $form = _IEFormGetObjByIndex($ie, 0)
;retrieve text field
    $text = _IEFormElementGetObjByName($form, "Text")
;set value
    _IEFormElementSetValue($text, $s_text)
;retrieve fontsize field
    $size = _IEFormElementGetObjByName($form, "FontSize")
;setvalue
    _IEFormElementSetValue($size, $i_size)
;retrieve file format field
    $fileformat = _IEFormElementGetObjByName($form, "FileFormat")
;set value
    _IEFormElementSetValue($fileformat, $i_file)
;click render button using loop (i had trouble using other ways)
    $Inputs = _IETagNameGetCollection($form.document, "input")
    For $Input in $Inputs
        If String($Input.value) = "Render Logo Design" Then 
            $Input.click
            ExitLoop
        EndIf
    Next
;wait for render
    Do
        Sleep(100)
    Until _IEGetProperty($ie, "locationname") = "Cool Text: Generated Image"
;split url to find image code
    $url = _IEGetProperty($ie, "locationurl")
    $code = StringRight($url, 8)
;extension
    $ext = StringLeft(GUICtrlRead($format), 4)
;download image
    $imgs = _IETagNameGetCollection($ie.document, "img")
    $save = FileSaveDialog("Save Image", @DesktopCommonDir, "Image Files (*" & $ext & ")", 16)
    If FileExists($save) Then FileDelete($save)
    Local $szDrive, $szDir, $szFName, $szExt
    $a_SplitFile = _PathSplit($save, $szDrive, $szDir, $szFName, $szExt);0 based array
    For $img In $imgs
        $url = $img.src
        $imgfile = $img.nameProp
        If StringInStr($url, $code) And StringInStr($imgfile, "cooltext") Then
            INetGet($url, $a_SplitFile[1] & $a_SplitFile[2] & $imgfile, 1, 0);only if the image has the code in it's name
            ExitLoop
        EndIf
    Next
    _FileRename($a_SplitFile[1] & $a_SplitFile[2] & $imgfile, $a_SplitFile[3])
EndFunc

;these are made by me
Func _FileRename($s_file, $s_name)
    If Not FileExists($s_file) Then Return 0
    Local $szDrive, $szDir, $szFName, $szExt
    $a_SplitFile = _PathSplit($s_file, $szDrive, $szDir, $szFName, $szExt)
    $s_renamed = $a_SplitFile[1] & $a_SplitFile[2] & $s_name & $a_SplitFile[4]
    If Not FileMove($a_SplitFile[0], $s_renamed) Then Return 0
    If Not FileExists($s_renamed) Then Return 0
    If FileExists($s_file) Then FileDelete($s_file)
    Return 1
EndFunc

Func Err()
    MsgBox(48, "Error", "An error occurred" & @LF & "Please try again")
EndFunc
I am going to post it in Scripts and Scraps now. Thanks for your help guys.

Edited by RazerM
My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...