Author Topic: [autoit] help  (Read 1967 times)

0 Members and 4 Guests are viewing this topic.

Offline relax

  • Sir
  • ***
  • Posts: 562
  • Cookies: 114
  • The one and only
    • View Profile
[autoit] help
« on: November 16, 2012, 02:51:11 pm »
so the aoutoitscript.com is down and im doing a little script witch i have problem with
ps: started with autoit today so im a complete noob

i have a editbox
Code: [Select]
$txt = GUICtrlCreateEdit("",0,0,800,560)
i want to replace all spaces with . when the editbox is changed, so some sort of onchange function
tryed some scripts but it outbut backwards and displays wrong, so im doing somthing wrong

Code: [Select]
#include <GUIConstantsEx.au3>
Example()


Func Example()
    Local $font, $msg
    Global $txt

    GUICreate("Relax",950,595) ; will create a dialog box that when displayed is centered

    $font = "Tahoma"
    GUISetFont(12, 400, 1, $font) ; will display underlined characters
    $txt = GUICtrlCreateEdit("",0,0,800,560)
    $list = GUICtrlCreateList("",800,0,150,610)
    $save = GUICtrlCreateButton(" Save ",0,562)
    $exe = GUICtrlCreateButton(" Execute ",50,562)
    GUIRegisterMsg(0x0111, "MY_WM_COMMAND")
    GUISetState()
    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
EndFunc   ;==>Example

Func MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $nID
    $nID = BitAND($wParam, 0x0000FFFF)
    if $nID = 3 Then
        $orgtext = ControlGetText("Relax","",3)
        $newtext = StringReplace(ControlGetText("Relax","",3)," ", ".")

        $mystring=ControlGetText("Relax","",3)
        MsgBox(0,"",$mystring)
$reverse_string = ""
$string_length = StringLen($mystring)

For $i = 1 to $string_length
   $last_n_chrs = StringRight($mystring, $i)
   $nth_chr = StringTrimRight($last_n_chrs, $i-1)
   $reverse_string= $reverse_string & $nth_chr
Next


        ControlSetText("Relax","",3,$reverse_string)
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc   ;==>MY_WM_COMMAND

if anyone have an ebook or something that would help also
thanks

« Last Edit: November 16, 2012, 02:53:35 pm by relax »

Offline geXXos

  • Royal Highness
  • ****
  • Posts: 646
  • Cookies: 178
    • View Profile
Re: [autoit] help
« Reply #1 on: November 16, 2012, 03:26:39 pm »
Yeap, the site is under maintance. Here are 2 good resources

http://upload.evilzone.org/download.php?id=9041884&type=rar  Learning to Script with AutoIt V3
http://upload.evilzone.org/download.php?id=6986865&type=rar   Autoit_123

Look also in the help file for StringReplace() StringRegExpReplace


A small snippet


Code: [Select]
#notrayicon
$input = FileOpen("c:\relax.txt", 0)
$output = FileOpen("c:\relax.tmp", 2)
;Check if the files were opened successfully.
If $input = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
If $output = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
;Parse the text beginning with a HUID
While 1
    $inline = FileReadLine($input)
    If @error Then ExitLoop
    If StringInStr($inline, "H8") Then
        FileWriteLine($output, StringRegExpReplace($inline, "(\s+)". "."))
    EndIf
WEnd
FileClose($input)
FileClose($output)

Offline relax

  • Sir
  • ***
  • Posts: 562
  • Cookies: 114
  • The one and only
    • View Profile
Re: [autoit] help
« Reply #2 on: November 16, 2012, 03:44:50 pm »
Yeap, the site is under maintance. Here are 2 good resources

http://upload.evilzone.org/download.php?id=9041884&type=rar  Learning to Script with AutoIt V3
http://upload.evilzone.org/download.php?id=6986865&type=rar   Autoit_123

Look also in the help file for StringReplace() StringRegExpReplace


A small snippet


Code: [Select]
#notrayicon
$input = FileOpen("c:\relax.txt", 0)
$output = FileOpen("c:\relax.tmp", 2)
;Check if the files were opened successfully.
If $input = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
If $output = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
;Parse the text beginning with a HUID
While 1
    $inline = FileReadLine($input)
    If @error Then ExitLoop
    If StringInStr($inline, "H8") Then
        FileWriteLine($output, StringRegExpReplace($inline, "(\s+)". "."))
    EndIf
WEnd
FileClose($input)
FileClose($output)

thanks again geXXos, i did search for autoit in ebooks and dident find anything tho a was sure i had seen it before, must have made som mistake.

Offline geXXos

  • Royal Highness
  • ****
  • Posts: 646
  • Cookies: 178
    • View Profile
Re: [autoit] help
« Reply #3 on: November 16, 2012, 04:00:04 pm »
There is another one from O'Reilly,but no so good as the one i provided above.
Here it is: AutoIt v3 your quick guide
 
http://upload.evilzone.org/download.php?id=8287810&type=rar

Offline iTpHo3NiX

  • EZ's Pirate Captain
  • Administrator
  • Titan
  • *
  • Posts: 2920
  • Cookies: 328
    • View Profile
    • EvilZone
Re: [autoit] help
« Reply #4 on: November 16, 2012, 06:18:44 pm »
I like autoit... although I need to get back to it... Its nice and easy to get some basic functions done with a GUI my main scripting language bitch is batch xD
[09:27] (+lenoch) iTpHo3NiX can even manipulate me to suck dick
[09:27] (+lenoch) oh no that's voluntary
[09:27] (+lenoch) sorry

Offline geXXos

  • Royal Highness
  • ****
  • Posts: 646
  • Cookies: 178
    • View Profile
Re: [autoit] help
« Reply #5 on: November 16, 2012, 08:49:59 pm »
AutoIt is very useful and an experienced coder can create some nice stuff,but i'm fed up with the fact that even a simple script gets flagged as a trojan.