Jump to content

Your Diary


 Share

Recommended Posts

Well I pretty much quit on the project so I thought That i would release the source... It has comments everywhere... It is disorganized (I know) lol

Here is the installer Source

You guys are free to do w.e you want with it...

CODE
#NoTrayIcon

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****

#AutoIt3Wrapper_Icon=install.ico

#AutoIt3Wrapper_Compression=4

#AutoIt3Wrapper_Res_Comment=My Diary installer

#AutoIt3Wrapper_Res_Description=My Diary Installer

#AutoIt3Wrapper_Res_Fileversion=2.0.0.5

#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=y

#AutoIt3Wrapper_Res_LegalCopyright=Card123

#AutoIt3Wrapper_Res_File_Add=Diary.jpg

#AutoIt3Wrapper_Res_File_Add=Diary.ico

#AutoIt3Wrapper_Res_File_Add=beep-5.wav

#AutoIt3Wrapper_Res_File_Add=Uninstaller.exe

#AutoIt3Wrapper_Run_Tidy=y

#AutoIt3Wrapper_Tidy_Stop_onerror=n

#AutoIt3Wrapper_Run_Obfuscator=y

#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

Opt("GUIoneventmode", 1)

Global $change_dir

Global $a

$name = "My Diary" ; name of program

$iMsgBoxAnswer = MsgBox(4132, "My Diary Installer", "Would You Like To install My Diary?") ; Start The Instllation

Select

Case $iMsgBoxAnswer = 6 ;Yes

$change_dir = FileSelectFolder("Where Would You Like To Install?", "", 2 + 4, "C:\Program Files") ; Slelect where you want to downalod

If @error = 1 Then

_Exit() ; If there is an error it will exit

EndIf

$a = InputBox("My Diary Setup", "What Do you Want your password To Be?", "", "*") ; Ask for a password

If @error = 1 Then

_Exit() ; If error it will exit

EndIf

_Download() ; Download the program (More like install)

Case $iMsgBoxAnswer = 7 ;No

_Exit() ; If you select 'no' it will exit

EndSelect

Func _Exit() ; The exit function

$Exit = MsgBox(262452, "Exit", "Are You Sure You Want To Exit?")

If $Exit = 6 Then

Exit

EndIf

EndFunc ;==>_Exit

Func _Download() ; The install / download function

ProgressOn("My Diary Installer", "Installing My Diary", "Creating Folders") ; progress bar :)

DirCreate($change_dir & "/" & $name) ;Creates Main Folder

DirCreate($change_dir & "/" & $name & "/Saved Documents") ; creates Folder for you to save your files in

DirCreate(@StartMenuCommonDir & "/" & $name) ;Creates Startmenu Folder

Sleep(1000) ; Add a little sleep , Remove if you want it to go faster

ProgressSet(10, "Copying Files")

FileInstall("My Diary!.exe", $change_dir & "/" & $name & "/My Diary!.exe"); Main File

FileInstall("Uninstaller.exe", $change_dir & "/" & $name & "/Uninstaller.exe");Uninstaller

FileInstall("Diary.ico", $change_dir & "/" & $name & "/Diary.ico"); Icon

FileInstall("beep-5.wav", $change_dir & "/" & $name & "/beep5.wav"); beep FOr Alarm

FileInstall("Diary.jpg", $change_dir & "/" & $name & "/Diary.jpg"); Main Image

Sleep(1000) ; Add a little sleep , Remove if you want it to go faster

ProgressSet(25, "Creating Registry Enteries")

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'Password', 'REG_MULTI_SZ', _StringEncrypt(1, $a, "aarsh123", 5)) ; Your password Encrypted

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'font', 'REG_SZ', "12|700|0|Arial|0x000000|0") ; Main Font

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'font2', 'REG_SZ', "12|700|0|Arial|0x000000|0") ; To Do List Font

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'path', 'REG_SZ', $change_dir & "/" & $name) ; Path of where everything is installing

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\My Diary!", 'UninstallString', 'REG_SZ', $change_dir & "/" & $name & "/Uninstaller.exe") ; Where is the uninstaller?? ---- For Add and Remove Programs

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\My Diary!", 'DisplayName', 'REG_SZ', "My Diary!") ;Name To show on Add and Remove Programs

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\My Diary!", 'DisplayIcon', 'REG_SZ', $change_dir & "/" & $name & "/Diary.ico") ; icon For Add and Remove Programs

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'save', 'REG_SZ', $change_dir & "/" & $name & "/Saved Documents") ; Save Directory

