Jump to content

Save?


AlmarM
 Share

Recommended Posts

Nope, the Filesavedialog will still open

This is the script right ??

#include <GuiConstants.au3>

DIM $names_real_name, $names_cfg_name, $names_game_name, $controls_forward, $controls_back, $controls_left, $controls_right, $controls_lean_left, $save_button

$edit = GUICtrlCreateEdit("", 16, 40, 601, 361)

GuiCreate("CFG Maker", 620, 700) 
$names = GuiCtrlCreateButton("Names", 10, 10, 100, 100) 
$controls = GuiCtrlCreateButton("Controls", 110, 10, 100, 100) 
$other_controls = GuiCtrlCreateButton("Other Controls", 210, 10, 100, 100) 
$weapon_controls = GuiCtrlCreateButton("Weapon Controls", 310, 10, 100, 100) 
$chat_controls = GuiCtrlCreateButton("Chat Controls", 410, 10, 100, 100) 
$show_script = GuiCtrlCreateButton("Show Script", 510, 10, 100, 100)
GuiCtrlCreateLabel("This CFG Maker will only ask for the keys you want to use", 10, 115) 
GuiCtrlCreateLabel("The stuff what will make the FPS go lower are in the LowerFPS.txt", 10, 130) 

GuiSetState()
While 1
$msg = GUIGetMsg()

Select
Case $msg = $GUI_EVENT_CLOSE
    Exit
    
Case $msg = $names
    $names_real_name = InputBox("Names", "Your Real Name:")
    $names_cfg_name = InputBox("Names", "The CFG Name:")
    $names_game_name = InputBox("Names", "Your In-Game Name")

Case $msg = $controls
    $controls_forward = InputBox("Controls", "Move Forward:")
    $controls_back = InputBox("Controls", "Move Back:")
    $controls_left = InputBox("Controls", "Move Left:")
    $controls_right = InputBox("Controls", "Move Right:")
    $controls_lean_left = InputBox("Controls", "Lean Left:")
    $controls_lean_right = InputBox("Controls", "Lean Right:")
    $controls_jump = InputBox("Controls", "Jump:")
    $controls_crouch = InputBox("Controls", "Crouch:")
    $controls_prone = InputBox("Controls", "Prone:")
    $controls_run = InputBox("Controls", "Run:")
    $controls_use = InputBox("Controls", "Use/Activate:")

Case $msg = $other_controls
    $other_controls_show_scores = InputBox("Other Controls", "Show Scores:")
    $other_controls_limbo = InputBox("Other Controls", "Limbo:")
    $other_controls_show_map = InputBox("Other Controls", "Show Map:")
    $other_controls_compass_zoom_in = InputBox("Other Controls", "Compass Zoom In:")
    $other_controls_compass_zoom_out = InputBox("Other Controls", "Compass Zoom Out:")

Case $msg = $weapon_controls
    $weapon_controls_next_weapon = InputBox("Weapon Controls", "Next Weapon:")
    $weapon_controls_prev_weapon = InputBox("Weapon Controls", "Previous Weapon:")
    $weapon_controls_melee = InputBox("Weapon Controls", "Knife (Melee):")
    $weapon_controls_one_handed = InputBox("Weapon Controls", "Luger/Colt (One Handed):")
    $weapon_controls_two_handed = InputBox("Weapon Controls", "MP40/Thompson (Two Handed):")
    $weapon_controls_granade = InputBox("Weapon Controls", "Granade:")
    $weapon_controls_spec1 = InputBox("Weapon Controls", "Special 1:")
    $weapon_controls_spec2 = InputBox("Weapon Controls", "Special 2:")
    $weapon_controls_spec3 = InputBox("Weapon Controls", "Special 3:")
    $weapon_controls_shoot = InputBox("Weapon Controls", "Shoot:")
    $weapon_controls_switch_to = InputBox("Weapon Controls", "Switch to Alternative:")
    $weapon_controls_reload = InputBox("Weapon Controls", "Reload:")
    $weapon_controls_binoc = InputBox("Weapon Controls", "Binocular:")
    
Case $msg = $chat_controls
    $chat_controls_global = InputBox("Chat Controls", "Global Chat:")
    $chat_controls_team = InputBox("Chat Controls", "Team Chat:")
    $chat_controls_fireteam = InputBox("Chat Controls", "Fire Team Chat:")
    $chat_controls_vsay = InputBox("Chat Controls", "Voice Chat Menu:")
    $chat_controls_vote_yes = InputBox("Chat Controls", "Vote Yes:")
    $chat_controls_vote_no = InputBox("Chat Controls", "Vote No:")
    $chat_controls_screenshot = InputBox("Chat Controls", "Screenshot:")
    $chat_controls_record = InputBox("Chat Controls", "Record Replay:")

