Jump to content

Click4u


peethebee
 Share

Recommended Posts

Hi!

This tool is able to react on almost ANY window to appear. It can send then keystrokes or mouse clicks, it can activate controls or manipulate the controls texts, it can run a exe file (e.g. a compiled script with additional functions) or it can just log the appearance of the window.

All these featrues are quite stable in the actual version. You can get it via my fileman (please make sure to download the newest one as there are mostly more then one version online). The complete source code is included. Perhaps it is a good idea for a little bit more advanced coders to have a quick look at it to see some useful techniques to work with windows.

"busysignal" is using this tool in daily life at the moment and "Analritter" ran it too. "busysignal" is kind of happy with it, I think :( .

Of course you can post your own feature requests here and I will see if I can implement them.

I hope you like my work, and I appreciate any kind of reaction to it,

peethebee

Original initial post:

Hi!

I'm at the moment developping a tool that's able to press any button in a given dialog or window.

Features:

- Send keystroke

- Send mousclick

- write log

- run proggy

would you like that?

I developped about 50% so far. could post it, if interest is toooo big ;-)

peethebee

Edited by peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

  • Replies 110
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi!

Here's the code for you, guys!

I thought about adding this (universal translation) to the script later on.

Here the code now:

1.: The scan engine

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.1
; Author:        peethebee <peter_opali@gmx.de>
;
; Script Function:
;   Clicks buttons for you automatically!
;
; ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <GUIConstants.au3>
#Include <date.au3>


HotKeySet("!^a", "show_add_Window")
HotKeySet("!^s", "show_settings")
HotKeySet("!^q", "Quit")
HotKeySet("!^w", "active")


Global $active
$active = 1

; Language modifications take place here:

; english
$lang_program_name = 'Click4u "chip-Edition" ' 
$lang_program_version = "1.1" 
$lang_welcome_text = "The following things are now possible:" & @CRLF & @CRLF & "Ctrl + Alt + S: program options" & @CRLF & "Ctrl + Alt + A: New action with actual window" & @CRLF & "Ctrl + Alt + W: (De)aktivieren" & @CRLF & "Ctrl + Alt + Q: Quit"
$lang_GUI_win_title = "Fenstertitel des aktiven Fensters:" 
$lang_GUI_win_text = "Fenstertext des aktiven Fensters:" 
$lang_add_new_target_window = "Neues Zielfenster" 
$lang_add_new_target_window_button = "Fenster merken" 
$lang_input_titlemode_title = "WinTitleMatchMode" 
$lang_input_titlemode_prompt = "Please specifie comparison modefor win titles and texts" & @CRLF & "1 = given text is begin of title/text" & @CRLF & "2 = given text is anywhere in title/text" & @CRLF & "3 = given text is exactly title/text" & @CRLF & "4 = extended mode (experts only)" 
$lang_input_titlemode_default = "3" 
$lang_input_action_type_title = "please choose action of " & $lang_program_name & "" 
$lang_input_action_type_default = "K" 
$lang_input_action_letter_keystroke = "K" 
$lang_input_action_letter_mouse = "M" 
$lang_input_action_letter_log = "L" 
$lang_input_action_letter_run = "R" 
$lang_input_action_type_prompt = "key press (" & $lang_input_action_letter_keystroke & ")," & @CRLF & "mouse click (" & $lang_input_action_letter_mouse & ")," & @CRLF & "logging (" & $lang_input_action_letter_log & ") oder" & @CRLF & "run program (" & $lang_input_action_letter_run & ")" 
$lang_input_action_key_title = "send keystroke" 
$lang_input_action_key_prompt = "Order of keys to send (AutoIt's format, see help!):" 
$lang_input_action_key_default = "{ENTER}" 
$lang_input_action_mouse_title = "Send mouse click" 
$lang_input_action_mouse_prompt = "Position of the mouse click (Press Strg + Alt + Y for aktual mouse pos):" 
$lang_input_action_mouse_default = "210,243"
$lang_input_action_log_title = "Write log file entry" 
$lang_input_action_log_prompt = "Give the text that shall be logged with win title and name and date and time:" 
$lang_input_action_log_default = "Fenster aufgetaucht" 
$lang_input_action_run_title = "Run program" 
$lang_input_action_run_prompt = "Give the program's path:" 
$lang_input_action_run_default = "notepad" 
$lang_error = "Error" 
$lang_error_at_file_open = "Error at file opening!"
$lang_quit_text = "is closed..." 
$lang_deactive_title = $lang_program_name & "is now inaktive"
$lang_deactive_text = "Reaktivate by pressing Alt + Ctrl + W!" 
$lang_reactive_title = $lang_program_name & "is now active"
$lang_reactive_text = "Deactivate by pressing Alt + Ctrl + W!"
$lang_make_immediately_active_input_title = "Activate action?"
$lang_make_immediately_active_input_text = "Is the script ought to scan for the win immediately (Y/N)?"
$lang_make_immediately_active_input_default = "Y"