RegWrite('HKEY_CLASSES_ROOT\.dd', '', 'REG_SZ', 'Diary_Document_File') ; File Accosiation

RegWrite('HKEY_CLASSES_ROOT\Diary_Document_File', '', 'REG_SZ', 'Diary Document'); File Accosiation

RegWrite('HKEY_CLASSES_ROOT\Diary_Document_File\shell\Open', '', 'REG_SZ', '&Open'); File Accosiation

RegWrite('HKEY_CLASSES_ROOT\Diary_Document_File\shell\Open\command', '', 'REG_SZ', $change_dir & "/" & $name & "/My Diary!.exe %1 %*"); File Accosiation

RegWrite('HKEY_CLASSES_ROOT\Diary_Document_File\DefaultIcon', '', 'REG_SZ', $change_dir & "/" & $name & "/Diary.ico"); File Accosiation

Sleep(1500) ; Add a little sleep , Remove if you want it to go faster

ProgressSet(50, "Creating Shortcuts")

FileCreateShortcut($change_dir & "/" & $name & "/My Diary!.exe", @DesktopDir & "\My Diary.lnk") ;Shortcuts

FileCreateShortcut($change_dir & "/" & $name & "/My Diary!.exe", @StartMenuCommonDir & "/" & $name & "/My Diary!.ink");Shortcuts

FileCreateShortcut($change_dir & "/" & $name & "/Uninstaller.exe", @StartMenuCommonDir & "/" & $name & "/Uninstaller.ink");Shortcuts

Sleep(1000) ; Add a little sleep , Remove if you want it to go faster

ProgressSet(65, "Writing Files")

FileWrite(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'path') & "/To Do List.Diary", _StringEncrypt(1, "To Do List", "012345", 2)) ;To do list encrypted as a .diary file... Which cannot be opened :/

Sleep(1000) ; Add a little sleep , Remove if you want it to go faster

ProgressSet(75, "Cleaning up") ; random

Sleep(500) ; Add a little sleep , Remove if you want it to go faster

ProgressSet(80, "Sleeping"); random

Sleep(500) ; Add a little sleep , Remove if you want it to go faster

ProgressSet(90, "Feeding the cat"); random

Sleep(500) ; Add a little sleep , Remove if you want it to go faster

ProgressSet(95, "Finishing Installation"); random

Sleep(500) ; Add a little sleep , Remove if you want it to go faster

ProgressSet(100, "Done"); Done

ProgressOff() ; Turn off progress

MsgBox(0, "Complete", $name & " Has been installed to your Computer") ;Done

Exit ;Exit

EndFunc ;==>_Download

While 1

Sleep(10)

WEnd

Func _StringEncrypt($i_Encrypt, $s_EncryptText, $s_EncryptPassword, $i_EncryptLevel = 1) ; Function to encrypt password not made by me!

If $i_Encrypt <> 0 And $i_Encrypt <> 1 Then

SetError(1)

Return ''

ElseIf $s_EncryptText = '' Or $s_EncryptPassword = '' Then

SetError(1)

Return ''

Else

If Number($i_EncryptLevel) <= 0 Or Int($i_EncryptLevel) <> $i_EncryptLevel Then $i_EncryptLevel = 1

Local $v_EncryptModified

Local $i_EncryptCountH

Local $i_EncryptCountG

Local $v_EncryptSwap

Local $av_EncryptBox[256][2]

Local $i_EncryptCountA

Local $i_EncryptCountB

Local $i_EncryptCountC

Local $i_EncryptCountD

Local $i_EncryptCountE

Local $v_EncryptCipher

Local $v_EncryptCipherBy

If $i_Encrypt = 1 Then

For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1

$i_EncryptCountG = ''

$i_EncryptCountH = ''

$v_EncryptModified = ''

For $i_EncryptCountG = 1 To StringLen($s_EncryptText)