Case $msg = $show_script
    $script_box = GuiCtrlCreateEdit("//Real Life Name: " & $names_real_name & @CRLF & "//Config Name: " & $names_cfg_name & @CRLF & "name " & $names_game_name & @CRLF & @CRLF & "//Controls" & @CRLF & "bind " & $controls_forward & " +forward" & @CRLF & "bind " & $controls_back & " +back" & @CRLF & "bind " & $controls_left & " +moveleft" & @CRLF & "bind " & $controls_right & " +moveright" & @CRLF & "bind " & $controls_lean_left & " +leanleft", 10, 150, 600, 500)
    $show_script = GuiCtrlCreateButton("Show Script", 510, 10, 100, 100)
    
Case $msg = $save_button
    $FileSave = Filesavedialog("Save Config File","","Config Files (*.cfg*)|All files (*.*)", 2,"controls.cfg")
    $Text = GuiCtrlRead($edit)
    Filewrite($Filesave, $Text)
EndSelect
WEnd

EDIT: Your right it works.. :)

Only... If I click on the Save Script button it wont save !!

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

You know :)

Ill just dont use the button xD

They need to save it them selfs :)

Exept you mayby know the right script without all things we just had :P

I got to go now so mayby ill see if you post a NOT wrong script :P

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

You know :)

Ill just dont use the button xD

They need to save it them selfs :P

Exept you mayby know the right script without all things we just had :P

