Permalink
Browse files

2011-03-27_03-41-12

  • Loading branch information...
1 parent 65c757c commit 3a8e6fd202bd2895c7aa1501424ee95f7c398eb5 @camerb committed Mar 27, 2011
Showing with 177 additions and 61 deletions.
  1. +2 −0 .gitignore
  2. +4 −3 FcnLib-Rewrites.ahk
  3. +12 −7 FcnLib.ahk
  4. +36 −0 GetSentryBalances.ahk
  5. +3 −1 Keylogger.ahk
  6. +22 −0 ListenToCarTalk.ahk
  7. +3 −1 NightlyAhks.ahk
  8. +69 −41 RecordMacro.ahk
  9. +0 −1 Recorder.ahk
  10. +2 −2 StartIdleAhks.ahk
  11. +21 −4 temporary.ahk
  12. +3 −1 temporary9.ahk
View
@@ -8,5 +8,7 @@ temp
gitExempt
REFP
usaa_export
+temporary*.ahk
+archive/temporaryAHKs
*.swp
*.swo
View
@@ -9,6 +9,7 @@ FileAppend(text, file)
{
EnsureDirExists(file)
FileAppend, %text%, %file%
+ ;TODO should we ensure that the file exists?
}
FileAppendLine(text, file)
@@ -22,7 +23,7 @@ FileCopy(source, dest, options="")
if InStr(options, "overwrite")
overwrite=1
if NOT FileExist(source)
- fatalErrord("file doesn't exist")
+ fatalErrord("file doesn't exist", source, A_ThisFunc, A_LineNumber)
EnsureDirExists(dest)
FileCopy, %source%, %dest%, %overwrite%
@@ -42,10 +43,10 @@ FileMove(source, dest, options="")
if InStr(options, "overwrite")
overwrite=1
if NOT FileExist(source)
- fatalErrord("file doesn't exist")
+ fatalErrord("file doesn't exist", source, A_ThisFunc, A_LineNumber)
EnsureDirExists(dest)
- FileCopy, %source%, %dest%, %overwrite%
+ FileMove, %source%, %dest%, %overwrite%
}
;}}}
View
@@ -900,7 +900,7 @@ RunProgram(path)
path := IniRead(ini, A_ComputerName, appFilename)
;debug(path)
- delog("tried run program", "could not find the directory or one like it", "app might not be installed, or the path might not be pointed at the program files dir")
+ delog("tried run program", path, A_ScriptName, A_LineNumber, A_ThisFunc, "could not find the directory or one like it", "app might not be installed, or the path might not be pointed at the program files dir")
}
sendEmail(sSubject, sBody, sAttach="", sTo="cameronbaustian@gmail.com", sReplyTo="cameronbaustian+bot@gmail.com")
@@ -1224,13 +1224,18 @@ ForceReloadAll()
;TESTME
ZeroPad(number, length)
{
- Loop length
- padding .= "0"
- length *= -1
- length++
+ ;Loop length
+ ;padding .= "0"
+ ;length *= -1
+ ;length++
- returned := substr(padding . number, length)
- return returned
+ ;returned := substr(padding . number, length)
+ ;return returned
+
+ while (strlen(number) < length)
+ number := "0" . number
+
+ return number
}
;WRITEME
View
@@ -0,0 +1,36 @@
+#include FcnLib.ahk
+#include FcnLib-Opera.ahk
+#include gitExempt/SentryLogin.ahk
+
+time:=CurrentTime("hyphenated")
+pricesFile=gitExempt/401k-prices.csv
+totalsFile=gitExempt/401k-total.csv
+
+SentryLogin()
+
+if NOT ForceWinFocusIfExist("[Participant Summary] - Opera", "Exact")
+ ExitApp
+
+summary:=GhettoUrlDownloadToVar("https://sentryins.com/acctbal.aspx?VIEWMODE=I&LINK=50")
+v1:=GetAccountUnitPrice(summary, "Diversified Income Account D -T.Rowe Price Spectrum Income Fund")
+v2:=GetAccountUnitPrice(summary, "2045 Target Retirement LE - Sentry 2045 Target Retirement Portfolio")
+v3:=GetAccountUnitPrice(summary, "Mid-Cap Growth Account I N - T Rowe Price Mid-Cap Growth Fund")
+v4:=GetAccountUnitPrice(summary, "Aggressive Growth Account H - Janus Research Fund T Shares")
+v5:=GetAccountUnitPrice(summary, "Diversified Growth Account AD - T Rowe Price Spectrum Growth Fund")
+v6:=GetAccountUnitPrice(summary, "Concentrated Growth Account L - Janus Aspen Forty Portfolio")
+v7:=GetAccountUnitPrice(summary, "Foreign Growth Account J - Janus Aspen Overseas Portfolio-Institutional Shares")
+total:=GetAccountUnitPrice(summary, "Total\:")
+
+csvLine:=concatWithSep(",", time, v1,v2,v3,v4,v5,v6,v7)
+FileAppend(csvLine, pricesFile)
+csvLine:=concatWithSep(",", time, total)
+FileAppend(csvLine, totalsFile)
+
+GetAccountUnitPrice(pageText, accountName)
+{
+ pageText:=RegExReplace(pageText, "(`r|`n)", " ")
+ reNeedle=%accountName%(.*?)tr
+ RegExMatch(pageText, reNeedle, block)
+ RegExMatch(block1, "<td.*>\$([0-9.]*?)</td", block)
+ return block1
+}
View
@@ -1,4 +1,5 @@
#include FcnLib.ahk
+#NoTrayIcon
SetFormat, Integer, H
Loop, 0x7f
@@ -7,5 +8,6 @@ Return
LogKey:
Key := RegExReplace(asc(SubStr(A_ThisHotkey,0)),"^0x")
;FileAppend, % (StrLen(Key) == 1 ? "0" : "") . Key, Log.log
-FileAppend, %A_ThisHotkey%`t%key%`n, gitExempt/log.log
+date:=CurrentTime("hyphendate")
+FileAppend, %A_ThisHotkey%`t%key%`n, gitExempt/logs/%date%.log
Return
View
@@ -0,0 +1,22 @@
+#include FcnLib.ahk
+
+showNumber:=prompt("Which show number of CarTalk would you like to listen to?`n(e.g.: 1109)")
+
+ForceWinFocus("foobar2000")
+
+Loop 15
+{
+ PartNo:=ZeroPad(A_Index, 2)
+ Send, ^u
+ SendInput, http://www.publicbroadcasting.net/cartalk/.jukebox?action=playFile&title=CT%ShowNumber%%PartNo%.mp3
+ Send, {ENTER}
+ win=Processing Files
+ WinWaitActive, %win%
+ WinWaitNotActive, %win%
+ ;Sleep, 1000
+}
+
+ss()
+{
+sleep, 5000
+}
View
@@ -44,6 +44,8 @@ if (A_ComputerName="BAUSTIAN-09PC")
SleepMinutes(15)
RunAhkAndBabysit("UsaaCheckingBalanceProjection.ahk")
SleepMinutes(1)
+ RunAhkAndBabysit("GetSentryBalances.ahk")
+ SleepMinutes(5)
}
else if (A_ComputerName="PHOSPHORUS")
{
@@ -72,7 +74,7 @@ if (A_ComputerName="PHOSPHORUS")
{
;this needs a little bit of click-around time
RunAhkAndBabysit("LaunchPidgin.ahk")
- SleepSeconds(30)
+ SleepMinutes(1)
}
RunAhkAndBabysit("MoveMouseAcrossEntireScreen.ahk")
View
@@ -1,56 +1,84 @@
#include FcnLib.ahk
-runPath:=ProgramFilesDir("\AutoHotkey\AutoScriptWriter\AutoScriptWriter.exe")
-Run, %runPath%
-Send {SHIFTUP}{CTRLUP}{AppsKey Up}
-ForceWinFocus("AutoScriptWriter II - ( by Larry Keys ) ahk_class ASW_Dev_01", "Exact")
+time:=CurrentTime("hyphenated")
+tempFile=%A_WorkingDir%\temp\raw_recorded.ahk
+finalFile=%A_WorkingDir%\temporary.ahk
+archiveFile=%A_WorkingDir%\archive\temporaryAHKs\%time%.ahk
+
+aswWindow=AutoScriptWriter II - ( by Larry Keys ) ahk_class ASW_Dev_01
+saveWindow=Save AutoHotkey Script
+
+RunProgram("C:\Program Files\AutoHotkey\AutoScriptWriter\AutoScriptWriter.exe")
+
+Send {SHIFT UP}{ALT UP}{CTRL UP}{APPSKEY UP}
+ForceWinFocus(aswWindow, "Exact")
;TODO Sometimes it doesn't detect that we pressed it (need to detect this better)
-Sleep 100
-ControlClick, X56 Y55
-Sleep 500
-ControlClick, X56 Y55
+;Sleep 100
+;ControlClick, X56 Y55
+;Sleep 500
+;ControlClick, X56 Y55
+
+;this is attempt at the better detection
+while (WinGetHeight(aswWindow) > 70)
+{
+ ControlClick, X56 Y55
+ Sleep 100
+}
;Wait for the appskey to be pressed (to end recording)
KeyWait, ``, D
ForceWinFocus("AutoScriptWriter II - ( by Larry Keys ) ahk_class ASW_Dev_01", "Exact")
-ControlClick, X66 Y27
+;ControlClick, X66 Y27
+
+;this is attempt at the better detection
+while (WinGetHeight(aswWindow) < 70)
+{
+ ControlClick, X66 Y27
+ Sleep 100
+}
;Save as temporary.ahk and close
-ForceWinFocus("AutoScriptWriter II - ( by Larry Keys ) ahk_class ASW_Dev_01", "Exact")
-while true
+ForceWinFocus(aswWindow, "Exact")
+while NOT ForceWinFocusIfExist(SaveWindow)
{
ControlClick, X19 Y305
- Sleep, 500
- IfWinExist, Save AutoHotkey Script
- break
- Sleep, 500 ;is this one really necessary?
+ Sleep, 100 ;is this one really necessary?
}
-ForceWinFocus("Save AutoHotkey Script")
-ControlClick, X228 Y339
-Sleep, 100
+ForceWinFocus(SaveWindow)
Send, ^a
-Sleep, 100
-SendInput, %A_WorkingDir%\temporary.ahk{ENTER}
-;ControlClick, X471 Y409
-Sleep, 100
-WinClose, AutoScriptWriter II - ( by Larry Keys ) ahk_class ASW_Dev_01,
-Sleep, 100
-
-path="C:\My Dropbox\AHKs\REFP\
-infile=%path%in1.txt"
-refile2=%path%regex-rawmacro.txt"
-outfile=%path%out1.txt"
-
-FileCopy, %A_WorkingDir%\temporary.ahk, C:\My Dropbox\AHKs\REFP\in1.txt, 1
-Sleep, 100
-
-params := concatWithSep(" ", infile, refile2, outfile)
-RunAhk("RegExFileProcessor.ahk", params)
-Sleep, 200
-
-;TODO allow an option for putting Sleep 100 on every other line
-time:=CurrentTime("hyphenated")
-FileCopy, C:\My Dropbox\AHKs\REFP\out1.txt, %A_WorkingDir%\temporary.ahk, 1
-FileCopy, %A_WorkingDir%\temporary.ahk, %A_WorkingDir%\archive\temporaryAHKs\%time%.ahk, 1
+ss()
+ForceWinFocus(SaveWindow)
+SendInput, %tempFile%
+ss()
+SendInput, {ENTER}
+ss()
+WinClose, %aswWindow%
+ss()
+
+path=C:\My Dropbox\AHKs\REFP\
+infile=%path%in1.txt
+refile2=%path%regex-rawmacro.txt
+outfile=%path%out1.txt
+
+;FileCopy(tempFile, inFile, "overwrite")
+ss()
+
+;REFP(infile, refile2, outfile)
+REFP(tempFile, refile2, finalFile)
+SleepSeconds(1)
+
+;TODO allow an option for putting a short sleep on every other line
+FileCopy(finalFile, archiveFile, "overwrite")
return
+
+ss()
+{
+ Sleep, 100
+}
+
+WinGetHeight(wintitle)
+{
+ WinGetPos, no, no, no, returned, %wintitle%
+ return returned
+}
View
@@ -1 +0,0 @@
-Run, "C:\Program Files (x86)\AutoHotkey\AutoScriptWriter\AutoScriptWriter.exe"
View
@@ -1,12 +1,12 @@
#include FcnLib.ahk
-;msgbox, %A_WorkingDir%
;if it isn't a VM, we'll run these ahks
; but wait, do we really want to run these on Toshimi?
-if NOT IsVM()
+if NOT (IsVM() OR A_ComputerName = "TOSHIMI")
{
RunAhk("RemoteWidget.ahk")
RunAhk("IntelliSense2.ahk")
+ RunAhk("Keylogger.ahk")
}
RunAhk("AutoHotkey.ahk")
View
@@ -1,4 +1,21 @@
-WinWait, ,
-IfWinNotActive, , , WinActivate, ,
-WinWaitActive, ,
-Send, `
+#include FcnLib.ahk
+
+ss()
+ForceWinFocus("RecordMacro.ahk (c:\My Dropbox\AHKs) - GVIM")
+Click(517, 228, "left")
+ss()
+ForceWinFocus("temporary9.ahk (C:\My Dropbox\AHKs) - GVIM")
+Click(499, 393, "left")
+ss()
+ForceWinFocus("RecordMacro.ahk (c:\My Dropbox\AHKs) - GVIM")
+Click(500, 831, "left")
+ss()
+ForceWinFocus("SentryLogin.ahk (C:\My Dropbox\AHKs\gitExempt) - GVIM")
+
+ESC::ExitApp
+`::ExitApp
+
+ss()
+{
+Sleep, 100
+}
View
@@ -1,3 +1,5 @@
#include FcnLib.ahk
+#include FcnLib-Opera.ahk
+#include gitExempt/MonsterLogin.ahk
-
+MonsterLogin()

0 comments on commit 3a8e6fd

Please sign in to comment.