If $i_EncryptCountH = StringLen($s_EncryptPassword) Then

$i_EncryptCountH = 1

Else

$i_EncryptCountH += 1

EndIf

$v_EncryptModified = $v_EncryptModified & Chr(BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountG, 1)), Asc(StringMid($s_EncryptPassword, $i_EncryptCountH, 1)), 255))

Next

$s_EncryptText = $v_EncryptModified

$i_EncryptCountA = ''

$i_EncryptCountB = 0

$i_EncryptCountC = ''

$i_EncryptCountD = ''

$i_EncryptCountE = ''

$v_EncryptCipherBy = ''

$v_EncryptCipher = ''

$v_EncryptSwap = ''

$av_EncryptBox = ''

Local $av_EncryptBox[256][2]

For $i_EncryptCountA = 0 To 255

$av_EncryptBox[$i_EncryptCountA][1] = Asc(StringMid($s_EncryptPassword, Mod($i_EncryptCountA, StringLen($s_EncryptPassword)) + 1, 1))

$av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA

Next

For $i_EncryptCountA = 0 To 255

$i_EncryptCountB = Mod(($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256)

$v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0]

$av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0]

$av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap

Next

For $i_EncryptCountA = 1 To StringLen($s_EncryptText)

$i_EncryptCountC = Mod(($i_EncryptCountC + 1), 256)

$i_EncryptCountD = Mod(($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256)

$i_EncryptCountE = $av_EncryptBox[Mod(($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256)][0]

$v_EncryptCipherBy = BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountA, 1)), $i_EncryptCountE)

$v_EncryptCipher &= Hex($v_EncryptCipherBy, 2)

Next

$s_EncryptText = $v_EncryptCipher

Next

Else

For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1

$i_EncryptCountB = 0

$i_EncryptCountC = ''

$i_EncryptCountD = ''

$i_EncryptCountE = ''

$v_EncryptCipherBy = ''

$v_EncryptCipher = ''

$v_EncryptSwap = ''

$av_EncryptBox = ''

Local $av_EncryptBox[256][2]

For $i_EncryptCountA = 0 To 255

$av_EncryptBox[$i_EncryptCountA][1] = Asc(StringMid($s_EncryptPassword, Mod($i_EncryptCountA, StringLen($s_EncryptPassword)) + 1, 1))

$av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA

Next

For $i_EncryptCountA = 0 To 255

$i_EncryptCountB = Mod(($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256)

$v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0]

$av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0]

$av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap

Next

For $i_EncryptCountA = 1 To StringLen($s_EncryptText) Step 2

$i_EncryptCountC = Mod(($i_EncryptCountC + 1), 256)

$i_EncryptCountD = Mod(($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256)

$i_EncryptCountE = $av_EncryptBox[Mod(($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256)][0]

$v_EncryptCipherBy = BitXOR(Dec(StringMid($s_EncryptText, $i_EncryptCountA, 2)), $i_EncryptCountE)

$v_EncryptCipher = $v_EncryptCipher & Chr($v_EncryptCipherBy)

Next

$s_EncryptText = $v_EncryptCipher

$i_EncryptCountG = ''

$i_EncryptCountH = ''

$v_EncryptModified = ''

For $i_EncryptCountG = 1 To StringLen($s_EncryptText)

If $i_EncryptCountH = StringLen($s_EncryptPassword) Then

$i_EncryptCountH = 1

Else

$i_EncryptCountH += 1

EndIf

$v_EncryptModified &= Chr(BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountG, 1)), Asc(StringMid($s_EncryptPassword, $i_EncryptCountH, 1)), 255))

Next

$s_EncryptText = $v_EncryptModified

Next

EndIf

Return $s_EncryptText

EndIf

EndFunc ;==>_StringEncrypt

Here is the Uninstaller...

CODE
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****

#AutoIt3Wrapper_Icon=uninstall.ico

#AutoIt3Wrapper_Compression=4

#AutoIt3Wrapper_Res_Comment=Uninstaller

#AutoIt3Wrapper_Res_Description=My Diary UnInstaller

#AutoIt3Wrapper_Res_Fileversion=2.0.0.3

#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=y