I got to go now so mayby ill see if you post a NOT wrong script :(

I pretty much understand what you're trying to do so I'll try a different approach and post the script here.

I need a break from what I'm doing anyway so this will work out really well. :)

[font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version

Link to comment
Share on other sites

Someone else mayby know ??

Why my FilesaveDialog() will open when I start script??

And if I dont use the DIM it will give error:

CODE

Line 79 (etc)

Case $msg = $save_button

Case $msg = ^ ERROR

Error: Varialble use without being declared.

This is the script:

#include <GuiConstants.au3>

DIM $names_real_name, $names_cfg_name, $names_game_name, $controls_forward, $controls_back, $controls_left, $controls_right, $controls_lean_left, $save_button

$edit = GUICtrlCreateEdit("", 16, 40, 601, 361)

GuiCreate("CFG Maker", 620, 700) 
$names = GuiCtrlCreateButton("Names", 10, 10, 100, 100) 
$controls = GuiCtrlCreateButton("Controls", 110, 10, 100, 100) 
$other_controls = GuiCtrlCreateButton("Other Controls", 210, 10, 100, 100) 
$weapon_controls = GuiCtrlCreateButton("Weapon Controls", 310, 10, 100, 100) 
$chat_controls = GuiCtrlCreateButton("Chat Controls", 410, 10, 100, 100) 
$show_script = GuiCtrlCreateButton("Show Script", 510, 10, 100, 100)
GuiCtrlCreateLabel("This CFG Maker will only ask for the keys you want to use", 10, 115) 
GuiCtrlCreateLabel("The stuff what will make the FPS go lower are in the LowerFPS.txt", 10, 130) 

GuiSetState()
While 1
$msg = GUIGetMsg()

Select
Case $msg = $GUI_EVENT_CLOSE
    Exit
    
Case $msg = $names
    $names_real_name = InputBox("Names", "Your Real Name:")
    $names_cfg_name = InputBox("Names", "The CFG Name:")
    $names_game_name = InputBox("Names", "Your In-Game Name")

Case $msg = $controls
    $controls_forward = InputBox("Controls", "Move Forward:")
    $controls_back = InputBox("Controls", "Move Back:")
    $controls_left = InputBox("Controls", "Move Left:")
    $controls_right = InputBox("Controls", "Move Right:")
    $controls_lean_left = InputBox("Controls", "Lean Left:")
    $controls_lean_right = InputBox("Controls", "Lean Right:")
    $controls_jump = InputBox("Controls", "Jump:")
    $controls_crouch = InputBox("Controls", "Crouch:")
    $controls_prone = InputBox("Controls", "Prone:")
    $controls_run = InputBox("Controls", "Run:")
    $controls_use = InputBox("Controls", "Use/Activate:")

Case $msg = $other_controls
    $other_controls_show_scores = InputBox("Other Controls", "Show Scores:")
    $other_controls_limbo = InputBox("Other Controls", "Limbo:")
    $other_controls_show_map = InputBox("Other Controls", "Show Map:")
    $other_controls_compass_zoom_in = InputBox("Other Controls", "Compass Zoom In:")
    $other_controls_compass_zoom_out = InputBox("Other Controls", "Compass Zoom Out:")

Case $msg = $weapon_controls
    $weapon_controls_next_weapon = InputBox("Weapon Controls", "Next Weapon:")
    $weapon_controls_prev_weapon = InputBox("Weapon Controls", "Previous Weapon:")
    $weapon_controls_melee = InputBox("Weapon Controls", "Knife (Melee):")
    $weapon_controls_one_handed = InputBox("Weapon Controls", "Luger/Colt (One Handed):")
    $weapon_controls_two_handed = InputBox("Weapon Controls", "MP40/Thompson (Two Handed):")
    $weapon_controls_granade = InputBox("Weapon Controls", "Granade:")
    $weapon_controls_spec1 = InputBox("Weapon Controls", "Special 1:")
    $weapon_controls_spec2 = InputBox("Weapon Controls", "Special 2:")
    $weapon_controls_spec3 = InputBox("Weapon Controls", "Special 3:")
    $weapon_controls_shoot = InputBox("Weapon Controls", "Shoot:")
    $weapon_controls_switch_to = InputBox("Weapon Controls", "Switch to Alternative:")
    $weapon_controls_reload = InputBox("Weapon Controls", "Reload:")
    $weapon_controls_binoc = InputBox("Weapon Controls", "Binocular:")
    
Case $msg = $chat_controls
    $chat_controls_global = InputBox("Chat Controls", "Global Chat:")
    $chat_controls_team = InputBox("Chat Controls", "Team Chat:")
    $chat_controls_fireteam = InputBox("Chat Controls", "Fire Team Chat:")
    $chat_controls_vsay = InputBox("Chat Controls", "Voice Chat Menu:")
    $chat_controls_vote_yes = InputBox("Chat Controls", "Vote Yes:")
    $chat_controls_vote_no = InputBox("Chat Controls", "Vote No:")
    $chat_controls_screenshot = InputBox("Chat Controls", "Screenshot:")
    $chat_controls_record = InputBox("Chat Controls", "Record Replay:")

Case $msg = $show_script
    $script_box = GuiCtrlCreateEdit("//Real Life Name: " & $names_real_name & @CRLF & "//Config Name: " & $names_cfg_name & @CRLF & "name " & $names_game_name & @CRLF & @CRLF & "//Controls" & @CRLF & "bind " & $controls_forward & " +forward" & @CRLF & "bind " & $controls_back & " +back" & @CRLF & "bind " & $controls_left & " +moveleft" & @CRLF & "bind " & $controls_right & " +moveright" & @CRLF & "bind " & $controls_lean_left & " +leanleft", 10, 150, 600, 540)
    $save_button = GuiCtrlCreateButton("Save Script", 330, 110, 280, 38) 

Case $msg = $save_button
    $FileSave = Filesavedialog("Save Config File", "","Config Files (*.cfg*)|All files (*.*)", 2)
    $Text = GuiCtrlRead($edit) 
    Filewrite($Filesave, $Text)
EndSelect
WEnd

Can someone who mayby know help me ??

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

Because you declare a variable, wich is empty, same as $msg if there no messages :) - therefore always executed the part with FileSaveDialog...

Try this:

#include <GuiConstants.au3>

DIM $names_real_name, $names_cfg_name, $names_game_name, $controls_forward, $controls_back, $controls_left, $controls_right, $controls_lean_left

$edit = GUICtrlCreateEdit("", 16, 40, 601, 361)

GuiCreate("CFG Maker", 620, 700) 
$names = GuiCtrlCreateButton("Names", 10, 10, 100, 100) 
$controls = GuiCtrlCreateButton("Controls", 110, 10, 100, 100) 
$other_controls = GuiCtrlCreateButton("Other Controls", 210, 10, 100, 100) 
$weapon_controls = GuiCtrlCreateButton("Weapon Controls", 310, 10, 100, 100)

$save_button = GuiCtrlCreateButton("Save Script", 330, 110, 280, 38)
GUICtrlSetState($save_button, $GUI_HIDE) ;Hide the button, to show it later ;)

$chat_controls = GuiCtrlCreateButton("Chat Controls", 410, 10, 100, 100) 
$show_script = GuiCtrlCreateButton("Show Script", 510, 10, 100, 100)
GuiCtrlCreateLabel("This CFG Maker will only ask for the keys you want to use", 10, 115) 
GuiCtrlCreateLabel("The stuff what will make the FPS go lower are in the LowerFPS.txt", 10, 130) 

GuiSetState()
While 1
$msg = GUIGetMsg()

Select
Case $msg = $GUI_EVENT_CLOSE
    Exit
    
Case $msg = $names
    $names_real_name = InputBox("Names", "Your Real Name:")
    $names_cfg_name = InputBox("Names", "The CFG Name:")
    $names_game_name = InputBox("Names", "Your In-Game Name")