;Willkommensgruß
TrayTip($lang_program_name & $lang_program_version, $lang_welcome_text, 5)


;GUI vorproduzieren
$var_act_win_title = WinGetTitle("")
$var_act_win_text = WinGetText("")

; GUI erstellen; Build GUI
$GUI_win_add_target = GUICreate($lang_program_name & $lang_program_version, 229, 294, (@DesktopWidth - 229) / 2, (@DesktopHeight - 294) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUI_Label_1 = GUICtrlCreateLabel($lang_GUI_win_title, 20, 60, 160, 20)
$GUI_Input_2 = GUICtrlCreateInput($var_act_win_title, 20, 80, 190, 20)
$GUI_Label_3 = GUICtrlCreateLabel($lang_GUI_win_text, 20, 110, 160, 20)
$GUI_Edit_4 = GUICtrlCreateEdit($var_act_win_text, 20, 130, 190, 75)
$GUI_Label_5 = GUICtrlCreateLabel($lang_add_new_target_window, 20, 10, 160, 20)
GUICtrlSetFont($GUI_Label_5, 12)
$GUI_Button_6 = GUICtrlCreateButton($lang_add_new_target_window_button, 20, 240, 190, 30)

GUISetState(@SW_HIDE)




; Willkommenstip weg
Sleep(5000)
TrayTip("", "", 3)


While 1
    If $active = 1 Then ClickIt()
    
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
            $active = 1
            GUISetState(@SW_HIDE)           
        Case $msg = $GUI_Button_6
            GUISetState(@SW_HIDE)           
            $var_act_win_title = GUICtrlRead($GUI_Input_2)          
            $var_act_win_text = GUICtrlRead($GUI_Edit_4)
            $var_act_win_text = StringReplace($var_act_win_text,@CRLF,"%BR%")
            $var_act_win_text = StringReplace($var_act_win_text,@LF,"")
            $var_act_win_text = StringReplace($var_act_win_text,@CR,"")
       ;MsgBox(0, $var_act_win_text, $var_act_win_text)
            
            $var_wintitlematchmode = InputBox($lang_input_titlemode_title, $lang_input_titlemode_prompt, $lang_input_titlemode_default)
            $var_action_typ = InputBox($lang_input_action_type_title, $lang_input_action_type_prompt, $lang_input_action_type_default)
            Select
                Case $var_action_typ = $lang_input_action_letter_keystroke
                    $var_action = InputBox($lang_input_action_key_title, $lang_input_action_key_prompt, $lang_input_action_key_default)
                Case $var_action_typ = $lang_input_action_letter_mouse
                    Run(@ScriptDir & "\MousePos.exe")
                    $var_action = InputBox($lang_input_action_mouse_title, $lang_input_action_mouse_prompt, $lang_input_action_mouse_default)                   
                    Send("!^{ESC}")
                Case $var_action_typ = $lang_input_action_letter_log
                    $var_action = InputBox($lang_input_action_log_title, $lang_input_action_log_prompt, $lang_input_action_log_default)
                Case $var_action_typ = $lang_input_action_letter_run
                    $var_action = InputBox($lang_input_action_run_title, $lang_input_action_run_prompt, $lang_input_action_run_default)
            EndSelect
            $var_window_number = IniRead(@ScriptDir & "\settings.ini", "NumWin", "number", "error")
            If $var_window_number = "error"  Then
                IniWrite(@ScriptDir & "\settings.ini", "NumWin", "number", "0")
                $var_window_number = 0
            EndIf
       ;Daten schreiben
            IniWrite(@ScriptDir & "\settings.ini", "NumWin", "number", $var_window_number + 1)
            IniWrite(@ScriptDir & "\settings.ini", $var_window_number + 1, "Title", $var_act_win_title)
            IniWrite(@ScriptDir & "\settings.ini", $var_window_number + 1, "Text", $var_act_win_text)
            IniWrite(@ScriptDir & "\settings.ini", $var_window_number + 1, "MatchMode", $var_wintitlematchmode)
            IniWrite(@ScriptDir & "\settings.ini", $var_window_number + 1, "ActionType", $var_action_typ)
            IniWrite(@ScriptDir & "\settings.ini", $var_window_number + 1, "Action", $var_action)
            
            $aktiv = InputBox($lang_make_immediately_active_input_title, $lang_make_immediately_active_input_text, $lang_make_immediately_active_input_default)
            If $aktiv = $lang_make_immediately_active_input_default Then $active = 1
    EndSelect
WEnd


Func show_add_Window()
    $var_act_win_title = WinGetTitle("")
    $var_act_win_text = WinGetText("")  
    $var_act_win_text = StringTrimRight($var_act_win_text,1)
    $var_act_win_text_edit = StringReplace($var_act_win_text,@LF,@CRLF)
; Zusätzliche Merkmale hgerausfinden?; get additional things about the window?
    
    GUICtrlSetData($GUI_Input_2, $var_act_win_title)
    GUICtrlSetData($GUI_Edit_4, $var_act_win_text_edit)
        
    GUISetState(@SW_SHOW)
    
    $active = 0
EndFunc ;==>show_add_Window




Func ClickIt()
    $var_waittime = IniRead(@ScriptDir & "\settings.ini", "Settings", "WaitTime", 500)
    $var_window_number = IniRead(@ScriptDir & "\settings.ini", "NumWin", "number", "error")
    If Not $var_window_number = "error"  Then
        For $i = 1 To $var_window_number Step 1
       ; Variablen einlesen
            $var_wintitlematchmode = IniRead(@ScriptDir & "\settings.ini", $i, "MatchMode", 3)
            $var_win_title = IniRead(@ScriptDir & "\settings.ini", $i, "Title", "Error reading Title...")
            $var_win_text = IniRead(@ScriptDir & "\settings.ini", $i, "Text", "Error reading Text...")
            $var_win_text = StringReplace($var_win_text, "%BR%", @CRLF)
            
       ;DEBUG:
       ;TrayTip("Fenstertext ausgelesen:", $var_win_text, 10)
            
            $var_action_type = IniRead(@ScriptDir & "\settings.ini", $i, "ActionType", "")
            $var_action = IniRead(@ScriptDir & "\settings.ini", $i, "Action", "")
       ; MatchMode setzen
            Opt ("WinTitleMatchMode", $var_wintitlematchmode)
       ; Fenster suchen
            If WinExists($var_win_title, $var_win_text) Then
           ; Fenster gefunden, ab geht die Post
                WinActivate($var_win_title, $var_win_text)
                Sleep($var_waittime)
                Select
                    Case $var_action_type = $lang_input_action_letter_keystroke
                        Send($var_action, 0)
                    Case $var_action_type = $lang_input_action_letter_mouse
                        $var_pos = StringSplit($var_action, ",")
                        MouseClick("left", $var_pos[1], $var_pos[2], 1, 1)
                    Case $var_action_type = $lang_input_action_letter_log
                        $file = FileOpen(@ScriptDir & "\log.txt", 1)
                        
                        If $file = -1 Then
                            MsgBox(0, $lang_error, $lang_error_at_file_open)
                        Else
                            FileWriteLine($file, _Now() & ":  -> " & $var_action & " <-  (" & $var_win_title & " --- " & $var_win_text & ")")
                        EndIf
                        
                        FileClose($file)
                        
                    Case $var_action_type = $lang_input_action_letter_run
                        Run(@ComSpec & " /c Start " & $var_action)
                EndSelect
            EndIf
        Next
    EndIf
EndFunc ;==>ClickIt


Func show_settings()    
    Run(@ScriptDir & "\Click4uSet.exe")
EndFunc ;==>show_settings



Func Quit()
    TrayTip($lang_program_name & $lang_program_version, $lang_quit_text, 4)
    Sleep(3000)
    Exit
EndFunc ;==>Quit

Func active()
    If $active = 1 Then 
        $active = 0
        TrayTip($lang_deactive_title, $lang_deactive_text, 3)
        sleep(2500)
        TrayTip("", "", 0)
    Else 
        $active = 1
        TrayTip($lang_reactive_title, $lang_reactive_text, 3)
        sleep(2500)
        TrayTip("", "", 0)
    EndIf
EndFunc ;==>active

2. The settings proggy:

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.1
; Author:        peethebee <peter_opali@gmx.de>
;
; Script Function:
;~; Clicks buttons for you automatically!  Settings program
;
; ----------------------------------------------------------------------------

; Script Start - Add your code below here

;License:
; It is not allowed to print this script in a magazine or pack it on CD without the permission of the author!

#include <GUIConstants.au3>
#include <file.au3>
#include <Array.au3>


$lang_program_name = 'Click4u "chip-Edition" ' 
$lang_program_version = "1.1" 
$lang_link_program_name = "Click4u" 

;english
$lang_error = "Error!" 
$lang_error_at_file_open = "Log file coulf not be opened!" 
$lang_autorun_user = "autorun only for this user" 
$lang_autorun_all_users = "autorun for all users" 
$lang_disable_autorun = "no autorun" 
$lang_apply_settings = "save settings" 
$lang_wait_time = "Time to wait bevor action (in ms):" 
$lang_settings_title = "settings" 
$lang_general_settings = "general settings" 
$lang_target_settings = "window" 
$lang_delete_request_title = "delete item" 
$lang_delete_request_text = "Do you really want to delete this one?" 
$lang_listview_title = "Nr.|window title  |window text  "
$lang_title_title = "Change title"
$lang_title_text = "New title:"
$lang_text_title = "Change text"
$lang_text_text = "New text (%BR% for line break):"
$lang_input_titlemode_title = "WinTitleMatchMode" 
$lang_input_titlemode_prompt = "Please specifie comparison modefor win titles and texts" & @CRLF & "1 = given text is begin of title/text" & @CRLF & "2 = given text is anywhere in title/text" & @CRLF & "3 = given text is exactly title/text" & @CRLF & "4 = extended mode (experts only)" 
$lang_input_titlemode_default = "3" 
$lang_input_action_type_title = "please choose action of " & $lang_program_name & "" 
$lang_input_action_type_default = "K" 
$lang_input_action_letter_keystroke = "K" 
$lang_input_action_letter_mouse = "M" 
$lang_input_action_letter_log = "L" 
$lang_input_action_letter_run = "R" 
$lang_input_action_type_prompt = "key press (" & $lang_input_action_letter_keystroke & ")," & @CRLF & "mouse click (" & $lang_input_action_letter_mouse & ")," & @CRLF & "logging (" & $lang_input_action_letter_log & ") oder" & @CRLF & "run program (" & $lang_input_action_letter_run & ")" 
$lang_input_action_key_title = "send keystroke" 
$lang_input_action_key_prompt = "Order of keys to send (AutoIt's format, see help!):" 
$lang_input_action_mouse_title = "Send mouse click" 
$lang_input_action_mouse_prompt = "Position of the mouse click (Press Ctrl + Alt + Y for aktual mouse pos):" 
$lang_input_action_log_title = "Write log file entry" 
$lang_input_action_log_prompt = "Give the text that shall be logged with win title and name and date and time:" 
$lang_input_action_run_title = "Run program" 
$lang_input_action_run_prompt = "Give the program's path:" 


Dim $GUI_item[1]


; Settings GUI
$GUI_win_settings = GUICreate($lang_program_name & $lang_program_version, 283, 323, (@DesktopWidth - 283) / 2, (@DesktopHeight - 323) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$GUI_Label_8 = GUICtrlCreateLabel($lang_settings_title, 20, 10, 160, 20)
GUICtrlSetFont($GUI_Label_8, 12)

$GUI_tab = GUICtrlCreateTab(20, 40, 250, 230)
$GUI_tab_1 = GUICtrlCreateTabItem($lang_general_settings)
$GUI_auto_1 = GUICtrlCreateButton($lang_autorun_user, 30, 80, 230, 20)
$GUI_auto_2 = GUICtrlCreateButton($lang_autorun_all_users, 30, 100, 230, 20)
$GUI_auto_3 = GUICtrlCreateButton($lang_disable_autorun, 30, 120, 230, 20)
$GUI_Label_5 = GUICtrlCreateLabel($lang_wait_time, 30, 175, 300, 20)
$GUI_Input_6 = GUICtrlCreateInput("5000", 30, 195, 70, 20)
; SCHEINT SONST DURCH! $GUI_Spin_7 = GUICtrlCreateUpdown($GUI_Input_6, $UDS_ARROWKEYS & $UDS_NOTHOUSANDS)
;#cs zunächst deaktiviert, da noch nicht fertig:
$GUI_tab_2 = GUICtrlCreateTabItem($lang_target_settings)
$GUI_listview = GUICtrlCreateListView($lang_listview_title, 30, 80, 225, 155);, $LVS_SORTDESCENDING)
;Items einlesen
$var_win_count = IniRead(@ScriptDir & "\settings.ini", "NumWin", "number", "error")
If $var_win_count = "error"  Then
    IniWrite(@ScriptDir & "\settings.ini", "NumWin", "number", "0")
    $var_win_count = 0
EndIf

Fill_listview()

;Buttons
$GUI_list_button_new = GUICtrlCreateButton("Neu", 30, 240, 60, 20)
$GUI_list_button_edit = GUICtrlCreateButton("Bearbeiten", 90, 240, 60, 20)
$GUI_list_button_delete = GUICtrlCreateButton("Löschen", 150, 240, 60, 20)
$GUI_list_button_up = GUICtrlCreateButton("^", 215, 240, 20, 20)
$GUI_list_button_down = GUICtrlCreateButton("v", 235, 240, 20, 20)
;#ce
GUICtrlCreateTabItem("")

$GUI_Button_4 = GUICtrlCreateButton($lang_apply_settings, 150, 300, 130, 20, $BS_DEFPUSHBUTTON)

$var_temp = IniRead(@ScriptDir & "\settings.ini", "Settings", "WaitTime", 1001)
If $var_temp = 1001 Then
    IniWrite(@ScriptDir & "\settings.ini", "Settings", "WaitTime", "1000")
    $var_temp = 1000
EndIf
GUICtrlSetData($GUI_Input_6, $var_temp)


GUISetState()



While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
            
        Case $msg = $GUI_Button_4
            Exit
            
        Case $msg = $GUI_auto_1
            If FileExists(@StartupCommonDir & "\" & $lang_link_program_name & ".lnk") Then
                FileDelete(@StartupCommonDir & "\" & $lang_link_program_name & ".lnk")
            EndIf
            If Not FileExists(@StartupDir & "\" & $lang_link_program_name & ".lnk") Then
                FileCreateShortcut(@ScriptDir & "\Click4u.exe", @StartupDir & "\" & $lang_link_program_name & ".lnk", @ScriptDir, "", "Startet das Tool Click4u, das für Sie Dialogfenster wegklickt")
            EndIf
            
        Case $msg = $GUI_auto_2
            If FileExists(@StartupDir & "\" & $lang_link_program_name & ".lnk") Then
                FileDelete(@StartupDir & "\" & $lang_link_program_name & ".lnk")
            EndIf
            If Not FileExists(@StartupCommonDir & "\" & $lang_link_program_name & ".lnk") Then
                FileCreateShortcut(@ScriptDir & "\Click4u.exe", @StartupCommonDir & "\" & $lang_link_program_name & ".lnk", @ScriptDir, "", "Startet das Tool Click4u, das für Sie Dialogfenster wegklickt")
            EndIf
            
        Case $msg = $GUI_auto_3
            If FileExists(@StartupCommonDir & "\" & $lang_link_program_name & ".lnk") Then
                FileDelete(@StartupCommonDir & "\" & $lang_link_program_name & ".lnk")
            EndIf
            If FileExists(@StartupDir & "\" & $lang_link_program_name & ".lnk") Then
                FileDelete(@StartupDir & "\" & $lang_link_program_name & ".lnk")
            EndIf
            
        Case $msg = $GUI_list_button_up
       ; Debug:  ToolTip($item1_id)
            $var_list_id = GUICtrlRead($GUI_listview)
            If $var_list_id <> $item1_id Then
                Tausche_in_ini($var_list_id - $item1_id + 1, $var_list_id - $item1_id, 1)
           ;GUICtrlSetData($GUI_listview, $var_list_id - 1) evtl. im Forum fragen (Eintrag markieren!)!
            Else
                Tausche_in_ini(1, $var_win_count, 1)
           ;GUICtrlSetData($GUI_listview, $item1_id + $var_win_count)
            EndIf
            
        Case $msg = $GUI_list_button_down
       ; Debug:  ToolTip($item1_id)
            $var_list_id = GUICtrlRead($GUI_listview)
            If $var_list_id <> $item1_id + $var_win_count - 1 Then
                Tausche_in_ini($var_list_id - $item1_id + 1, $var_list_id - $item1_id + 2, 1)
           ;GUICtrlSetData($GUI_listview, $var_list_id + 1)
            Else
                Tausche_in_ini(1, $var_win_count, 1)
           ;GUICtrlSetData($GUI_listview, $item1_id)
            EndIf
            
        Case $msg = $GUI_list_button_new
            WinSetState("", "", @SW_HIDE)
            Send("!^a")
            Exit
            
        Case $msg = $GUI_list_button_delete
            $var_list_id = GUICtrlRead($GUI_listview) - $item1_id + 1
            If MsgBox(4, $lang_delete_request_title, $lang_delete_request_text) = 6 Then
                IniDelete(@ScriptDir & "\settings.ini", $var_list_id)
                For $r = $var_list_id + 1 To $var_win_count
                    Tausche_in_ini($r, $r - 1, 0)
                Next
                $var_win_count = $var_win_count - 1
                IniWrite(@ScriptDir & "\settings.ini", "NumWin", "number", $var_win_count)
                Fill_listview()
            EndIf
            
        Case $msg = $GUI_list_button_edit
            $var_id = GUICtrlRead($GUI_listview) - $item1_id + 1
            
            $var_wintitlematchmode = IniRead(@ScriptDir & "\settings.ini", $var_id, "MatchMode", 3)
            $var_win_title = IniRead(@ScriptDir & "\settings.ini", $var_id, "Title", "Error reading Title...")
            $var_win_text = IniRead(@ScriptDir & "\settings.ini", $var_id, "Text", "Error reading Text...")
            $var_action_type = IniRead(@ScriptDir & "\settings.ini", $var_id, "ActionType", "")
            $var_action = IniRead(@ScriptDir & "\settings.ini", $var_id, "Action", "")
            
            $var_act_win_title = InputBox($lang_title_title, $lang_title_text, $var_win_title)
            $var_act_win_text = InputBox($lang_text_title, $lang_text_text, $var_win_text)
            $var_win_text = StringReplace($var_win_text, "%BR%", @CRLF)
                        
            $var_wintitlematchmode = InputBox($lang_input_titlemode_title, $lang_input_titlemode_prompt, $var_wintitlematchmode)
            $var_action_typ = InputBox($lang_input_action_type_title, $lang_input_action_type_prompt, $var_action_type)
            Select
                Case $var_action_typ = $lang_input_action_letter_keystroke
                    $var_action = InputBox($lang_input_action_key_title, $lang_input_action_key_prompt, $var_action)
                Case $var_action_typ = $lang_input_action_letter_mouse
                    Run(@ScriptDir & "\MousePos.exe")
                    $var_action = InputBox($lang_input_action_mouse_title, $lang_input_action_mouse_prompt, $var_action)                    
                    Send("!^{ESC}")
                Case $var_action_typ = $lang_input_action_letter_log
                    $var_action = InputBox($lang_input_action_log_title, $lang_input_action_log_prompt, $var_action)
                Case $var_action_typ = $lang_input_action_letter_run
                    $var_action = InputBox($lang_input_action_run_title, $lang_input_action_run_prompt, $var_action)
            EndSelect
                        
       ;Daten schreiben
            IniWrite(@ScriptDir & "\settings.ini", $var_id, "Title", $var_act_win_title)
            IniWrite(@ScriptDir & "\settings.ini", $var_id, "Text", $var_act_win_text)
            IniWrite(@ScriptDir & "\settings.ini", $var_id, "MatchMode", $var_wintitlematchmode)
            IniWrite(@ScriptDir & "\settings.ini", $var_id, "ActionType", $var_action_typ)
            IniWrite(@ScriptDir & "\settings.ini", $var_id, "Action", $var_action)          
            
            Fill_listview()
    EndSelect
WEnd



Func Tausche_in_ini($a, $b, $fill)
    Dim $datei
    _FileReadToArray(@ScriptDir & "\Settings.ini", $datei)
    
    Local $j
    For $j = 1 To $datei[0]
        $datei[$j] = StringReplace($datei[$j], "[" & $a & "]", "[TEMP]")
        $datei[$j] = StringReplace($datei[$j], "[" & $b & "]", "[" & $a & "]")
        $datei[$j] = StringReplace($datei[$j], "[TEMP]", "[" & $b & "]")
    Next
    
    _FileSaveToArray (@ScriptDir & "\Settings.ini", $datei)
    
    If $fill = 1 Then Fill_listview()
EndFunc ;==>Tausche_in_ini


Func Fill_listview()
    Global $item1_id
    
    If UBound($GUI_item) <> 1 Then
        For $i = 1 To UBound($GUI_item) - 1
            GUICtrlDelete($GUI_item[$i])
        Next
    EndIf
    
    ReDim $GUI_item[1]
    For $i = 1 To $var_win_count
        $var_title = IniRead(@ScriptDir & "\settings.ini", $i, "Title", $lang_error)
        $var_text = IniRead(@ScriptDir & "\settings.ini", $i, "Text", $lang_error)
        $var_text = StringReplace($var_text, "%BR%", ", ")
        _ArrayAdd($GUI_item, GUICtrlCreateListViewItem($i & "|" & $var_title & "|" & $var_text, $GUI_listview))
   ;$GUI_item[$i] = GUICtrlCreateListViewItem($i & "|" & $var_title & "|" & $var_text, $GUI_listview)
        If $i = 1 Then $item1_id = $GUI_item[$i]
    Next
EndFunc ;==>Fill_listview


Func Quit()
    Exit
EndFunc ;==>Quit

Hope you like it!

Feel free to post comment, suggestions, problems, bugs and so on!

peethebee

Edited by peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

I really want to see this work... but i had lots of problems...

1 the English needed to be worked on to read it

You could probably fix that with this at the beginning

#include <GUIConstants.au3>
#Include <date.au3>


$English=""
$German=""

#Region --- CodeWizard generated code Start ---
;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes, No, and Cancel, Icon=Info
If Not IsDeclared("iMsgBoxAnswer") Then Dim $iMsgBoxAnswer
$iMsgBoxAnswer = MsgBox(67,"Set Language/(= in German)","Press  *Yes* - for English Laguage" & @CRLF & @CRLF & "(German) Press *No* - For German Language(written in German)" & @CRLF & @CRLF & "Cancel = Exit")
Select
   Case $iMsgBoxAnswer = 6;Yes
;#cs english
    $lang_program_name = 'Click4u "chip-Edition" ' 
    $lang_program_version = "1.1" 
    $lang_welcome_text = "The following things are now possible:" & @CRLF & @CRLF & "Ctrl + Alt + S: program options" & @CRLF & "Ctrl + Alt + A: New action with actual window" & @CRLF & "Ctrl + Alt + W: (De)aktivieren" & @CRLF & "Ctrl + Alt + Q: Quit"
    $lang_GUI_win_title = "Fenstertitel des aktiven Fensters:" this is not english
    $lang_GUI_win_text = "Fenstertext des aktiven Fensters:" english?
    $lang_add_new_target_window = "Neues Zielfenster"       english?    
    $lang_add_new_target_window_button = "Fenster merken"   etc
    $lang_input_titlemode_title = "WinTitleMatchMode"       
    ........ All the language
    ........ And $English="on"; for later with message boxes
    If $English="on" Then
        Msgbox( IN English...bla...bla.bla)
        
   Case $iMsgBoxAnswer = 7;No
;#cs german
    $lang_program_name = 'Click4u "chip-Edition" ' 
    $lang_program_version = "1.1" 
    $lang_welcome_text = "Folgende Funktionen stehen jetzt zur Verfügung:" & @CRLF & @CRLF & "Strg + Alt + S: Programmoptionen" & @CRLF & "Strg + Alt + A: In aktivem Fenster tätig werden" & @CRLF & "Strg + Alt + W: Fenstererkennung (de)aktivieren" & @CRLF & "Strg + Alt + Q: Beenden"
    $lang_GUI_win_title = "Fenstertitel des aktiven Fensters:" 
    $lang_GUI_win_text = "Fenstertext des aktiven Fensters:" 
    $lang_add_new_target_window = "Neues Zielfenster" 
    ............ All the language
    ............ And $$German="on"; for later with message boxes
    If $German="on" Then
        MsgBox( IN German...bla..bla)
        
   Case $iMsgBoxAnswer = 2;Cancel
    Exit
EndSelect
#EndRegion --- CodeWizard generated code End ---

Just an Idea

thx CodeWizard

2 I have an error with (Control+Alt+S) i get the attached error

NEWHeader1.png

Link to comment
Share on other sites

1. i had 2 minutes ime to translate it before posting... *g* excuse it. if it gets stable and is usefull, a real TRANSLATION will be done of course.

2. that's a udf i wrote for myself. will post it here tomorrow.

Do the exes work?

Edited by peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

1. i had 2 minutes ime to translate it before posting... *g* excuse it. if it gets stable and is usefull, a real TRANSLATION will be done of course.

2. that's a udf i wrote for myself. will post it here tomorrow.

Do the exes work?

<{POST_SNAPBACK}>

No,

ctl+alt+q... works

ctl+alt+ a... works ( but i cant tell what it is for (german)

ctl+alt+w... works - switches between two tray tips (german???)

html in german too

*** I have no idea what to do ****

PLease Note... I can see this was alot of work and I can really appreciate it!

sssso

PLEASE dont take anything i said offensively

Love to see more of this

thx

NEWHeader1.png

Link to comment
Share on other sites

First point:

The Source of the lacking func:

; Description:    Saves the Array.
; Author(s):        peethebee
Func _FileSaveToArray($sFilePath, ByRef $aArray)
    Local $hFile, $h
    
    $hFile = FileOpen($sFilePath, 2)
    
    If $hFile = -1 Then
        SetError(1)
        Return 0
    EndIf
    
    For $h = 1 to UBound($aArray) - 2
        FileWriteLine($sFilePath, $aArray[$h] & @LF)
    Next
    FileWriteLine($sFilePath, $aArray[UBound($aArray) - 1])
    
    FileClose($hFile)
    Return 1
EndFunc ;==>_FileSaveToArray

Secondly:

I puut some work into a completely new kind of managing different languages.

It is more flexible than Valuater's solution (nevertheless thanks for your report!)

Now English is the standard language so that you can test it better.

The next thing I'll do (perhaops today evening) is the integration of a translation function.

hope you like better now ;-)

peethebee

p.s. updated attached archive!

Edited by peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

Short tutorial how to use Click4u:

1. Unpack all files into any folder.

2. Start it (Click4u.exe)

3. Press Ctrl + Alt + S to show settings screen

4. Choose autorun if you want to and the wait time

5. close the settings dialog

6. Bring up the dialog you want to be clicked autotically.

7. Press Ctrl + Alt + A

8. Change the given texts to make the program click similar dialogs too

9. Choose Wintitlematchmode (autoit coder's know what it will make Click4u behave like *g*)

10. Choose the action type

11. Give the actions details

12. Say yes to make it immediately ative (normally usefull)

13. now the dialog is clicked or the key is pressed or whatever you specified whenever the window pops up!

Hope it helped to get started with it!

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

Hi!

Thanks. I feels good if somebody else than the programmer itself uses the program. Could post plese a more detailed description if it works, what's not comfortable and so on? would be very nice.

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

Weltklasse ;-)

Was war eigentlich mit der Ãœbersetzung los? (ehrlich bitte)

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

Which things let you click the tool automatically?

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

ehrlich:

also

1. war fast fertig dann kamen die abschlussprüfungen, musste lernen

2. ok fertig gelernt, hab se an dich geschickt aber du hast se ned gekriegt kP wieso

3. dateien ned mehr efunden und dann keine lust mehr gehabt nochma alles neu zu machen

4. deine emails einfach ignoriert^^

naja sry^^

aba nen geiles prog!

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Link to comment
Share on other sites

Hi!

I'm at the moment developping a tool that's able to press any button in a given dialog or window.

Features:

- Send keystroke

- Send mousclick

- write log

- run proggy

would you like that?

I developped about 50% so far. could post it, if interest is toooo big ;-)

peethebee

<{POST_SNAPBACK}>

Just DL'ed your code. Nice work. I have to learn a little german to get through the program. I will have to take a look at your language file to see how to make it work better. :( I think this programs has a lot of applications. I like the way you set it up.

Cheers.. :(

Link to comment
Share on other sites

Hi!

@....ritter:

Schon okay, aber sag halt einfach gleich, was Sache ist!

@busysignal:

I tried to translate everything. It should be almost complete English. If not, just try dict.leo.org or write an e-mail to me.

Thanks for the cheering *g*

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

Hi!

@....ritter:

Schon okay, aber sag halt einfach gleich, was Sache ist!

@busysignal:

I tried to translate everything. It should be almost complete English. If not, just try dict.leo.org or write an e-mail to me.

Thanks for the cheering *g*

peethebee

<{POST_SNAPBACK}>

Peethebee, you almost got everything covered on the language files except a couple of items:

File: Click4uSet.au3

$GUI_list_button_new = GUICtrlCreateButton("Neu", 30, 240, 60, 20)

$GUI_list_button_edit = GUICtrlCreateButton("Bearbeiten", 90, 240, 60, 20)

$GUI_list_button_delete = GUICtrlCreateButton("Löschen", 150, 240, 60, 20)

>

These should be variables in the ?.lng file. Also I found in the English.lng file a line you need to update:

53=Ner title:

>

Should be: 53=New title:

I believe that Ner means New? or does Neu mean New? :(

I like the way your are doing the language file.

Cheers.. :(

Link to comment
Share on other sites

Peethebee, you almost got everything covered on the language files except a couple of items:

File: Click4uSet.au3

$GUI_list_button_new = GUICtrlCreateButton("Neu", 30, 240, 60, 20)

$GUI_list_button_edit = GUICtrlCreateButton("Bearbeiten", 90, 240, 60, 20)

$GUI_list_button_delete = GUICtrlCreateButton("Löschen", 150, 240, 60, 20)

>

These should be variables in the ?.lng file. Also I found in the English.lng file a line you need to update:

53=Ner title:

>

Should be: 53=New title:

I believe that Ner means New? or does Neu mean New?  :(

I like the way your are doing the language file.

Cheers..  :(

<{POST_SNAPBACK}>

Neu = New

Bearbeiten = Edit

Löschen = Delete

Hope that helps you!

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

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...