CodyBarrett Posted December 22, 2009 Share Posted December 22, 2009 (edited) This i made cause i was bored. lol. Features: *RealTime converstion *Ascii Values Per Character *Ascii -> Binary Formula *Binary Value *Binary message converted from What User has Typed. please tell me if i need to change anything... like if my formula is wrong, or if i could simplify it. expandcollapse popup#include <GUICONSTANTS.AU3> #include <WINDOWSCONSTANTS.AU3> #include <STATICCONSTANTS.AU3> #include <EDITCONSTANTS.AU3> #include <MISC.AU3> #Include <GuiEdit.au3> Opt ('GUIoneventmode', 1) $lastdata = '' $GUIX = 730 $lStyle = BitOR ($SS_CENTER, $SS_CENTERIMAGE) $EditStyle = BitOR($ES_MULTILINE, $ES_AUTOVSCROLL, $WS_TABSTOP,$WS_VSCROLL) $EditStyleEx = BitOR($EditStyle, $ES_READONLY) $GUI = GUICreate ('Binary Tutor', $GUIX, 700, -1, -1, -2138570616) GUISetBkColor (0x0,$GUI) GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit', $GUI) GUICtrlCreateLabel ('',0,0,$GUIX,15) GUICtrlSetBkColor (-1, 0x1c3fca) GUICtrlSetState (-1,$GUI_DISABLE) GUICtrlCreateLabel ('',0,15,$GUIX,15) GUICtrlSetBkColor (-1,0x15319d) GUICtrlSetState (-1,$GUI_DISABLE) GUICtrlCreateLabel ('x',0,0,30,30,$lStyle) GUICtrlSetColor (-1,0xFFFFFF) GUICtrlSetFont (-1,10,900,'','Tahoma') GUICtrlSetCursor (-1,0) GUICtrlSetOnEvent (-1,'_Exit') GUICtrlSetBkColor (-1,$GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel ('_',30,0,30,30,$lStyle) GUICtrlSetColor (-1,0xFFFFFF) GUICtrlSetFont (-1,10,900,'','Tahoma') GUICtrlSetCursor (-1,0) GUICtrlSetOnEvent (-1, '_Mini') GUICtrlSetBkColor (-1,$GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel (WinGetTitle ($GUI,''),60,0,$GUIX - 120,30,$lStyle,$GUI_WS_EX_PARENTDRAG) GUICtrlSetColor (-1,0xFFFFFF) GUICtrlSetFont (-1,10,900,'','Tahoma') GUICtrlSetBkColor (-1,$GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel ('',$GUIX - 40,0,60,30) GUICtrlSetBkColor (-1,$GUI_BKCOLOR_TRANSPARENT) GUICtrlSetState (-1,$GUI_DISABLE) GUICtrlCreateLabel ('Type In Here... And Will Automatically Be Converted.',10,35,$GUIX - 20,20,$lStyle) GUICtrlSetColor (-1,0xFFFFFF) GUICtrlSetFont (-1,10,900,'','Tahoma') GUICtrlSetBkColor (-1,$GUI_BKCOLOR_TRANSPARENT) $eText = GUICtrlCreateEdit ('',10, 60, $GUIX - 20,100,$EditStyle) GUICtrlSetColor (-1,0xFFFFFF) GUICtrlSetFont (-1,20,900,'','Tahoma') GUICtrlSetBkColor (-1,0x15319d) GUICtrlSetLimit (-1,90) GUICtrlCreateLabel ('The Formulas To Convert ASCII Characters To BINARY',10,165,$GUIX - 20,20,$lStyle) GUICtrlSetColor (-1,0xFFFFFF) GUICtrlSetFont (-1,10,900,'','Tahoma') GUICtrlSetBkColor (-1,$GUI_BKCOLOR_TRANSPARENT) $eConsole = GUICtrlCreateEdit ('',10, 190, $GUIX - 20,370,$EditStyleEx) GUICtrlSetColor (-1,0xFFFFFF) GUICtrlSetFont (-1,11,900,'','Tahoma') GUICtrlSetBkColor (-1,0x15319d) GUICtrlCreateLabel ('The Converted BINARY Values ( "/ 00100000 /" Separates Words)',10,560,$GUIX - 20,20,$lStyle) GUICtrlSetColor (-1,0xFFFFFF) GUICtrlSetFont (-1,10,900,'','Tahoma') GUICtrlSetBkColor (-1,$GUI_BKCOLOR_TRANSPARENT) $eBinary = GUICtrlCreateEdit ('',10, 585, $GUIX - 20,100,$EditStyleEx) GUICtrlSetColor (-1,0xFFFFFF) GUICtrlSetFont (-1,12,900,'','Tahoma') GUICtrlSetBkColor (-1,0x15319d) GUISetState () While 1 If $lastdata <> GUICtrlRead ($eText) Then _Convert (GUICtrlRead ($eText)) Sleep (100) WEnd Func _Convert ($Data) Local $tData, $iData, $1, $hWnd, $bin GUICtrlSetData ($eConsole,'') $tData = StringSplit ($Data,'') $hWnd = ControlGetHandle ($GUI,'','Edit2') $bin = '' For $1 = 1 To StringLen ($Data) $iData = 'Chr = "' & $tData[$1] & '"' & @CRLF & _ 'Ascii = ' & Asc ($tData[$1]) & @CRLF & _ 'Formula :' &@CRLF & _Math($tData[$1]) & @CRLF & _ 'Binary = ' & _ChrtoBin ($tData[$1]) & @CRLF & _ '—————————————————————————————————————————————————————' & @CRLF _GUICtrlEdit_AppendText ($hWnd,$iData) $bin &= _ChrtoBin ($tData[$1]) & ' ' Next GUICtrlSetData ($eBinary,StringReplace ($bin,'00100000', '/ 00100000 /')) $lastdata = $Data EndFunc Func _ChrtoBin ($chr) Local $asc, $bin, $2 $asc = Asc ($chr) $bin = '' For $2 = 7 To 0 step -1 If $asc >= 2 ^ $2 Then $bin &= 1 $asc -= 2 ^ $2 Else $bin &= 0 EndIf Next Return $bin EndFunc Func _Math ($chr) Local $form, $tform, $bin, $asc, $2, $base $asc = Asc ($chr) $bin = '' For $2 = 7 To 0 step -1 $base = @CRLF & $asc & ' >= ' & 2 ^ $2 $bin = StringReplace ($bin,' & ','') If $asc >= 2 ^ $2 Then $bin &= 1 $tform = $base & ' [ True ] ' & @TAB & StringTrimRight ($bin,1) & ' & 1' $asc -= 2 ^ $2 Else $bin &= 0 $tform = $base & ' [ False ]' & @TAB & StringTrimRight ($bin,1) & ' & 0' EndIf $form &= $tform Next Return $form EndFunc Func _Mini () GUISetState (@SW_MINIMIZE, $GUI) EndFunc Func _Exit () Exit EndFunc Edited December 23, 2009 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
darkjohn20 Posted December 22, 2009 Share Posted December 22, 2009 Interesting. Link to comment Share on other sites More sharing options...
CodyBarrett Posted December 22, 2009 Author Share Posted December 22, 2009 comments\suggestions\Critique? [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
darkjohn20 Posted December 22, 2009 Share Posted December 22, 2009 Nice, works good. Strange colors, but not hard to read. X on wrong side pisses me off Overall good. Link to comment Share on other sites More sharing options...
CodyBarrett Posted December 22, 2009 Author Share Posted December 22, 2009 (edited) thanks lol damnit.. i realised something XD my formula is wrong.. thats the forumla for BINtoASCII converstion not ASCIItoBIN... *sigh* simple change though... EDIT: fixed the Formula... Ugh now its huge and obnoxious Edited December 23, 2009 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] 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