Mechaflash Posted May 3, 2012 Share Posted May 3, 2012 (edited) I've also made a habit of saving every script that seems interesting to me in a folder called "script bank", it's already grown to be 150+ mb and it's very damn handy to use when creating new scripts because I tend to separate functions that do an intended action into categories, this way I can just do a quick search through the folder, and I'll have a working script in no-time after a few copy and paste maneuvers.o.0 you should make a mini-app for your categorized functions to reference and help insert into your current projects... kinda like taxonomy for AutoIT functions =D.EDIT: I think I'm gonna make one for myself. A multi-list GUI to search categories and subcategories of snippets/scripts which references the .au3 and function name (if applicable) Edited May 3, 2012 by mechaflash213 Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
Dasttann777 Posted May 4, 2012 Author Share Posted May 4, 2012 Thankyou so much for the help. I am in the middle of adding mre functions to my Hunterpad known as "Traps", in which you type in a group of text, and then when you click on the Release Button, the text you wrote in the Trap Window will be inserted into the text. I have done quite well so far, but the text replaces all of my other text, instead of adding it. Should I use a string, or what do I do? My Code: expandcollapse popup#include <GUIConstants.au3> #include <GuiStatusBar.au3> #include <WinAPI.au3> Opt("TrayMenuMode", 1) $Form1 = GUICreate("Hunterpad", 1112, 561, 147, 112) $cEdit = GUICtrlCreateEdit("", 0, 32, 1361, 673) GUICtrlSetData(-1, "") GUICtrlCreateLabel(StringLen($cEdit),50,10) $File = GUICtrlCreateMenu("&File") $New = GUICtrlCreateMenuItem("New", $File) $MenuItem4 = GUICtrlCreateMenuItem("Save", $File) $MenuItem5 = GUICtrlCreateMenuItem("Save As...", $File) $Save = GUICtrlCreateMenuItem("Open", $File) $MenuItem7 = GUICtrlCreateMenuItem("Print", $File) $MenuItem6 = GUICtrlCreateMenuItem("Exit", $File) $MenuItem1 = GUICtrlCreateMenu("&Edit") $MenuItem8 = GUICtrlCreateMenuItem("Undo (Press Ctrl-Z)", $MenuItem1) $MenuItem9 = GUICtrlCreateMenuItem("Redo (Press Ctrl-Y)", $MenuItem1) $MenuItem3 = GUICtrlCreateMenu("&Help") $About = GUICtrlCreateMenuItem("About... (Shuts down Hunterpad)", $MenuItem3) $HTU = GUICtrlCreateMenuItem("&Help ", $MenuItem3) $HTML = GUICtrlCreateButton("&Html",20,5) $Pin1 = GUICtrlCreateButton("Rusty Trap",100,5) $Release = GUICtrlCreateButton("Release Rusty",160,5) _GUICtrlStatusBar_Create($cEdit) GUISetState(@SW_SHOW) Local $sSaved_Edit = "" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $HTML GUICtrlSetData($cEdit,"<html><head></head><body></body></html>") Case $Pin1 $PinI = InputBox("Rusty Trap", "Have a document Draft, that you do not want to lose, but need to temporarily store? Copy and Paste the Text into here, you can reuse it with the Release Rusty Button!(Use Carefully as it will replace all of your current text") Case $New GUICtrlSetData($cEdit, "") ; Empty the control Case $GUI_EVENT_CLOSE Exit Case $Release GUICtrlSetData($cEdit,$PinI) Case $Save $FileOpen = FileOpenDialog("", "", "Html Documents(* .html)|Text Documents(*.txt)|All(*.*)") $FileRead = FileRead($FileOpen) Send($FileRead) Case $MenuItem7 $sPrintFile = "c:image.png" Case $HTU MsgBox(0, "Help", "Hunterpad is easy to use, and very basic. ||Change Notes: 1.0 - Hunterpad Released Here are the current Hotkeys: Ctrl-Z - Undo Ctrl-Y - Redo") Case $About MsgBox(0, "About", "Made by Dasttann_Software Designer_Website Builder_Computer Fanatic>>>>>>>>>>>Hunter Version: 1.0>>>>>>>>>>>>>>") Run('Rundll32.exe "' & @SystemDir & 'mshtml.dll",PrintHTML "' & $sPrintFile & '"', @SystemDir) Case $MenuItem6 Exit Case $MenuItem4 ; Get current content of edit control $sCurrent_Edit = GUICtrlRead($cEdit) ; Has it changed? If $sCurrent_Edit <> $sSaved_Edit Then ; Get a filename to save to $sFile = FileSaveDialog("Save", "C:", "All(*.*)", 16, "untitled") ; Open a file overwriting any existing one $hFile = FileOpen($sFile, 2) ; Write the file with the current data FileWrite($hFile, $sCurrent_Edit) ; Close the file FileClose($hFile) ; Store the current content for future comparisons $sSaved_Edit = $sCurrent_Edit EndIf EndSwitch WEnd Much Help will be appreciated Please Help! Check out my new site!Current Projects:[list][*]Hunter Console - A Small Gadget[*]HunterPad - Basic Notepad aimed at Programmers[*]Betters UP! - Betting Game[/list] Link to comment Share on other sites More sharing options...
Mechaflash Posted May 4, 2012 Share Posted May 4, 2012 Please Help! GUICtrlCreateInput()GUICtrlRead()SendKeepActive()Send() Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
Dasttann777 Posted May 4, 2012 Author Share Posted May 4, 2012 GUICtrlCreateInput()GUICtrlRead()SendKeepActive()Send()Sorry for the Noob question, but how would I implement this? Check out my new site!Current Projects:[list][*]Hunter Console - A Small Gadget[*]HunterPad - Basic Notepad aimed at Programmers[*]Betters UP! - Betting Game[/list] Link to comment Share on other sites More sharing options...
Mechaflash Posted May 7, 2012 Share Posted May 7, 2012 When you say but the text replaces all of my other text, instead of adding it. are you talking about its replacing all of the other text in your GuiCtrlCreateEdit() or in the opened file? Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
Dasttann777 Posted May 7, 2012 Author Share Posted May 7, 2012 Its repalcing all of my other text. Check out my new site!Current Projects:[list][*]Hunter Console - A Small Gadget[*]HunterPad - Basic Notepad aimed at Programmers[*]Betters UP! - Betting Game[/list] Link to comment Share on other sites More sharing options...
Mechaflash Posted May 7, 2012 Share Posted May 7, 2012 (edited) $var = GUICtrlRead($cEdit) GUICtrlSetData($cEdit, $var & @LF & $PinI) Store what's already in $cEdit to $var, then instead of just emptying $cEdit to insert $PinI, you're appending whats in $PinI to the end of what you already have in $cEdit. Edited May 7, 2012 by mechaflash213 Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
Dasttann777 Posted May 8, 2012 Author Share Posted May 8, 2012 That is perfect! Thankyou so much! Check out my new site!Current Projects:[list][*]Hunter Console - A Small Gadget[*]HunterPad - Basic Notepad aimed at Programmers[*]Betters UP! - Betting Game[/list] Link to comment Share on other sites More sharing options...
Dasttann777 Posted May 9, 2012 Author Share Posted May 9, 2012 Helllo Again! I am trying to make a "Font" Function, but all of my attempts have failed! Here is my code: expandcollapse popup;Includes #include <GUIConstants.au3> #include <GuiStatusBar.au3> #include <WinAPI.au3> #include <ButtonConstants.au3> #include <GuiScrollBars.au3> #include <GuiEdit.au3> #include <Misc.au3> #include <Clipboard.au3> #NoTrayIcon Opt("TrayMenuMode", 1) ;Beggining SOund Beep(32767,100) Beep(15000,100) Beep(7500,100) Beep(5000,100) Beep(2500,100) ;Gui Creation $Form1 = GUICreate("Hunterpad", 1112, 561, 147, 112) $cEdit = GUICtrlCreateEdit("", 0, 32, 1361, 673) GUICtrlSetData(-1, "") GUICtrlCreateLabel(StringLen($cEdit),50,10) $File = GUICtrlCreateMenu("&File") $New = GUICtrlCreateMenuItem("New", $File) $MenuItem4 = GUICtrlCreateMenuItem("Save", $File) $MenuItem5 = GUICtrlCreateMenuItem("Save As...", $File) $Save = GUICtrlCreateMenuItem("Open", $File) $MenuItem7 = GUICtrlCreateMenuItem("Print", $File) $MenuItem6 = GUICtrlCreateMenuItem("Exit", $File) $MenuItem1 = GUICtrlCreateMenu("&Edit") $MenuItem8 = GUICtrlCreateMenuItem("Undo (Press Ctrl-Z)", $MenuItem1) $MenuItem9 = GUICtrlCreateMenuItem("Redo (Press Ctrl-Y)", $MenuItem1) $MenuItem3 = GUICtrlCreateMenu("&Help") $About = GUICtrlCreateMenuItem("About...", $MenuItem3) $HTU = GUICtrlCreateMenuItem("&Help ", $MenuItem3) $HTML = GUICtrlCreateButton("&Html",20,5) $Pin1 = GUICtrlCreateButton("Rusty Trap",100,5) $Release = GUICtrlCreateButton("Release Rusty",160,5) $Find = GUICtrlCreateButton("Find",240,5) $Find_and_Replace = GUICtrlCreateButton("Find and Replace",280,5) $Font = GUICtrlCreateButton("Font..",380,5) $context = GUICtrlCreateContextMenu($cEdit) $CB = _ClipBoard_Open($cEdit) $TT = TrayTip("Welcome!", "Hunterpad is Fun and Easy to Use!", 10,1) $SB = _GUIScrollBars_Init($cEdit) $SB1 = _GUIScrollBars_EnableScrollBar($cEdit) _GUICtrlStatusBar_Create($form1) Break(1) GUISetState(@SW_SHOW) Local $sSaved_Edit = "" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Find _GuiCtrlEdit_Find($cEdit,False) Case $Find_and_Replace _GuiCtrlEdit_Find($cEdit,True) Case $HTML _GUICtrlEdit_InsertText($cEdit,"<html><head></head><body></body></html>") Case $Pin1 $PinI = InputBox("Rusty Trap", "Have a small snippet, that you do not want to lose, but need to temporarily store? Copy and Paste the Text into here, you can reuse it with the Release Rusty Button! ") ClipPut($Pin1) TrayTip("Clipboard","Copied",5) Case $New GUICtrlSetData($cEdit, "") ; Empty the control Case $GUI_EVENT_CLOSE Exit Case $Release $var = GUICtrlRead($cEdit) GUICtrlSetData($cEdit, $var & @LF & $PinI) Case $Release GUICtrlSetData($cEdit,$PinI) Case $Save $FileOpen = FileOpenDialog("", "", "Html Documents(* .html)|Text Documents(*.txt)|All(*.*)") $FileRead = FileRead($FileOpen) Send($FileRead) Case $MenuItem7 $sPrintFile = "c:image.png" Case $HTU MsgBox(0, "Help", "Hunterpad is easy to use, and very basic. ||Change Notes: 1.0 - Hunterpad Released Here are the current Hotkeys: Ctrl-Z - Undo Ctrl-Y - Redo") Case $About MsgBox(0, "About", "Made by Dasttann_Software Designer_Website Builder_Computer Fanatic>>>>>>>>>>>Hunter Version: 1.0>>>>>>>>>>>>>>") Case $MenuItem6 Exit Case $MenuItem4 ; Get current content of edit control $sCurrent_Edit = GUICtrlRead($cEdit) ; Has it changed? If $sCurrent_Edit <> $sSaved_Edit Then ; Get a filename to save to $sFile = FileSaveDialog("Save", "C:", "All(*.*)", 16, "untitled") ; Open a file overwriting any existing one $hFile = FileOpen($sFile, 2) ; Write the file with the current data FileWrite($hFile, $sCurrent_Edit) ; Close the file FileClose($hFile) ; Store the current content for future comparisons $sSaved_Edit = $sCurrent_Edit EndIf ;###### Case $Font;############# $FS = _ChooseFont();# Case $FS;###################### GUICtrlSetFont($cEdit, $FS);##### EndSwitch WEnd Check out my new site!Current Projects:[list][*]Hunter Console - A Small Gadget[*]HunterPad - Basic Notepad aimed at Programmers[*]Betters UP! - Betting Game[/list] Link to comment Share on other sites More sharing options...
guinness Posted May 9, 2012 Share Posted May 9, 2012 (edited) Read the help file, what does _ChooseFont return? Not a string as you have it but an array instead. I've noticed from following your posts passively, that most of your problem(s) can easily be solved if you took that little bit of extra time to read the help file properly, before jumping in feet first. Which was demonstrated here. $FS = _ChooseFont() GUICtrlSetFont($cEdit, Default, Default, Default, $FS[2]) Edited May 9, 2012 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 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