Skip to content

Commit

Permalink
2011-10-01_03-53-52
Browse files Browse the repository at this point in the history
  • Loading branch information
camerb committed Oct 1, 2011
1 parent d2ae31d commit 59d20bd
Show file tree
Hide file tree
Showing 11 changed files with 181 additions and 45 deletions.
62 changes: 62 additions & 0 deletions FcnLib-Clipboard.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
;#include FcnLib.ahk

;FcnLib-Clipboard.ahk by camerb

;This library contains a bunch of functions that make using the clipboard easier and more reliable

copy()
{
Send, {CTRL DOWN}
Sleep, 500
Send, c
Sleep, 500
Send, {CTRL UP}
}

paste()
{
Send, {CTRL DOWN}
Sleep, 500
Send, v
Sleep, 500
Send, {CTRL UP}
}

;this is what I've got at the moment... it needs to be refined
CopyWait()
{
;number to verify that the clipboard was never assigned to
null:=Random(100000,999999)
Clipboard:=null

Sleep, 100
Send, ^c
Send, ^c
Send, ^c
Send, ^c
Sleep, 100
;ClipWait, 2
;debug("silent log", "just copied to clipboard")
count=0
Loop
{
count++
if (Clipboard != null)
{
;if (count >= 2)
;debug("silent log yellow line", "clipboard is no longer null after # of tries:", count)
break
}
Sleep, 100
}

;TODO return false if error?
}

;rewrite of the clipwait command
ClipWait(clipboardContentsToWaitFor, options="")
{

}

;TODO ClipWaitNull(), ClipWaitNotNull()
15 changes: 15 additions & 0 deletions FcnLib-Rewrites.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ FileCreate(text, file)