#AutoIt3Wrapper_Res_LegalCopyright=Card123

#AutoIt3Wrapper_Run_Tidy=y

#AutoIt3Wrapper_Tidy_Stop_onerror=n

#AutoIt3Wrapper_Run_Obfuscator=y

#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

$iMsgBoxAnswer = MsgBox(36, "My Diary Installer", "Are You Sure You want to Uninstall My Diary?") ; ASks if you are sure

Select

Case $iMsgBoxAnswer = 6 ;Yes

DirRemove(@StartMenuCommonDir & "My Diary", 1) ; removes files

DirRemove(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", "Path"), 1); removes files

FileDelete(@DesktopDir & "\My Diary.lnk"); removes files

RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'Password'); removes files

DirRemove(@StartMenuCommonDir & "/My Diary", 1); removes files

RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'font'); removes files

RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'font2'); removes files

RegDelete('HKEY_CLASSES_ROOT\.dd', ''); removes files

RegDelete('HKEY_CLASSES_ROOT\Diary_Document_File', ''); removes files

RegDelete('HKEY_CLASSES_ROOT\Diary_Document_File\shell\Open', ''); removes files

RegDelete('HKEY_CLASSES_ROOT\Diary_Document_File\shell\Open\command', ''); removes files

RegDelete('HKEY_CLASSES_ROOT\Diary_Document_File\DefaultIcon', ''); removes files

RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'Path'); removes files

RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\My Diary!", 'UninstallString'); removes files

RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\My Diary!", 'DisplayName'); removes files

RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\My Diary!", 'DisplayIcon'); removes files

RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'save'); removes files

MsgBox(0, "Done!", "My Diary Has Been Removed From Your Computer!"); removes files

Case $iMsgBoxAnswer = 7 ;No

MsgBox(0, "Cancel", "Setup Canceled") ; If you say no ...

exit

EndSelect

and last but not least... The program (I think i was doing something and then stopped so there may be an error).. And i didnt comment this .. but it is the easiest script you have ever seen in your life :party:

CODE
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****

#AutoIt3Wrapper_Icon=Diary.ico

#AutoIt3Wrapper_Compression=4

#AutoIt3Wrapper_Res_Comment=My Diary

#AutoIt3Wrapper_Res_Description=My Diary

#AutoIt3Wrapper_Res_Fileversion=2.0.0.2

#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=y

#AutoIt3Wrapper_Res_LegalCopyright=Card123

#AutoIt3Wrapper_Run_Tidy=y

#AutoIt3Wrapper_Tidy_Stop_onerror=n

#AutoIt3Wrapper_Run_Obfuscator=y

#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

;Made By Aarsh Vora... Thank You To Whoever gave me Ideas and Functions and Stuff :)

#include <GUIConstants.au3>

#include <Misc.au3>

Opt("TrayMenuMode", 1)

Opt("Trayoneventmode", 1)

Opt("GUIoneventmode", 1)

TrayCreateItem("About")

TrayItemSetOnEvent(-1, "_About")

TrayCreateItem("Change Password")

TrayItemSetOnEvent(-1, "_Pass")

TrayCreateItem("Open")

TrayItemSetOnEvent(-1, "_open")

TrayCreateItem("Save")

TrayItemSetOnEvent(-1, "_save")

TrayCreateItem("Exit")

TrayItemSetOnEvent(-1, "_Exit")

TrayCreateItem("Show Window")

TrayItemSetOnEvent(-1, "_Show")

TraySetState()

$diary = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'path') & "/Diary.jpg"

$fontread = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'font')

$stringsplit = StringSplit($fontread, '|', 1)

$fontread2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'font2')

$stringsplit2 = StringSplit($fontread2, '|', 1)

$passwordvarify = InputBox("What is your Password", "What is your password??", "", "*")

If $passwordvarify = _StringEncrypt(0, RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'Password'), "aarsh123", 5) Then

Else

MsgBox(0, "Wrong!!", "That was the Wrong Password")

Exit

EndIf

$GUI = GUICreate("My Diary! By Aarsh Vora", 387, 534)

GUISetOnEvent($GUI_EVENT_CLOSE, "_EXIT")

GUICtrlCreateTab(0, 0, 387, 513)

GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

GUICtrlCreateTabItem("Diary")

$Edit1 = GUICtrlCreateEdit("Date:" & @MON & "/" & @MDAY & "/" & @YEAR & @CRLF & @CRLF & "Dear Diary,", 0, 20, 387, 493)

GUICtrlSetFont($Edit1, $stringsplit[1], $stringsplit[2], $stringsplit[3], $stringsplit[4])

GUICtrlSetColor($Edit1, $stringsplit[5])

GUICtrlCreateTabItem("Calander")

GUICtrlCreateMonthCal(@YEAR & "/" & @MON & "/" & @MDAY, 68, 33, 215, 169)

GUICtrlCreatePic($diary, 24, 224, 329, 257)

GUICtrlCreateTabItem("")

GUICtrlCreateTabItem("To Do List")

GUICtrlSetState(-1, $GUI_SHOW)

$Edit2 = GUICtrlCreateEdit("", 0, 20, 387, 493)

GUICtrlSetFont($Edit2, $stringsplit2[1], $stringsplit2[2], $stringsplit2[3], $stringsplit2[4])

GUICtrlSetColor($Edit2, $stringsplit2[5])

GUICtrlSetData(-1, _StringEncrypt(0, FileRead(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'path') & "/To Do List.Diary"), "012345", 2))

GUICtrlCreateTabItem("Alarm Clock")

GUICtrlCreateLabel("Alarm Clock", 128, 40, 128, 31)

GUICtrlSetFont(-1, 16, 800, 0, "Sylfaen")

GUICtrlSetColor(-1, 0xFF0000)

GUICtrlCreateLabel("This Will Ring a Bell at a desired Time.This Will Not Work If My Diary is not on.This is 24 hour format. When The Bell Rings click the left mouse button To stop.", 24, 88, 300, 50)

GUICtrlCreateLabel("Time Now", 26, 129, 91, 28)

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")

$time = GUICtrlCreateLabel(@HOUR & ":" & @MIN & ":" & @SEC, 278, 129, 74, 28)

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")

GUICtrlSetColor(-1, 0x00FF00)

GUICtrlCreateLabel("Set Alarm", 166, 173, 85, 28)

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")

$Input1 = GUICtrlCreateInput("00:00:00", 144, 208, 121, 21)

GUICtrlCreateButton("Set Alarm", 168, 240, 75, 25, 0)

GUICtrlSetOnEvent(-1, "_time")

GUICtrlCreateLabel("Bell Will Ring At", 120, 408, 153, 28)

GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")

$Label9 = GUICtrlCreateLabel("00:00:00", 158, 453, 74, 28)

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")

GUICtrlSetColor(-1, 0x00FF00)

$Label1 = GUICtrlCreateLabel("Alarm is: Off", 128, 304, 141, 33)

GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")

$1 = GUICtrlCreateMenu("&File")

GUICtrlCreateMenuItem("Save", $1)

GUICtrlSetOnEvent(-1, "_save")

GUICtrlCreateMenuItem("Open", $1)

GUICtrlSetOnEvent(-1, "_open")

GUICtrlCreateMenuItem("Hide Window", $1)

GUICtrlSetOnEvent(-1, "_Hide")

GUICtrlCreateMenuItem("Change Password", $1)

GUICtrlSetOnEvent(-1, "_pass")

GUICtrlCreateMenuItem("Exit", $1)

GUICtrlSetOnEvent(-1, "_exit")

$2 = GUICtrlCreateMenu("&Edit")

GUICtrlCreateMenuItem("Font", $2)

GUICtrlSetOnEvent(-1, "_font")

GUICtrlCreateMenuItem("To Do List Font", $2)

GUICtrlSetOnEvent(-1, "_font2")

$3 = GUICtrlCreateMenu("&About")

GUICtrlCreateMenuItem("About", $3)

GUICtrlSetOnEvent(-1, "_ABOUT")

GUISetState(@SW_SHOW)

While 1

GUICtrlSetData($time, @HOUR & ":" & @MIN & ":" & @SEC)

Sleep(1000)

WEnd

Func _time()

GUICtrlSetData($Label9, GUICtrlRead($Input1))

GUICtrlSetData($Label1, "Timer is: On")