Case $msg = $controls
    $controls_forward = InputBox("Controls", "Move Forward:")
    $controls_back = InputBox("Controls", "Move Back:")
    $controls_left = InputBox("Controls", "Move Left:")
    $controls_right = InputBox("Controls", "Move Right:")
    $controls_lean_left = InputBox("Controls", "Lean Left:")
    $controls_lean_right = InputBox("Controls", "Lean Right:")
    $controls_jump = InputBox("Controls", "Jump:")
    $controls_crouch = InputBox("Controls", "Crouch:")
    $controls_prone = InputBox("Controls", "Prone:")
    $controls_run = InputBox("Controls", "Run:")
    $controls_use = InputBox("Controls", "Use/Activate:")

Case $msg = $other_controls
    $other_controls_show_scores = InputBox("Other Controls", "Show Scores:")
    $other_controls_limbo = InputBox("Other Controls", "Limbo:")
    $other_controls_show_map = InputBox("Other Controls", "Show Map:")
    $other_controls_compass_zoom_in = InputBox("Other Controls", "Compass Zoom In:")
    $other_controls_compass_zoom_out = InputBox("Other Controls", "Compass Zoom Out:")

Case $msg = $weapon_controls
    $weapon_controls_next_weapon = InputBox("Weapon Controls", "Next Weapon:")
    $weapon_controls_prev_weapon = InputBox("Weapon Controls", "Previous Weapon:")
    $weapon_controls_melee = InputBox("Weapon Controls", "Knife (Melee):")
    $weapon_controls_one_handed = InputBox("Weapon Controls", "Luger/Colt (One Handed):")
    $weapon_controls_two_handed = InputBox("Weapon Controls", "MP40/Thompson (Two Handed):")
    $weapon_controls_granade = InputBox("Weapon Controls", "Granade:")
    $weapon_controls_spec1 = InputBox("Weapon Controls", "Special 1:")
    $weapon_controls_spec2 = InputBox("Weapon Controls", "Special 2:")
    $weapon_controls_spec3 = InputBox("Weapon Controls", "Special 3:")
    $weapon_controls_shoot = InputBox("Weapon Controls", "Shoot:")
    $weapon_controls_switch_to = InputBox("Weapon Controls", "Switch to Alternative:")
    $weapon_controls_reload = InputBox("Weapon Controls", "Reload:")
    $weapon_controls_binoc = InputBox("Weapon Controls", "Binocular:")
    
Case $msg = $chat_controls
    $chat_controls_global = InputBox("Chat Controls", "Global Chat:")
    $chat_controls_team = InputBox("Chat Controls", "Team Chat:")
    $chat_controls_fireteam = InputBox("Chat Controls", "Fire Team Chat:")
    $chat_controls_vsay = InputBox("Chat Controls", "Voice Chat Menu:")
    $chat_controls_vote_yes = InputBox("Chat Controls", "Vote Yes:")
    $chat_controls_vote_no = InputBox("Chat Controls", "Vote No:")
    $chat_controls_screenshot = InputBox("Chat Controls", "Screenshot:")
    $chat_controls_record = InputBox("Chat Controls", "Record Replay:")

Case $msg = $show_script
    $script_box = GuiCtrlCreateEdit("//Real Life Name: " & $names_real_name & @CRLF & "//Config Name: " & $names_cfg_name & @CRLF & "name " & $names_game_name & @CRLF & @CRLF & "//Controls" & @CRLF & "bind " & $controls_forward & " +forward" & @CRLF & "bind " & $controls_back & " +back" & @CRLF & "bind " & $controls_left & " +moveleft" & @CRLF & "bind " & $controls_right & " +moveright" & @CRLF & "bind " & $controls_lean_left & " +leanleft", 10, 150, 600, 540)
    GUICtrlSetState($save_button, $GUI_SHOW) ;Just Show the hidden button that was created at start

Case $msg = $save_button
    $FileSave = Filesavedialog("Save Config File", "","Config Files (*.cfg*)|All files (*.*)", 2)
    $Text = GuiCtrlRead($edit) 
    Filewrite($Filesave, $Text)
EndSelect
WEnd
Edited by MsCreatoR

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Because you declare a variable, wich is empty, same as $msg if there no messages :) - therefore always executed the part with FileSaveDialog...

Try this:

#include <GuiConstants.au3>

DIM $names_real_name, $names_cfg_name, $names_game_name, $controls_forward, $controls_back, $controls_left, $controls_right, $controls_lean_left

$edit = GUICtrlCreateEdit("", 16, 40, 601, 361)

GuiCreate("CFG Maker", 620, 700) 
$names = GuiCtrlCreateButton("Names", 10, 10, 100, 100) 
$controls = GuiCtrlCreateButton("Controls", 110, 10, 100, 100) 
$other_controls = GuiCtrlCreateButton("Other Controls", 210, 10, 100, 100) 
$weapon_controls = GuiCtrlCreateButton("Weapon Controls", 310, 10, 100, 100)

$save_button = GuiCtrlCreateButton("Save Script", 330, 110, 280, 38)
GUICtrlSetState($save_button, $GUI_HIDE) ;Hide the button, to show it later ;)

