Jump to content

tonyatcodeleakers

Active Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by tonyatcodeleakers

  1. Bump- is there another way to go about this or is it impossible
  2. As i said in my first post, i showed how i tried to go about doing it but it did not work so i removed it from the source.
  3. I took an example script i found a while back if you want ill try and find the link Ok, it may show up black since i cant send the settings file, also this is a simplified version because i didnt feel like uploading the udfs i used. #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GUIRichEdit.au3> #include <GUIEdit.au3> #include <GuiMenu.au3> #include <GuiListBox.au3> #include <math.au3> #include <Array.au3> Opt("GUIOnEventMode", 1) Global $background, $fontsize, $fontname, $background2 Global $aMarquee[8], $isitsame, $isitsame1 Global $_Words2[4]=['thread','level','self'] LoadCFG( ) $Snip = IniReadSectionNames ( "[snippets].ini" ) _ArrayDisplay($Snip) $main = GUICreate( "Tonys Script Editor", 800, 600, Default, Default, BitOR( $GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP ) ) GUISetBkColor($background2) $menu1 = GUICtrlCreateMenu("File") $menu1item1 = GUICtrlCreateMenuItem("Save", $menu1) $menu1item3 = GUICtrlCreateMenuItem("Open", $menu1) $menu1item2 = GUICtrlCreateMenuItem("Exit", $menu1) $menu2 = GUICtrlCreateMenu("Edit") $menu2item1 = GUICtrlCreateMenuItem("Undo", $menu2) $menu2item2 = GUICtrlCreateMenuItem("Redo", $menu2) $menu2item3 = GUICtrlCreateMenuItem("Select All", $menu2) $menu2item4 = GUICtrlCreateMenuItem("Copy", $menu2) $menu2item5 = GUICtrlCreateMenuItem("Cut", $menu2) $menu2item6 = GUICtrlCreateMenuItem("Paste", $menu2) $menu3 = GUICtrlCreateMenu("Options") $ftp3 = GUICtrlCreateMenuItem("Upload to FTP", $menu3) $menu4 = GUICtrlCreateMenu("Snipps") $edit = _GUICtrlRichEdit_Create( $main, "", 5, 5, 790, 450, BitOR( $ES_AUTOHSCROLL, $ES_AUTOVSCROLL, $WS_HSCROLL, $WS_VSCROLL, $ES_MULTILINE) ) _WinAPI_SetFont( $edit, _WinAPI_CreateFont( 16, 0, 0, 0, 500, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, "Courier New" ) ) _GUICtrlRichEdit_SetBkColor( $edit, $background ) _GUICtrlRichEdit_SetLimitOnText($edit, 100000) $console = _GUICtrlEdit_Create( $main, "", 5, 460, 790, 90, BitOR( $ES_AUTOVSCROLL, $WS_VSCROLL, $ES_MULTILINE) ) _WinAPI_SetFont( $console, _WinAPI_CreateFont( 15, 0, 0, 0, 500, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, "Courier New" ) ) $bar = _GUICtrlStatusBar_Create( $main, Default, " Lines = 1 | Functions = 0" ) _WinAPI_SetFont( $bar, _WinAPI_CreateFont( 16, 0, 0, 0, 100, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, "Courier New Bold" ) ) $mnu = GUICtrlCreateContextMenu( GUICtrlCreateDummy( ) ) $mnuUndo = GUICtrlCreateMenuItem( "Undo", $mnu ) $mnuRedo = GUICtrlCreateMenuItem( "Redo", $mnu ) GUICtrlCreateMenuItem( "", $mnu ) $mnuCut = GUICtrlCreateMenuItem( "Cut", $mnu ) $mnuCopy = GUICtrlCreateMenuItem( "Copy", $mnu ) $mnuPaste = GUICtrlCreateMenuItem( "Paste", $mnu ) GUICtrlCreateMenuItem( "", $mnu ) $mnuSelectAll = GUICtrlCreateMenuItem( "Select All", $mnu ) _GUICtrlRichEdit_SetEventMask( $edit, $ENM_MOUSEEVENTS ) GUISetState( @SW_SHOW ) GUIRegisterMsg( $WM_SIZE, "WM_SIZE" ) GUIRegisterMsg( $WM_NOTIFY, "WM_NOTIFY" ) Global $pos, $line, $column, $x, $y, $special = 0, $save Global Const $COLOR_RED = 2037680 Global Const $COLOR_GREEN = 32768 Global Const $COLOR_BLACK = 0 Global Const $COLOR_BLUE = 16711680 Global Const $COLOR_PUR = 220208255 Global $list = 0 While True $action = GUIGetMsg() If $action == $gui_event_close Then $save = MsgBox(3, "Tonys Script Editor V4", "Do you want to save before close?") If $save == 6 Then Local $bloop = 1 While $bloop = 1 Local FileSaveDialog( "Save File", @SCRIPTDIR, "All (*.*)" ) If @error = 1 Or $text = "" Then $bloop = 0 MsgBox(64, "Tonys Script Editor V4", "Error") Else FileWrite($text, _guictrlrichedit_gettext($edit)) FileWrite($text & "-com.txt", _guictrledit_gettext($console)) $bloop = 0 MsgBox(64, "Tonys Script Editor V4", "File saved successfuly") EndIf WEnd _guictrlrichedit_destroy($edit) Exit ElseIf $save == 7 Then _guictrlrichedit_destroy($edit) Exit Else ContinueLoop EndIf EndIf If $action == $menu1item1 Then Local $bloop = 1 While $bloop = 1 $textt = FileSaveDialog( "Save File", @SCRIPTDIR, "All (*.*)", 2 ) If @error = 1 Or $textt = "" Then $bloop = 0 MsgBox(64, "Tonys Script Editor V4", "Error") Else FileWrite($textt, _guictrlrichedit_gettext($edit)) FileWrite($textt & "-com.txt", _guictrledit_gettext($console)) $bloop = 0 MsgBox(64, "Tonys Script Editor V4", "File saved successfuly") EndIf WEnd ElseIf $action == $menu1item2 Then _guictrlrichedit_destroy($edit) Exit EndIf If $action == $menu2item1 Then _guictrlrichedit_undo($edit) ElseIf $action == $ftp3 Then Run("TonysFTP.exe") $sMsg = "This tool was coded and compiled" & @CRLF & @CRLF $sMsg &= "By Tony@codeleakers" & @CRLF & "Version: 1.0" $aRet = _Toast_Show(0, "Upload to FTP", $sMsg, 0.75) _Toast_Hide() ElseIf $action == $menu2item2 Then _guictrlrichedit_redo($edit) ElseIf $action == $menu1item3 Then $tonvar = FileOpenDialog("Choose File to Open", "C:\Windows\", "Files (*.gsc;*.txt*;.cpp;*.au3)", 1 + 4) $openvt = FileRead($tonvar) $openvt2 = FileRead($tonvar & "-com.txt") _GUICtrlEdit_SetText($console, $openvt2) _guictrlrichedit_settext($edit, $openvt) ElseIf $action == $menu2item5 Then _guictrlrichedit_cut($edit) ElseIf $action == $menu2item4 Then _guictrlrichedit_copy($edit) ElseIf $action == $menu2item6 Then _guictrlrichedit_paste($edit) ElseIf $action == $menu2item3 Then _guictrlrichedit_setsel($edit, 0, -1) EndIf WEnd Func WM_SIZE( $hWnd, $iMsg, $wParam, $lParam ) Local $iWidth = _WinAPI_LoWord( $lParam ) Local $iHeight = _WinAPI_HiWord( $lParam ) _WinAPI_MoveWindow( $edit, 5, 5, $iWidth - 10, $iHeight - 130 ) _WinAPI_MoveWindow( $bar, 0, 0, 0, 0 ) _WinAPI_MoveWindow( $console, 5, $iHeight - 120, $iWidth - 10, 90 ) Return 0 EndFunc Func LoadCFG( ) $file = FileRead( "Settings.cfg" ) ;Sleep( 200 ) $file = StringSplit( $file, "=" & @CRLF ) ;Sleep( 200 ) For $i = 1 To UBound( $file ) - 1 If $file[$i] == "editor.background" Then $background = $file[$i+1] If $background == 0 Then $background = 16777215 EndIf ;Sleep( 300 ) ElseIf $file[$i] == "editor.background2" Then $background2 = $file[$i+1] If $background2 == 0 Then $background2 = 16777215 EndIf ;Sleep( 300 ) EndIf Next ;Sleep( 500 ) EndFunc
  4. Im making a simple notepad program with highlighting, and i want to add snippet support. It already had simple things like add init, or for in the menu but what im looking to do is be able to save my snippets in a ini file and be able to add them as menu items at anytime. i know how i want to go about doing it but i can't seem to get it to work I have the ini file set up like so, [hello] snip =hello [wassup] snip =wassup [multiline] snip=hi there bob i wanted to then have the program do this, $Snip = IniReadSectionNames ( "[snippets].ini" ) For i=0 To $Snip[0] +1 $menu4item[$i] = GUICtrlCreateMenuItem("Dvar", $menu4) GUICtrlSetOnEvent($menu4item[$i], "readinisec") Next but i realised this would not work unless i added parameters to setonevent which i dont believe i can. (readinisec, would then read snip fromt the section given in the parameter and add it to the richedit) So does anyone know of a better way to go about this, or if it is possible
  5. Well I can assure my motives Are nothing to be questioned, and if it truly bothers you i will happily pm you the way i will be using it. The program itself will just highlight differences between the hex of two similar files, i should of just explained it that way.
  6. Well i dont know how to explain it without making it sound malicious, but i can assure its not. Im opening two files created from a similar source, so lets say a gct file. (keeps data like a .txt but cannot be opened in notepad properly. Usualy used as preset data) so two gct files are opened and converted to hex the hex data is compared and the program will highlight the differences. This isnt the way ill be using it but lets say you have a hotkey setup on a midi program and it saves to a gct file. then you change one variable and save it as a separate preset. The program will find the change made and allow you to input a different value in the correct spot. So lets say the program doesnt allow 5 to be used you can add five manually.
  7. Hmm Im scanning a huge feild of text, Ridiculously huge. And it gives me the error, Array maximum size exceeded. So guinness maybe your challenge has been renewed. Also Im comparing two sources, and it only shows how many errors there are not what they are or where
  8. First off im sorry for making so many help threads over the past couple of days but im new to autoit and im still figuring it out. I know there is a stringcompare function that tells if the string is equal larger or smaller. But what im looking for is a way to also show what text is differant, so if the first string is "12345" and the second was "12354" it would return 54 as being differant and preferable the location of the string. I assumed a udf would have been available but i couldnt find anything. Could somebody link me if a udf is available. Thanks in advanced
  9. Thanks again nellie but to be fair i did ask how to go about it, not for you to code it for me. But regardless thank you
  10. Thanks nessie, exactly what i needed, just to make it look cleaner how should i go about formatting it so that the texts adds a space in between every 2 digits and only allows 16 columns.
  11. I was wondering if there were any udf's available to retrieve the hex of a file, much like hxd. I did some research and nothing came up. All im looking to do is let say, select a file and have it return the hex information shown in a format like so,. Thanks in advanced
  12. Sorry, should have edited my original post instead of making a second post
  13. bump, im probrobly going to add a progress bar for uploading, and a ftp download option.
  14. Thanks to both of you, If there as hard to learn as path node logic im going to be in for a long night
  15. One more question, im still trying to figure out how to properly use StringRegExp, how would i add the ability to ignore comments. in the case of the gsc language comments are marked by either //, or /* comment in here */ if the second form of comment would be hard to ignore i understand.
  16. Ok, so iv read through the help file for StringRegExp and the explanations for the terms that can be used to find patterns (eg [^:class:], (?i..) ), but im still lost. So my main question,is could someone link me to an in depth tutorial for the use of StringRegExp that has explanations of the Terms that can be used with it to find patterns, and if one doesn't exists could someone provide help on understanding it?
  17. I found a simple autoit ftp upload script a while back that had no gui to it and required you to put your log in info into the source before compiling to use. I found this a little frustrating since i have multiple ftp accounts, and if an error were to come about i would not know. So i made this. (other images) It gives you constant updates from the scroll bar (Melba's Marquee udf) that tells any errors and also writes them to a log file. It saves your info every time after logging in. Any files that will take longer than 20 seconds to upload will cause the GUI to hide and using melba's toast UDF a notification appears that notify you of the files size and why the program is hidden. link to Marquee UDF - Link to toast UDF - ftp.au3
  18. will do, and the issue is it doesn't highlight but instead automatically applies the text.
  19. Thanks, sorry. Im suprised that didnt show up in my several Google searches.
  20. Odd, im on the current beta release and when using this outside of the examples instead of highlighting the suggestion and allowing you to hit enter to confirm, it automatically applies it. And because i know someone will ask i did add #include-once
  21. Sorry for not replying sooner, but it fixed the issue. BTW is there anyway to bypass the 35000 charector limit for richedit. I was editing something only to find that half of it got cut off
×
×
  • Create New...