AdlibEnable("_Check", 1000)

EndFunc ;==>_time

Func _Check()

If GUICtrlRead($Label9) = @HOUR & ":" & @MIN & ":" & @SEC Then

Do

SoundPlay(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'path') & "/beep5.wav", 1)

Until _IsPressed("01")

GUICtrlSetData($Label9, "00:00:00")

GUICtrlSetData($Label1, "Timer is: Off")

AdlibDisable()

EndIf

EndFunc ;==>_Check

Func _hide()

GUISetState(@SW_HIDE)

EndFunc ;==>_hide

Func _Show()

GUISetState(@SW_SHOW)

EndFunc ;==>_Show

Func _About()

MsgBox(0, "About", "This Program was made by Aarsh Vora")

EndFunc ;==>_About

Func _save2do()

FileDelete(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'path') & "/To Do List.Diary")

FileWrite(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'path') & "/To Do List.Diary", _StringEncrypt(1, GUICtrlRead($Edit2), "012345", 2))

EndFunc ;==>_save2do

Func _font()

$font = _ChooseFont()

If Not @error Then

GUICtrlSetFont($Edit1, $font[3], $font[4], $font[1], $font[2])

GUICtrlSetColor($Edit1, $font[7])

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\mydiary", 'font', 'REG_SZ', $font[3] & '|' & $font[4] & '|' & $font[1] & '|' & $font[2] & '|' & $font[7] & '|' & $font[5])

Global $stringsplit[7] = [0, $font[3], $font[4], $font[1], $font[2], $font[7], $font[5]]

EndIf

EndFunc ;==>_font

Func _font2()

$font2 = _ChooseFont()

If Not @error Then

GUICtrlSetFont($Edit2, $font2[3], $font2[4], $font2[1], $font2[2])

GUICtrlSetColor($Edit2, $font2[7])

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\mydiary", 'font2', 'REG_SZ', $font2[3] & '|' & $font2[4] & '|' & $font2[1] & '|' & $font2[2] & '|' & $font2[7] & '|' & $font2[5])

Global $stringsplit2[7] = [0, $font2[3], $font2[4], $font2[1], $font2[2], $font2[7], $font2[5]]

EndIf

EndFunc ;==>_font2

Func _open()

$password = InputBox("My Diary!", "What is your password?", "", "*")

If $password = _StringEncrypt(0, RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'Password'), "aarsh123", 5) Then

$filetoopen = FileOpenDialog("Open", RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'save'), "Diary Document (*.dd)", 1 + 2 + 8)

If @error Then

MsgBox(4096, "", "No File(s) chosen")

Else

GUICtrlSetData($Edit1, _StringEncrypt(0, FileRead($filetoopen), "DiaryDocument"))

EndIf

Else

MsgBox(0, "My Dairy", "Wrong Password")

EndIf

EndFunc ;==>_open

Func _save()

$savefile = FileSaveDialog("Save", RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'save'), "Diary Document (*.dd)", 2 + 16, @MON & "-" & @MDAY & "-" & @YEAR)

If @error Then

MsgBox(4096, "", "Save cancelled.")

Else

MsgBox(0, "Saving", "This can take a while, depending on how much you wrote")

FileWrite($savefile & ".dd", _StringEncrypt(1, GUICtrlRead($Edit1), "DiaryDocument"))

EndIf

EndFunc ;==>_save

Func _pass()

If InputBox("What??", "What was your old Password??", "", "*") = _StringEncrypt(0, RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'Password'), "aarsh123", 5) Then

$passwordchange = InputBox("Ok!", "What do you want your new password to be??", "", "*")

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\MyDiary", 'Password', 'REG_MULTI_SZ', _StringEncrypt(1, $passwordchange, "aarsh123", 5))

MsgBox(0, "Done!!", "Password Changed!!")

Else

MsgBox(0, "No!!", "Wrong Password")

Exit

EndIf

EndFunc ;==>_pass

Func _Exit()

_save2do()

$Save = MsgBox(36, "Save?", "Would You like To Save?")

Select

Case $Save = 6

_save()

Exit

Case $Save = 7

Exit

EndSelect

EndFunc ;==>_Exit