;{{{Folder Manipulation Functions

;TESTME
FileCopyDir(source, dest, options="")
{
if InStr(options, "overwrite")
overwrite=1

if NOT DirExist(source)
return false
EnsureDirExists(dest)

FileCopyDir, %source%, %dest%, %overwrite%
}

;TODO consider a rename to FileDeleteDirForceful (or forceful option)
;Delete folder very forcefully
FileDeleteDir(dir)
{
Expand Down Expand Up @@ -86,6 +100,7 @@ FileDeleteDir(dir)

;Returns if the directory exists
;FIXME hmm, perhaps I should have named this starting with the word "file"
;TODO rename all instances of DirExist to FileDirExist
FileDirExist(dirPath)
{
return InStr(FileExist(dirPath), "D") ? 1 : 0
Expand Down
8 changes: 4 additions & 4 deletions HypercamRecord.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ fatalIfNotThisPC("BAUSTIAN-09PC")

RunProgram("C:\Program Files\HyCam2\HyCam2.exe")
ForceWinFocus("HyperCam")
SleepSeconds(5)
SleepSeconds(1)
Send, {F2}

SleepMinutes(5)

Send, {F2}
SleepSeconds(5)
WinWait, HyperCam, , 1
WinClose, HyperCam
SleepSeconds(5)
Process, Close, HyCam2.exe
SleepSeconds(1)
ProcessCloseAll("HyCam2.exe")
3 changes: 1 addition & 2 deletions LaunchSSMS.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ Send, sa
ss()
Send, !p
ss()
joe:=SexPanther("work")
joe:=StringLower(joe)
joe:=SexPanther("work-lc")
SendRaw, % joe
;Send, {UP 5}{DOWN}{ENTER}
Send, {ENTER}
Expand Down
13 changes: 7 additions & 6 deletions NFSWhotkeys.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
;Sleep, 100
;}

Joy4::
Send, {SPACE DOWN}
Sleep, 100
Send, {SPACE UP}
return
;Joy4::
;Send, {SPACE DOWN}
;Sleep, 100
;Send, {SPACE UP}
;return

Joy6::
Send, {SPACE DOWN}
Expand All @@ -20,8 +20,9 @@ return

Joy9::
Send, {SPACE DOWN}
Sleep, 220
Sleep, 320
Send, {SPACE UP}
Reload
return

;Joy1::
Expand Down
16 changes: 14 additions & 2 deletions NightlyAhks.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

;{{{script

A_Debug := true

debug("log grey line", "starting nightly scripts")

if (NOT ProcessExist("dsidebar.exe") AND NOT IsVM())
Expand Down Expand Up @@ -118,6 +120,11 @@ RunThisNightlyAhk(waitTimeInMinutes, ahkToRun, params="")
;TODO morning status sender will check to see if any ini records remain
;TODO another ahk will sit there to babysit, or perhaps we can put that in persistent

global A_Debug

if A_Debug
debug("", "nightly ahks: starting this ahk", ahkToRun)

;quote="
;ahkToRun := EnsureStartsWith(ahkToRun, quote)
;ahkToRun := EnsureEndsWith(ahkToRun, quote)
Expand All @@ -132,9 +139,14 @@ RunThisNightlyAhk(waitTimeInMinutes, ahkToRun, params="")

SleepMinutes(waitTimeInMinutes)

;CloseAllAhks("NightlyAhks")
;close everything that it possibly could have launched
CloseAllAhks(A_ScriptName)
;ForceReloadAll()

;close just the one we launched
;AhkClose(ahkToRun)

if A_Debug
debug("", "nightly ahks: finished this ahk", ahkToRun)
}

hypercam()
Expand Down
Binary file added camerb-OCR-function/in.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions camerb-OCR-function/in.pnm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
P5
200 50
255
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Į�����������������������������C�8����������������������������������������������������������������������������������������������������������������������������������������������������������皷���˺���������������������������������3���8����������������������������������������������������������������������������������������������������������������������������������������������������������瘶���˻����z����������������������������8���8����������������������������������������������������������������������������������������������������������������������������������������������������������痷���˻����z���������Z���(���8���3��8��8���8���)$��8�����Y���($��������������������������������������������������������������������������������������������������������������������������蓷���˻����z��������Y�����3���.��3[�$��8���8��8���8��8�緁�3[�$��Z�����8�緁�������������������������������������������������������������������������������������������������������������������������瓷���˻����t��������2�����1���w��8���8��8���8��8���8��([�8���8��1�����([�������������������������������������������������������������������������������������������������������������������������珷���˻����u��������2�����2���w��8���8��8���8��8���8��2�����8���8��2�����2�����������������������������������������������������������������������������������������������������������������������������珷���˻����t��������Y�����3���2��8���8��8���8��Y�� ��3�����8���8��Y�����3�����������������������������������������������������������������������������������������������������������������������������珷���˻����t���������3���( ���8���7��8���8��T8���([�8���8���3���([�������������������������������������������������������������������������������������������������������������������������熷���˻����i�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������熲���˻����i��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������獞��˸���u����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������笗�{sy�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������羱����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������籿�����ȷ�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������߁����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Į�����������������������������C�8�����������������������������������������(C���������������������������������������������������������������������������������������������������������皷���̻���������������������������������3���8�����������������������������������������$��2������������������������������������������������������������������������������������������������������������瘷���˻����y����������������������������8���8������������������������������������������<��2������������������������������������������������������������������������������������������������������������痷���˻����z���������Y���(���8���3��8��8���8���'$��8�����Y���($���������Z��( ����������������������������������������������������������������������������������������������������������瓷���˻����z��������Y�����3���.��3[�$��8���8��7���8��8�縁�4[�$��Y�����8�緁������Y[�����$���������������������������������������������������������������������������������������������������������蓷���˻����t��������2�����2���v��8���8��8���8��7���8��([�8���8��2�����([��������$�����8���������������������������������������������������������������������������������������������������������珷���˻����t��������2�����2���v��8���8��8���8��8���8��2�����8���8��2�����2�������������7�����8���������������������������������������������������������������������������������������������������������珷���˻����t��������Y�����3���2��8���8��8���8��Y�� ��3�����8���8��Y�����3������������C����vC���������������������������������������������������������������������������������������������������������珷���˻����t���������3���( ���8���8��8���8��T8���([�8���9���3���([�����Y$��YC����������������������������������������������������������������������������������������������������������熷���˻����i�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������煱���˻����j������������������������������������������������������������������3$���������������������������������������������������������������������������������������������������������������������玝��˸���t����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������笗�zty�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������罰����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������豿�����ȷ�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������߂����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ů�����������������������������C�8�����������������������������������������(C������� �������Y����������������������������C�.������������������������������8�����������8��8�������皷���˻���������������������������������3���8�����������������������������������������$��1���������YT8�����综�$���������������������������3����������������������������������8�����������8��8�������瘷���˻����z����������������������������8���8������������������������������������������<��2�����������8����������8���������������������������8����������������������������������8�����������8��8�������痷���˻����z���������Y���(���9���3��8��8���8���(%��8�����Z���($���������[��( ���������8����������Q��������Y���(���8���3��8���(z8��8���8��8h$��($���(z8��������(z8��8�������瓷���˻����z��������Y�����2���.��3[�$��8���7��8���8��8�緁�3[�$��Y�����9�緂������Y[�����$��������8���������Y��������Y�����3���.��3[�$��8���8��3�� ��8���8��3���8�縁�3�� �������3�� ��3C������瓷���˻����t��������2�����2���v��8���8��8���8��8���8��(\�8���8��3�����'[��������%�����8��������8��������v[��������2�����2���v��8���8��8���8��R���8��8���8��8���([�Q���7�������Q���8��8�������珸���˻����t��������2�����2���v��9���8��8���8��8���8��2�����8���8��2�����2�������������8�����8��������8�������[���������1�����2���v��8���8��8���8��Q���8��8���8��8���2�����Q���8�������Q���8��8�������珷���˻����t��������Y�����3���2��8���8��8���8��X�� ��3�����8���8��Y�����3������������C����vC��������8����9��C����������X�����3���2��8���8��8���8��3�� ��Y�� ��8���4�����3�� �������3�� ��3�������珷���˻����t���������3���( ���8���8��8���8��T8���([�8���9���3���([�����X%��YC�������YC��8�Y��������3���' ���8���9��8���8��z8��T8��8����([�z8�������z8��8h������憷���˻����i��������������������������������������������������������������������������������������������������������������������������������������������2����������������������������������������������熱���˻����i������������������������������������������������������������������3$������������3$���������������3$�������������������������������vC�������������������������3$�����������������玞��˸���u�����������������������������������������������������������������������������������������������������������������������������������������Y$�������������������������������������������������欗�zty�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
87 changes: 58 additions & 29 deletions cliprun.ahk
Original file line number Diff line number Diff line change
@@ -1,37 +1,66 @@
#include FcnLib.ahk

OnExit, EXITSUB
Gui, 2:FONT, s14, Arial
Gui, 2:ADD, TEXT, w160 h180 Wrap, Click Loop Button to count`nCTRL SPACE to Pause.
Gui, 2:show, w180 h100 NA,Status
WinGetPos,x,,,,Status
Winmove,Status,,% x+250
Gui, Add, Button,x+25 y+30 vloop1 gLOOP, LOOP1
Gui, Add, Button,x+25 vloop2 gLOOP, LOOP2
Gui, Show,w200 h100,Test Script
RETURN
ContextTeste:
Gui, 1:+Owner2
Gui, 2:Add, ListBox, x112 y0 w80 r10 , Ingles|Portugues|Matematica|E.M.R.C|Frances|Geometria|E. Fisica|Filosofia|Fis. Qui. A|Bio. Geo.
Gui, 2:Add, Button, x12 y30 w80 h30 gcalcmedia, Adicionar teste!
Gui, 2:Add, DateTime, x2 y0 w100 h20 ,
;------------------------------Datas---------------------------------
Gui, 2:Add, Text, x202 y0 w70 h20 +Border +Center, Data
Gui, 2:Add, Text, x202 y20 w70 h20 vteste1 +Border +Center,
Gui, 2:Add, Text, x202 y39 w70 h20 vteste2 +Border +Center,
Gui, 2:Add, Text, x202 y58 w70 h20 vteste3 +Border +Center,
Gui, 2:Add, Text, x202 y77 w70 h20 vteste4 +Border +Center,
Gui, 2:Add, Text, x202 y96 w70 h20 vteste5 +Border +Center,
Gui, 2:Add, Text, x202 y115 w70 h20 vteste6 +Border +Center,
;------------------------------Notas---------------------------------
Gui, 2:Add, Text, x271 y0 w70 h20 +Border +Center, Nota
Gui, 2:Add, Text, x271 y20 w70 h20 vnota1 +Border +Center,
Gui, 2:Add, Text, x271 y39 w70 h20 vnota2 +Border +Center,
Gui, 2:Add, Text, x271 y58 w70 h20 vnota3 +Border +Center,
Gui, 2:Add, Text, x271 y77 w70 h20 vnota4 +Border +Center,
Gui, 2:Add, Text, x271 y96 w70 h20 vnota5 +Border +Center,
Gui, 2:Add, Text, x271 y115 w70 h20 vnota6 +Border +Center,
;------------------------------Medias--------------------------------
Gui, 2:Add, Text, x341 y0 w70 h20 +Border +Center, Media
Gui, 2:Add, Text, x341 y115 w70 h20 vmedia +Border +Center, all.v/n

LOOP:
;PRETEND THIS LOOP IS 1000 LINES OF CODE! IF THEN RETURN STATEMENTS AREN'T THE SOLUTION I'M LOOKING FOR!!
Loop
{
ControlSetText,static1,%A_Index%,Status
Sleep, 1000
}
EXIT
2tit = Datas de Testes, Marcar testes, Notas...
Gui, 2:+ToolWindow
Gui, 2:Show, h144 w418 , %2tit%
return

GUICLOSE:
GUIESCAPE:
CANCEL:
EXITSUB:
ExitApp
EXIT
calcmedia:
;~IniRead, test1, %A_ScriptDir%\testes.ini, TESTE1
;~IniRead, not1, %A_ScriptDir%\testes.ini, NOTA1
;~ if ( test1 = "" )

^Space::
RELOAD
RETURN
^R::RELOAD
^q::EXITAPP
GuiControl, 2:, teste1, %test1%
GuiControl, 2:, nota1, %not1%
IniRead, test2, %A_ScriptDir%\testes.ini, TESTE2
IniRead, not2, %A_ScriptDir%\testes.ini, NOTA2
GuiControl, 2:, teste2, %test2%
GuiControl, 2:, nota2, %not2%
IniRead, test3, %A_ScriptDir%\testes.ini, TESTE3
IniRead, not3, %A_ScriptDir%\testes.ini, NOTA3
GuiControl, 2:, teste3, %test3%
GuiControl, 2:, nota3, %not3%

media:
tcount = 3
Gui, 2:Submit, NoHide
;~ GuiControlGet,nota11, 2:, nota1
;~ GuiControlGet,nota22, 2:, nota2
;~ GuiControlGet,nota33, 2:, nota3


med := ( (nota11 + nota22 + nota33) / tcount )

MsgBox, %med% quando devia ser 17.33333333

return
2GuiClose:
Gui, Destroy



Expand Down
2 changes: 0 additions & 2 deletions temporary1.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ f=F:\

compareSizesOfBackups(f, "Dev-cpp")
compareSizesOfBackups(f, "Documents and Settings")
compareSizesOfBackups(f, "My Downloads")
compareSizesOfBackups(f, "My Music")
compareSizesOfBackups(f, "Program Files")
compareSizesOfBackups(f, "WINDOWS")
;compareSizesOfBackups(f, "Downloads")
Expand Down
16 changes: 16 additions & 0 deletions temporary9.ahk
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#include FcnLib.ahk

SetFormat, float, 06.0

debug(zeropad2(31, 6))
;debug(11zeropad2(31, 6))

;this will probably have some ugly repercussions
zeropad2(num, digits)
{
prevFormat:=A_FormatFloat
tempFormat=0%digits%.0
SetFormat, float, %tempFormat%
;SetFormat, float, 06.0
;returned:=num
returned:=num+1.0
SetFormat, float, %prevFormat%
return returned
}

0 comments on commit 59d20bd

Please sign in to comment.