CyberAssassin Posted October 5, 2007 Share Posted October 5, 2007 CODE#include <GUIConstants.au3> ; GUI GuiCreate("Converter", 400, 50) ; Button $Button_1 = GuiCtrlCreateButton("Convert to Hex", 0, 0, 200, 50) $Button_2 = GUICtrlCreateButton("Convert to String", 200, 0, 200, 50) Func _StringInsert($hex) $input = InputBox("Text to Binary Converter", "Text to Convert", "", "", 400, 25) $Bin_convert = StringToBinary($input) $convert = hex($bin_convert) Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send($convert) EndFunc Func _StringInsert($text) $input = InputBox("Binary to Text Converter", " Convert to Text", "", "", 400, 25) $Bin_convert = BinaryToString($input) Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send($convert) EndFunc GuiSetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 Case $msg = $Button_2 EndSelect WEnd how do i call functions like i have two functions and when i press convert to hex i want the text to be converted to hex/binary then i want notepad to open and write the converted code. can someone help me please. Link to comment Share on other sites More sharing options...
aslani Posted October 5, 2007 Share Posted October 5, 2007 (edited) The only thing I notice is that your Input should be outside the Functions. EDIT: Example: ; Button $Button_1 = GuiCtrlCreateButton("Convert to Hex", 0, 0, 200, 50) Func _StringInsert($hex) $Bin_convert = StringToBinary($hex) ; Take Note, call $hex not $input $convert = hex($bin_convert) Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send($convert) EndFunc GuiSetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 $input = InputBox("Text to Binary Converter", "Text to Convert", "", "", 400, 25) $hex = GUICtrlRead($input) _StringInsert($hex) Case $msg = $Button_2 EndSelect WEnd Edited October 5, 2007 by aslani [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version Link to comment Share on other sites More sharing options...
CyberAssassin Posted October 5, 2007 Author Share Posted October 5, 2007 (edited) Thanks! Edited October 5, 2007 by CyberAssassin Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 5, 2007 Share Posted October 5, 2007 CODEWhile 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 Case $msg = $Button_2 EndSelectWEndhow do i call functions like i have two functions and when i press convert to hex i want the text to be converted to hex/binary then i want notepad to open and write the converted code. can someone help me please.Just put the function call right under the case:CODEWhile 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 _ButtonOneFunction() Case $msg = $Button_2 _ButtonTwoFunction() EndSelectWEnd Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
aslani Posted October 5, 2007 Share Posted October 5, 2007 Just put the function call right under the case:CODEWhile 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 _ButtonOneFunction() Case $msg = $Button_2 _ButtonTwoFunction() EndSelectWEnd lol, that works better His Func _StringInsert($hex) threw me off since he had that $hex inside the parenthesis. [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now