Func _StringEncrypt($i_Encrypt, $s_EncryptText, $s_EncryptPassword, $i_EncryptLevel = 1)

If $i_Encrypt <> 0 And $i_Encrypt <> 1 Then

SetError(1)

Return ''

ElseIf $s_EncryptText = '' Or $s_EncryptPassword = '' Then

SetError(1)

Return ''

Else

If Number($i_EncryptLevel) <= 0 Or Int($i_EncryptLevel) <> $i_EncryptLevel Then $i_EncryptLevel = 1

Local $v_EncryptModified

Local $i_EncryptCountH

Local $i_EncryptCountG

Local $v_EncryptSwap

Local $av_EncryptBox[256][2]

Local $i_EncryptCountA

Local $i_EncryptCountB

Local $i_EncryptCountC

Local $i_EncryptCountD

Local $i_EncryptCountE

Local $v_EncryptCipher

Local $v_EncryptCipherBy

If $i_Encrypt = 1 Then

For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1

$i_EncryptCountG = ''

$i_EncryptCountH = ''

$v_EncryptModified = ''

For $i_EncryptCountG = 1 To StringLen($s_EncryptText)

If $i_EncryptCountH = StringLen($s_EncryptPassword) Then

$i_EncryptCountH = 1

Else

$i_EncryptCountH += 1

EndIf

$v_EncryptModified = $v_EncryptModified & Chr(BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountG, 1)), Asc(StringMid($s_EncryptPassword, $i_EncryptCountH, 1)), 255))

Next

$s_EncryptText = $v_EncryptModified

$i_EncryptCountA = ''

$i_EncryptCountB = 0

$i_EncryptCountC = ''

$i_EncryptCountD = ''

$i_EncryptCountE = ''

$v_EncryptCipherBy = ''

$v_EncryptCipher = ''

$v_EncryptSwap = ''

$av_EncryptBox = ''

Local $av_EncryptBox[256][2]

For $i_EncryptCountA = 0 To 255

$av_EncryptBox[$i_EncryptCountA][1] = Asc(StringMid($s_EncryptPassword, Mod($i_EncryptCountA, StringLen($s_EncryptPassword)) + 1, 1))

$av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA

Next

For $i_EncryptCountA = 0 To 255

$i_EncryptCountB = Mod(($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256)

$v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0]

$av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0]

$av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap

Next

For $i_EncryptCountA = 1 To StringLen($s_EncryptText)

$i_EncryptCountC = Mod(($i_EncryptCountC + 1), 256)

$i_EncryptCountD = Mod(($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256)

$i_EncryptCountE = $av_EncryptBox[Mod(($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256)][0]

$v_EncryptCipherBy = BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountA, 1)), $i_EncryptCountE)

$v_EncryptCipher &= Hex($v_EncryptCipherBy, 2)

Next

$s_EncryptText = $v_EncryptCipher

Next

Else

For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1

$i_EncryptCountB = 0

$i_EncryptCountC = ''

$i_EncryptCountD = ''

$i_EncryptCountE = ''

$v_EncryptCipherBy = ''

$v_EncryptCipher = ''

$v_EncryptSwap = ''

$av_EncryptBox = ''

Local $av_EncryptBox[256][2]

For $i_EncryptCountA = 0 To 255

$av_EncryptBox[$i_EncryptCountA][1] = Asc(StringMid($s_EncryptPassword, Mod($i_EncryptCountA, StringLen($s_EncryptPassword)) + 1, 1))

$av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA

Next

For $i_EncryptCountA = 0 To 255

$i_EncryptCountB = Mod(($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256)

$v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0]

$av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0]

$av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap

Next

For $i_EncryptCountA = 1 To StringLen($s_EncryptText) Step 2

$i_EncryptCountC = Mod(($i_EncryptCountC + 1), 256)