$chat_controls = GuiCtrlCreateButton("Chat Controls", 410, 10, 100, 100) 
$show_script = GuiCtrlCreateButton("Show Script", 510, 10, 100, 100)
GuiCtrlCreateLabel("This CFG Maker will only ask for the keys you want to use", 10, 115) 
GuiCtrlCreateLabel("The stuff what will make the FPS go lower are in the LowerFPS.txt", 10, 130) 

GuiSetState()
While 1
$msg = GUIGetMsg()

Select
Case $msg = $GUI_EVENT_CLOSE
    Exit
    
Case $msg = $names
    $names_real_name = InputBox("Names", "Your Real Name:")
    $names_cfg_name = InputBox("Names", "The CFG Name:")
    $names_game_name = InputBox("Names", "Your In-Game Name")

Case $msg = $controls
    $controls_forward = InputBox("Controls", "Move Forward:")
    $controls_back = InputBox("Controls", "Move Back:")
    $controls_left = InputBox("Controls", "Move Left:")
    $controls_right = InputBox("Controls", "Move Right:")
    $controls_lean_left = InputBox("Controls", "Lean Left:")
    $controls_lean_right = InputBox("Controls", "Lean Right:")
    $controls_jump = InputBox("Controls", "Jump:")
    $controls_crouch = InputBox("Controls", "Crouch:")
    $controls_prone = InputBox("Controls", "Prone:")
    $controls_run = InputBox("Controls", "Run:")
    $controls_use = InputBox("Controls", "Use/Activate:")

Case $msg = $other_controls
    $other_controls_show_scores = InputBox("Other Controls", "Show Scores:")
    $other_controls_limbo = InputBox("Other Controls", "Limbo:")
    $other_controls_show_map = InputBox("Other Controls", "Show Map:")
    $other_controls_compass_zoom_in = InputBox("Other Controls", "Compass Zoom In:")
    $other_controls_compass_zoom_out = InputBox("Other Controls", "Compass Zoom Out:")

Case $msg = $weapon_controls
    $weapon_controls_next_weapon = InputBox("Weapon Controls", "Next Weapon:")
    $weapon_controls_prev_weapon = InputBox("Weapon Controls", "Previous Weapon:")
    $weapon_controls_melee = InputBox("Weapon Controls", "Knife (Melee):")
    $weapon_controls_one_handed = InputBox("Weapon Controls", "Luger/Colt (One Handed):")
    $weapon_controls_two_handed = InputBox("Weapon Controls", "MP40/Thompson (Two Handed):")
    $weapon_controls_granade = InputBox("Weapon Controls", "Granade:")
    $weapon_controls_spec1 = InputBox("Weapon Controls", "Special 1:")
    $weapon_controls_spec2 = InputBox("Weapon Controls", "Special 2:")
    $weapon_controls_spec3 = InputBox("Weapon Controls", "Special 3:")
    $weapon_controls_shoot = InputBox("Weapon Controls", "Shoot:")
    $weapon_controls_switch_to = InputBox("Weapon Controls", "Switch to Alternative:")
    $weapon_controls_reload = InputBox("Weapon Controls", "Reload:")
    $weapon_controls_binoc = InputBox("Weapon Controls", "Binocular:")
    
Case $msg = $chat_controls
    $chat_controls_global = InputBox("Chat Controls", "Global Chat:")
    $chat_controls_team = InputBox("Chat Controls", "Team Chat:")
    $chat_controls_fireteam = InputBox("Chat Controls", "Fire Team Chat:")
    $chat_controls_vsay = InputBox("Chat Controls", "Voice Chat Menu:")
    $chat_controls_vote_yes = InputBox("Chat Controls", "Vote Yes:")
    $chat_controls_vote_no = InputBox("Chat Controls", "Vote No:")
    $chat_controls_screenshot = InputBox("Chat Controls", "Screenshot:")
    $chat_controls_record = InputBox("Chat Controls", "Record Replay:")

Case $msg = $show_script
    $script_box = GuiCtrlCreateEdit("//Real Life Name: " & $names_real_name & @CRLF & "//Config Name: " & $names_cfg_name & @CRLF & "name " & $names_game_name & @CRLF & @CRLF & "//Controls" & @CRLF & "bind " & $controls_forward & " +forward" & @CRLF & "bind " & $controls_back & " +back" & @CRLF & "bind " & $controls_left & " +moveleft" & @CRLF & "bind " & $controls_right & " +moveright" & @CRLF & "bind " & $controls_lean_left & " +leanleft", 10, 150, 600, 540)
    GUICtrlSetState($save_button, $GUI_SHOW) ;Just Show the hidden button that was created at start

Case $msg = $save_button
    $FileSave = Filesavedialog("Save Config File", "","Config Files (*.cfg*)|All files (*.*)", 2)
    $Text = GuiCtrlRead($edit) 
    Filewrite($Filesave, $Text)
