Jump to content
Sign in to follow this  
AliOzturk

Script for creating logs

Recommended Posts

AliOzturk

Hello Auto IT

I wanna keep it short, so let's get started.

I like to store my account details for various sites and programs on a simple log file, It's personal preference and I know it's risky. I'm using somewhat a "form" when I'm typing in my accounts, so that It's easier for me to keep track on what site/program the account is for.

The form looks somewhat like this:

 

### Game / Site: <Here goes the link/name>

### Username: <Username>

### Password: <Password (Often written so only i know what it means>

### More info: <Like what realm or something like that>

 

Would it be possible to create a script in which makes a UI where i can type in those fields, and it will automaticly add it to my log file?

I would love to know how this could work, and what kind commands i should look into.

- AliOzturk

Share this post


Link to post
Share on other sites
water

To safely store your passwords AND automate login I would have a look at the open source tool KeePass and the >KeeForm tool from this site.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
UEZ

AliÖztürk,

try something like this here:

#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiButton.au3>

$sLog = @ScriptDir & "\MyLog.txt"
$hFile = FileOpen($sLog, 1)
$hGUI = GUICreate("Test", 350, 350, -1, -1, -1, -1)
GUICtrlCreateLabel("Password:", 32, 160, 63, 23, $SS_RIGHTJUST, -1)
GUICtrlSetFont(-1, 13, 400, 0, "Arial Narrow")
GUICtrlSetBkColor(-1, "-2")
GUICtrlCreateLabel("More Info:", 32, 190, 68, 23, $SS_RIGHTJUST, -1)
GUICtrlSetFont(-1, 13, 400, 0, "Arial Narrow")
GUICtrlSetBkColor(-1, "-2")
GUICtrlCreateLabel("Username:", 32, 130, 82, 23, $SS_RIGHTJUST, -1)
GUICtrlSetFont(-1, 13, 400, 0, "Arial Narrow")
GUICtrlSetBkColor(-1, "-2")
$iBtnSave = GUICtrlCreateButton("Save", 222, 300, 100, 30, -1, -1)
GUICtrlCreateLabel("Game / Site:", 28, 102, 88, 23, $SS_RIGHTJUST, -1)
GUICtrlSetFont(-1, 13, 400, 0, "Arial Narrow")
GUICtrlSetBkColor(-1, "-2")
$iInp1 = GUICtrlCreateInput("<Like what realm or something like that>", 122, 190, 200, 71, BitOR($ES_MULTILINE, $WS_VSCROLL), $WS_EX_CLIENTEDGE)
$iInp2 = GUICtrlCreateInput("<Password>", 122, 160, 200, 20, -1, $WS_EX_CLIENTEDGE)
$iInp3 = GUICtrlCreateInput("<Here goes the link/name>", 122, 102, 200, 20, -1, $WS_EX_CLIENTEDGE)
$iInp4 = GUICtrlCreateInput("<Username>", 122, 130, 200, 20, -1, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Create Log", 11, 20, 327, 49, BitOR($SS_CENTER, $SS_CENTERIMAGE) , -1)
GUICtrlSetFont(-1, 32, 400, 0, "Arial Narrow")
GUICtrlSetColor(-1, "0x0000FF")
GUICtrlSetBkColor(-1, "-2")
GUISetState(@SW_SHOW, $hGUI)


While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            FileClose($hFile)
            GUIDelete()
            Exit
        Case $iBtnSave
            FileWrite($hFile,   GUICtrlRead($iInp1) & @CRLF & _
                                GUICtrlRead($iInp2) & @CRLF & _
                                GUICtrlRead($iInp3) & @CRLF & _
                                GUICtrlRead($iInp4) & @CRLF & @CRLF)
            MsgBox(0, "Info", "Added text to logfile", 30)
    EndSwitch
WEnd

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
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
Sign in to follow this  

  • Similar Content

    • nooneclose
      By nooneclose
      My program has to first search for names in Column D that do not match up with column C. I got that search to work using arrays. It was slow and I could not figure out how to delete them so I just manually put coded the names that do not belong. I found their cell location but I do not know how to store that location and delete it.
      This is what I have so far.
      Local $NameToDelete1[6]  = _Excel_RangeFind($OpenWorkbook, "Smith, Bill") _ArrayDisplay($NameToDelete1, "Excel UDF: _Excel_RangeFind Example 1", "", 0, "|", "Sheet|Name|Cell|Value|Formula|Comment") _Excel_RangeDelete($OpenWorkbook.ActiveSheet, $NameToDelete1[2], $xlShiftUp)  
      Please help, I wanted to have this program done yesterday but I did not see this problem until yesterday. 
    • TrashBoat
      By TrashBoat
      So Im trying to make a simple 2d game and make some sort of collision detection so why not to make a 2 dimensional array but i have no clue how  to write it in multiple lines
      Global $map[5,5] = [0,0,0,0,0 _ [0,0,0,0,0 _ [0,0,0,0,0 _ [0,0,0,0,0 _ [0,0,0,0,0] something like this but it doesn't work
    • Zein
      By Zein
      #include "..\Include\Array.au3" #include "..\Include\File.au3" #include "..\Include\AutoItConstants.au3" Local $aRetArray Local $sFilePath = "n.csv" _FileReadToArray($sFilePath, $aRetArray, ",") ; _FileReadToArray($sFilePath, $aRetArray, $FRTA_COUNT, ",") _ArrayDisplay($aRetArray, "Original", Default, 8) The above code shows two versions of _FileReadToArray and both don't work as expected.
      The first one doesn't use the comma as a delimiter. (so I get a single column array)  I tried adding "Default" between $aRetArray and "," then it told me it had an incorrect number of parameters. 

      I looked again at the documentation:
       
      #include <File.au3> _FileReadToArray ( $sFilePath, ByRef $vReturn [, $iFlags = $FRTA_COUNT [, $sDelimiter = ""]] )
      And I with or without the flags params I should be getting a 2D array due to my file being a csv. 
      I then tried a regular flag, $FRTA_COUNT, and it tells me that I'm using a variable $FRTA_COUNT while it's not declared. Tried putting in 1 instead and it told me again, incorrect number of params. 

       
    • nooneclose
      By nooneclose
      I need to perform a subtotal in excel and I would like to automate this process using Autoit if possible like always any and all help will be greatly appreciated. 
      I can not find a good example but the two from Microsoft. Here is one of the two from msdn.microsoft.com/en-us/vba/excel-vba/articles/range-subtotal-method-excel
      I do not really understand how to translate this into AutoIt, but I gave it a try and here is what I have.
      $OpenRange      = "A1:E200" $xlSum          = -4157 $Added_Array[2] = [2, 3] $OpenRange.Subtotal("B1", $xlSum, $Added_Array, True, False, True) I just need to perform a subtotal on a range based on a header called department, and then perform a sum on the results.
    • nooneclose
      By nooneclose
      How to use _Excel_RangeSort to sort my excel file by three different headers Column A1, B1, and C1 have headers on which I want to sort by. The headers on which I want to sort are department, employee type, and name.
      I still really new to AutoIt so I do not actually know how to properly start this line or lines of code, to be honest. The example code is the best I can do.
      _Excel_RangeSort($OpenWorkbook, Default, "A1:C1", "1:1", $xlDescending, Default, $xlYes, Default, $xlSortRows) I just need to sort by those three headers in that order of department, employee type, and name, plus in descending order.
       
      any and all help would be greatly appreciated.  Thank you!
×