Sign in to follow this  
Followers 0
AliOzturk

Script for creating logs

3 posts in this topic

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



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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - 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

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  
Followers 0

  • Similar Content

    • P3rsp3ctiv3
      By P3rsp3ctiv3
      Hello how can I send a {Enter} into the edit window ($cmd)? I tried it first with:
      GUICtrlSetData($cmd, "Line 1" + "{ENTER}")
      but it doesn´t work. Can someone help me please?
      #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GUIConstants.au3> $Admin = GUICreate("Admin", 234, 168, 192, 229, $GUI_SS_DEFAULT_GUI, BitOR($WS_EX_OVERLAPPEDWINDOW,$WS_EX_TRANSPARENT,$WS_EX_WINDOWEDGE)) GUISetBkColor(0xB4B4B4) $exit = GUICtrlCreateButton("Close", 160, 136, 65, 25) $cmd = GUICtrlCreateEdit("",0, 0, 225, 137, $ES_AUTOVSCROLL + $WS_VSCROLL) GUICtrlSetData(-1, "") GUICtrlSetFont(-1, 10, 400, 0, "Candara") GUICtrlSetBkColor(-1, 0xE3E3E3) $cmd_clear = GUICtrlCreateButton("Clear", 9, 136, 65, 25) GUISetState(@SW_SHOW) HotKeySet("{f1}", CMD_1) HotKeySet("{f2}", CMD_2) While 1 $msg = GUIGetMsg(1) Switch $msg[0] Case $GUI_EVENT_CLOSE Exit Case $exit GUIDelete($Admin) Exit EndSwitch WEnd Func CMD_1(); GUICtrlSetData($cmd, "Line 1" & "{ENTER}") GUICtrlSetData($cmd, "Line 2" & "{ENTER}") EndFunc Func CMD_2(); GUICtrlSetData($cmd, "Line 3" & "{ENTER}") GUICtrlSetData($cmd, "Line 4" & "{ENTER}") EndFunc
    • nacerbaaziz
      By nacerbaaziz
      hello
      please i need to link a progress bar with a time can you help me?
      e.g
      i want to set a progress bar for 10 sec
      am waiting for your answers
      thank you.
    • AdminC
      By AdminC
      $Imglocation = @ScriptDir&"\Image\testimg.bmp" _GDIPlus_Startup() Local $Bitmap = _GDIPlus_BitmapCreateFromFile($Imglocation) Local $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($Bitmap) Local $imgSize = _WinAPI_GetBitmapDimension($hBitmap) Local $imgBits = DllStructCreate('dword[' & (DllStructGetData($imgSize, 'X') * DllStructGetData($imgSize, 'Y')) & ']') _WinAPI_GetBitmapBits($hBitmap, DllStructGetSize($imgBits), DllStructGetPtr($imgBits)) ;_WinAPI_DisplayStruct($imgBits) MsgBox(0, "", DllStructGetData($imgBits, 1, 1)) _GDIPlus_Shutdown()  
    • AdminC
      By AdminC
      #RequireAdmin
      #include <SendMessage.au3>
      #include <WinAPI.au3>
      #include <WindowsConstants.au3>
      #include <GDIPlus.au3>
      #include <GUIConstantsEx.au3>
      #include <WinAPIGdi.au3>
      #include <Array.au3>
      #include <WinAPIDiag.au3>
      $Imglocation = @ScriptDir&"\Image\testimg.bmp"
      _GDIPlus_Startup()
      Local $Bitmap = _GDIPlus_BitmapCreateFromFile($Imglocation)
      Local $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($Bitmap)
      Local $imgSize = _WinAPI_GetBitmapDimension($hBitmap)
      Local $imgBits = DllStructCreate('dword[' & ($imgSize.X * $imgSize.Y) & ']')
      _WinAPI_GetBitmapBits($hBitmap, DllStructGetSize($imgBits), DllStructGetPtr($imgBits))
      _WinAPI_DisplayStruct($imgBits)
      MsgBox(0, "", DllStructGetData($imgBits, 1, 1)) 
      _GDIPlus_Shutdown()
      DllstructGetData can't get data color B, G, R value. Who's know that? teach me plz
    • AdminC
      By AdminC
      #RequireAdmin
      #include <SendMessage.au3>
      #include <WinAPI.au3>
      #include <WindowsConstants.au3>
      #include <GDIPlus.au3>
      #include <GUIConstantsEx.au3>
      #include <WinAPIGdi.au3>
      #include <Array.au3>
      #include <WinAPIDiag.au3>
      $Imglocation = @ScriptDir&"\Image\testimg.bmp"
      _GDIPlus_Startup()
      Local $Bitmap = _GDIPlus_BitmapCreateFromFile($Imglocation)
      Local $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($Bitmap)
      Local $imgSize = _WinAPI_GetBitmapDimension($hBitmap)
      Local $imgBits = DllStructCreate('dword[' & ($imgSize.X * $imgSize.Y) & ']')
      _WinAPI_GetBitmapBits($hBitmap, DllStructGetSize($imgBits), DllStructGetPtr($imgBits))
      _WinAPI_DisplayStruct($imgBits)
      MsgBox(0, "", DllStructGetData($imgBits, 1, 1)) 
      _GDIPlus_Shutdown()
      DllstructGetData can't get data color B, G, R value. Who's know that? teach me plz