EndSelect
WEndoÝ÷ Ûú®¢×P12¢êà­æ­
8q©ÃDȲإ¯{jk¡¹^ÍH~+½à't)z{azƯy×ââ-Â)e²0Ñ8Z¶Æ¥¬·B0j{m«b¶Æ¯zÆ¥Øb0«l}7êÇ+[£v'Z°7jém©rí®lqø·¥'ò¢é^j÷­ç^}«¥¶Æ¯y«¢{k¢[~n¶'Èr§éÚâ0Ylj÷²v¦zz-)àiû^®+G£­¶­Ê8Ôçyçm¢Ü©©mÇàý±!2¦ºéµjëh×6    $Text = GuiCtrlRead($edit + $script_box)
Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

Case $msg = $save_button

$Text = GuiCtrlRead($edit)
$filename = GuiCtrlRead($names_cfg_name)

;  file for saving information.
If FileExists(@ScriptDir & "\" & $filename & ".cfg") Then
    ; Check if *.cfg exists then save info
    FileDelete(@ScriptDir & "\" & $filename & ".cfg")
    $file = FileOpen(@ScriptDir & "\" & $filename & ".cfg", 2)
    FileWrite(@ScriptDir & "\" & $filename & ".cfg", $Text)
    FileClose($file)
    FileSetAttrib(@ScriptDir & "\" & $filename & ".cfg", "-AHNOT+RS")
Else
    ; If not, create the *.cfg file and save info
    FileSetAttrib(@ScriptDir & "\" & $filename & ".cfg", "-RASHNOT")
    $file = FileOpen(@ScriptDir & "\" & $filename & ".cfg", 2)
    FileWrite(@ScriptDir & "\" & $filename & ".cfg", $Text)
    FileClose($file)
    FileSetAttrib(@ScriptDir & "\" & $filename & ".cfg", "-AHNOT+RS")
EndIf

Edited by aslani

[font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version

Link to comment
Share on other sites

Check this out, I hope you find it helpful.

; Include
#include <GUIConstants.au3>

; Variables
$title = "CFG Maker"
$input_width = 100
$input_height = 20
$label_width = 80
$label_height = 17

GUICreate($title, 691, 553, 331, 113)

; Names
GUICtrlCreateGroup("Names", 5, 5, 196, 86)
GUICtrlCreateLabel("Real Name:", 10, 21, $label_width, $label_height)
$name_real = GUICtrlCreateInput("Real Name", 95, 20, $input_width, $input_height)
GUICtrlCreateLabel("CFG Name:", 10, 41, $label_width, $label_height)
$name_cfg = GUICtrlCreateInput("CFG Name", 95, 40, $input_width, $input_height)
GUICtrlCreateLabel("IGN:", 10, 61, $label_width, $label_height)
$name_in_game = GUICtrlCreateInput("IGN", 95, 60, $input_width, $input_height)
GUICtrlCreateGroup("", -99, -99, 1, 1)

; Controls
GUICtrlCreateGroup("Controls", 5, 100, 196, 245)
GUICtrlCreateLabel("Forward:", 10, 118, $label_width, $label_height)
$ctrl_fwd = GUICtrlCreateInput("FWD", 95, 117, $input_width, $input_height)
GUICtrlCreateLabel("Back:", 10, 138, $label_width, $label_height)
$ctrl_back = GUICtrlCreateInput("Back", 95, 137, $input_width, $input_height)
GUICtrlCreateLabel("Left:", 10, 158, $label_width, $label_height)
$ctrl_left = GUICtrlCreateInput("Left", 95, 157, $input_width, $input_height)
GUICtrlCreateLabel("Right:", 10, 178, $label_width, $label_height)
$ctrl_right = GUICtrlCreateInput("Right", 95, 177, $input_width, $input_height)
GUICtrlCreateLabel("Lean Left:", 10, 198, $label_width, $label_height)
$ctrl_leanl = GUICtrlCreateInput("Lean Left", 95, 197, $input_width, $input_height)
GUICtrlCreateLabel("Lean Right:", 10, 218, $label_width, $label_height)
$ctrl_leanr = GUICtrlCreateInput("Lean Right", 95, 217, $input_width, $input_height)
GUICtrlCreateLabel("Jump:", 10, 238, $label_width, $label_height)
$ctrl_jump = GUICtrlCreateInput("Jump", 95, 237, $input_width, $input_height)
GUICtrlCreateLabel("Crouch:", 10, 258, $label_width, $label_height)
$ctrl_crouch = GUICtrlCreateInput("Crouch", 95, 257, $input_width, $input_height)
GUICtrlCreateLabel("Prone:", 10, 278, $label_width, $label_height)
$ctrl_prone = GUICtrlCreateInput("Prone", 95, 277, $input_width, $input_height)
GUICtrlCreateLabel("Run:", 10, 298, $label_width, $label_height)
$ctrl_run = GUICtrlCreateInput("Run", 95, 297, $input_width, $input_height)
GUICtrlCreateLabel("Use/Activate:", 10, 318, $label_width, $label_height)
$ctrl_use = GUICtrlCreateInput("Use", 95, 317, $input_width, $input_height)
GUICtrlCreateGroup("", -99, -99, 1, 1)

; Chat Controls
GUICtrlCreateGroup("Chat Controls", 5, 357, 196, 185)
GUICtrlCreateLabel("Global Chat:", 10, 375, $label_width, $label_height)
$chat_global = GUICtrlCreateInput("Global", 95, 374, $input_width, $input_height)
GUICtrlCreateLabel("Team Chat:", 10, 395, $label_width, $label_height)
$chat_team = GUICtrlCreateInput("Team", 95, 394, $input_width, $input_height)
GUICtrlCreateLabel("Fire Team Chat:", 10, 415, $label_width, $label_height)
$chat_f_team = GUICtrlCreateInput("Fire Team", 95, 414, $input_width, $input_height)
GUICtrlCreateLabel("Chat Menu:", 10, 435, $label_width, $label_height)
$chat_mnu = GUICtrlCreateInput("Chat Menu", 95, 434, $input_width, $input_height)
GUICtrlCreateLabel("Vote Yes:", 10, 455, $label_width, $label_height)
$chat_v_yes = GUICtrlCreateInput("Yes", 95, 454, $input_width, $input_height)
GUICtrlCreateLabel("Vote No:", 10, 475, $label_width, $label_height)
$chat_v_no = GUICtrlCreateInput("No", 95, 474, $input_width, $input_height)
GUICtrlCreateLabel("Screenshot:", 10, 495, $label_width, $label_height)
$chat_scrnshot = GUICtrlCreateInput("Screenshot", 95, 494, $input_width, $input_height)
GUICtrlCreateLabel("Record Play:", 10, 515, $label_width, $label_height)
$chat_rcdplay = GUICtrlCreateInput("Record", 95, 514, $input_width, $input_height)
GUICtrlCreateGroup("", -99, -99, 1, 1)

; Other Controls
GUICtrlCreateGroup("Other Controls", 210, 5, 201, 131)
GUICtrlCreateLabel("Show Score:", 215, 21, $label_width, $label_height)
$other_score = GUICtrlCreateInput("Score", 305, 20, $input_width, $input_height)
GUICtrlCreateLabel("Limbo:", 215, 41, $label_width, $label_height)
$other_limbo = GUICtrlCreateInput("Limbo", 305, 40, $input_width, $input_height)
GUICtrlCreateLabel("Show Map:", 215, 61, $label_width, $label_height)
$other_map = GUICtrlCreateInput("Map", 305, 60, $input_width, $input_height)
GUICtrlCreateLabel("Zoom-In:", 215, 81, $label_width, $label_height)
$other_zmin = GUICtrlCreateInput("Zoom In", 305, 80, $input_width, $input_height)
GUICtrlCreateLabel("Zoom-Out:", 215, 101, $label_width, $label_height)
$other_zmout = GUICtrlCreateInput("Zoom Out", 305, 100, $input_width, $input_height)
GUICtrlCreateGroup("", -99, -99, 1, 1)

; Weapon Controls
GUICtrlCreateGroup("Weapon Controls", 210, 145, 201, 286)
GUICtrlCreateLabel("Next Weapon:", 215, 160, $label_width, $label_height)
$wctrl_nextw = GUICtrlCreateInput("Next Weapon", 305, 159, $input_width, $input_height)
GUICtrlCreateLabel("Prev Weapon:", 215, 180, $label_width, $label_height)
$wctrl_prevw = GUICtrlCreateInput("Prev Weapon", 305, 179, $input_width, $input_height)
GUICtrlCreateLabel("Knife (Melee):", 215, 200, $label_width, $label_height)
$wctrl_knife = GUICtrlCreateInput("Knife", 305, 199, $input_width, $input_height)
GUICtrlCreateLabel("Luger/Colt:", 215, 220, $label_width, $label_height)
$wctrl_colt = GUICtrlCreateInput("Colt", 305, 219, $input_width, $input_height)
GUICtrlCreateLabel("MP40:", 215, 240, $label_width, $label_height)
$wctrl_mp40 = GUICtrlCreateInput("MP40", 305, 239, $input_width, $input_height)
GUICtrlCreateLabel("Grenade:", 215, 260, $label_width, $label_height)
$wctrl_grenade = GUICtrlCreateInput("Grenade", 305, 259, $input_width, $input_height)
GUICtrlCreateLabel("Special 1:", 215, 280, $label_width, $label_height)
$wctrl_spec1 = GUICtrlCreateInput("Special 1", 305, 279, $input_width, $input_height)
GUICtrlCreateLabel("Special 2:", 215, 300, $label_width, $label_height)
$wctrl_spec2 = GUICtrlCreateInput("Special 2", 305, 299, $input_width, $input_height)
GUICtrlCreateLabel("Special 3:", 215, 320, $label_width, $label_height)
$wctrl_spec3 = GUICtrlCreateInput("Special 3", 305, 319, $input_width, $input_height)
GUICtrlCreateLabel("Shoot:", 215, 340, $label_width, $label_height)
$wctrl_shoot = GUICtrlCreateInput("Shoot", 305, 339, $input_width, $input_height)
GUICtrlCreateLabel("Switch to Alt:", 215, 360, $label_width, $label_height)
$wctrl_alt = GUICtrlCreateInput("Switch 2 Alt", 305, 359, $input_width, $input_height)
GUICtrlCreateLabel("Reload:", 215, 380, $label_width, $label_height)
$wctrl_reload = GUICtrlCreateInput("Reload", 305, 379, $input_width, $input_height)
GUICtrlCreateLabel("Binoculars:", 215, 400, $label_width, $label_height)
$wctrl_spy = GUICtrlCreateInput("Binoculars", 305, 399, $input_width, $input_height)
GUICtrlCreateGroup("", -99, -99, 1, 1)

; Buttons
$genCFG = GUICtrlCreateButton("Generate CFG", 250, 460, 96, 31, 0)
$saveCFG = GUICtrlCreateButton("Save CFG File", 465, 435, 166, 21, 0)

; Display Box
$displaybox = GUICtrlCreateEdit("", 420, 10, 261, 416)

GUISetState(@SW_SHOW)

While 1
$msg = GUIGetMsg()

Select
Case $msg = $GUI_EVENT_CLOSE
    Exit
    
Case $msg = $genCFG
    $real_name = GUICtrlRead($name_real)
    $cfg_name = GUICtrlRead($name_cfg)
    $ingame_name = GUICtrlRead($name_in_game)
    $fwd = GUICtrlRead($ctrl_fwd)
    $back = GUICtrlRead($ctrl_back)
    $left = GUICtrlRead($ctrl_left)
    $right = GUICtrlRead($ctrl_right)
    $lean_left = GUICtrlRead($ctrl_leanl)
    GUICtrlSetData($displaybox, "//Real Life Name: " & $real_name & @CRLF & "//Config Name: " & $cfg_name & @CRLF & "name " & $ingame_name & @CRLF & @CRLF & "//Controls" & @CRLF & "bind " & $fwd & " +forward" & @CRLF & "bind " & $back & " +back" & @CRLF & "bind " & $left & " +moveleft" & @CRLF & "bind " & $right & " +moveright" & @CRLF & "bind " & $lean_left & " +leanleft")
    
Case $msg = $saveCFG
    $text = GuiCtrlRead($displaybox);  file for saving information.
    If FileExists(@ScriptDir & "\" & $cfg_name & ".cfg") Then
        FileSetAttrib(@ScriptDir & "\" & $cfg_name & ".cfg", "-RASHNOT")
        FileDelete(@ScriptDir & "\" & $cfg_name & ".cfg")
        $file = FileOpen(@ScriptDir & "\" & $cfg_name & ".cfg", 2)
        FileWrite(@ScriptDir & "\" & $cfg_name & ".cfg", $text)
        FileClose($file)
        FileSetAttrib(@ScriptDir & "\" & $cfg_name & ".cfg", "-AHNOT+RS")
        MsgBox(0, "Config", "" & $cfg_name & ".cfg was succesfully saved." & @CRLF & @CRLF & "Click OK to continue.")
    Else
        $file = FileOpen(@ScriptDir & "\" & $cfg_name & ".cfg", 2)
        FileWrite(@ScriptDir & "\" & $cfg_name & ".cfg", $text)
        FileClose($file)
        FileSetAttrib(@ScriptDir & "\" & $cfg_name & ".cfg", "-AHNOT+RS")
        MsgBox(0, "Config", "" & $cfg_name & ".cfg was succesfully saved." & @CRLF & @CRLF & "Click OK to continue.")
    EndIf
EndSelect
WEnd

This is just this one time. :)

[font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version

Link to comment
Share on other sites

I fixed problem 1.)

It's not correct i think, you should do this:

$Text = GuiCtrlRead($edit) & $script_boxoÝ÷ Ú«¨µí¿ªê-y.ë-«Þ¶!yÉ"~믬·*bayìmz{"¢v®¶­sdb7G&æu&vBb33c´fÆU6fRÂBfÇC²fwC²gV÷C²æ6frgV÷C²FVâb33c´fÆU6fRf׳ÒgV÷C²æ6frgV÷C²´§W7BFBFRWFVç6öà
Edited by MsCreatoR

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

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