$i_EncryptCountD = Mod(($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256)

$i_EncryptCountE = $av_EncryptBox[Mod(($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256)][0]

$v_EncryptCipherBy = BitXOR(Dec(StringMid($s_EncryptText, $i_EncryptCountA, 2)), $i_EncryptCountE)

$v_EncryptCipher = $v_EncryptCipher & Chr($v_EncryptCipherBy)

Next

$s_EncryptText = $v_EncryptCipher

$i_EncryptCountG = ''

$i_EncryptCountH = ''

$v_EncryptModified = ''

For $i_EncryptCountG = 1 To StringLen($s_EncryptText)

If $i_EncryptCountH = StringLen($s_EncryptPassword) Then

$i_EncryptCountH = 1

Else

$i_EncryptCountH += 1

EndIf

$v_EncryptModified &= Chr(BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountG, 1)), Asc(StringMid($s_EncryptPassword, $i_EncryptCountH, 1)), 255))

Next

$s_EncryptText = $v_EncryptModified

Next

EndIf

Return $s_EncryptText

EndIf

EndFunc ;==>_StringEncrypt

My_Diary.rar

Edited by Konstig
code
Link to comment
Share on other sites

Very good.

I would prefer it if everything was saved automatically when the diary is closed or maybe a prompt to save.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I just had an Eh... Why the heck am I so bored moment, so I did a little tweaking.

#NoTrayIcon
#include <GUIConstants.au3>
#include <String.au3>
If Not FileExists(@CommonFilesDir & "/password.txt") Then
    $password = InputBox("Password", "What do you want your Password to be??")
    $Name = InputBox("Name", "What is your name??")
    FileWrite(@CommonFilesDir & "/password.txt", _StringEncrypt(1, $password , "20005861")& @CRLF & _StringEncrypt(1, $Name, "20005861"))
    FileSetAttrib(@CommonFilesDir & "/password.txt", "+SH")
ElseIf FileExists(@CommonFilesDir & "/password.txt") Then
    $passwordvarify = InputBox("What is your Password", "What is your password??")
    If $passwordvarify = _StringEncrypt(0, FileReadLine(@CommonFilesDir & "/password.txt", 1), "20005861") Then
        MsgBox(0, "Correct", "That was the Right Password Welcome, " & FileReadLine(@CommonFilesDir & "/password.txt", 2))
    Else
        MsgBox(0, "Wrong!!", "That was the Wrong Password")
        Exit
    EndIf
EndIf

$Form1_1 = GUICreate("My Diary", 435, 598, 292, 95)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 417, 545)
GUICtrlSetData($Edit1, "Today's Date:" & @MON & "/" & @MDAY & "/" & @YEAR & @CRLF & @CRLF & "Dear Diary,")

$Save = GUICtrlCreateButton("Save", 8, 560, 105, 33, 0)
$Exit = GUICtrlCreateButton("Exit", 328, 560, 97, 33, 0)
$Pass = GUICtrlCreateButton("Password Change", 152, 560, 105, 33, 0)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Exit
            Exit
        Case $Pass
            If InputBox("What??", "What was your old Password??") = _StringEncrypt(0, FileReadLine(@CommonFilesDir & "/password.txt", 1), "20005861") Then
                $namenew = InputBox("Ok!", "Just for varification Purposes what is your name??")
            ElseIf @error Then
                MsgBox(0, "Error", "No password given or canceled")
            EndIf

            If $namenew = _StringEncrypt(0, FileReadLine(@CommonFilesDir & "/password.txt", 2), "20005861") Then
                $passwordchange = InputBox("Ok!", "What do you want your new password to be??")
                FileDelete(@CommonFilesDir & "/password.txt")
                FileWrite(@CommonFilesDir & "/password.txt", _StringEncrypt(1, $passwordchange, "20005861") & @CRLF & _StringEncrypt(1, $namenew, "20005861"))
                FileSetAttrib(@CommonFilesDir & "/password.txt", "+SH")
                MsgBox(0, "Done!!", "Password Changed!!")
            Else
                MsgBox(0, "No!!", "Wrong Name!! That is sad!!")
                Exit
            EndIf

        Case $Save

            FileWrite(@MyDocumentsDir & "/" & @MON & "-" & @MDAY & "-" & @YEAR & ".txt", GUICtrlRead($Edit1))
            MsgBox(0, "Done!!", "Saved!!To the My documents Directory!!")
    EndSwitch
Wend

All that is changed is that your username and password are all encrypted in the file, so just looking at it won't do you any good.

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 months later...
  • 2 months later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...