;~ fun happy function list time ;~ use control+f to find specific functions #include-once ;~ some of the function libraries that are used for the functions below #include #include #include ;~ **************************************************************************** ;~ ******* UNIVERSAL FUNCTIONS ******* ;~ **************************************************************************** ;########### function to fix sticking mod keys ############# Func _SendEx($ss) Local $iT = TimerInit() While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12") If TimerDiff($iT) > 1000 Then MsgBox(262144, "Warning", "Shift, Ctrl and Alt Keys need to be released to proceed!" & @CR & "Click OK to release keys.") _SendEx("{CTRLUP}") _SendEx("{SHIFTUP}") _SendEx("{ALTUP}") EndIf WEnd Send($ss) EndFunc ;==>_SendEx ;############## end function to fix sticking mod keys ######### ;########### functions to save and transfer variables ############# Func _StoreVar($VarName) RegWrite("HKEY_CURRENT_USER\Software\AutoIt v3\VarBuffer",$VarName,"REG_SZ",Execute($VarName)) EndFunc Func _LoadVar($VarName) Return RegRead("HKEY_CURRENT_USER\Software\AutoIt v3\VarBuffer",$VarName) EndFunc Func _ClearBuffer() RegDelete("HKEY_CURRENT_USER\Software\AutoIt v3\VarBuffer") EndFunc ;########### end function to save and transfer variables ############# ;########### function to copy window contents ############# Func _DataCopy() Sleep(0100) ClipPut("") Sleep(0100) _SendEx("^{HOME}") Sleep(0100) _SendEx("^a") Sleep(0100) _SendEx("^c") Sleep(0100) _SendEx("^c") EndFunc ;########### end function to copy window contents ############# ;########### function to turn array elements into strings ############# Func _arrayItemString($y, $x) Local $z Local $w $w = _ArraySearch($y, $x, 0, 0, 0, 1) If $w > -1 Then $z = _ArrayToString($y, @TAB, $w, $w) Return $z Else Return $w EndIf EndFunc ;########### end function to turn array elements into strings ############# ;########### function to search OCLC ############# Func _OCLCSearch($a, $x) If WinExists("OCLC Connexion") Then WinActivate("OCLC Connexion") Else MsgBox(64, "nope", "Please open and log into Connexion. Click ok when you are logged in") EndIf Sleep(0100) _SendEx("{F2}") Sleep(0100) _SendEx($a) Sleep(0100) _SendEx($x) Sleep(0100) _SendEx("{ENTER}") EndFunc ;########### End function to search OCLC ############# ;########### function to determine 947 initials ############# Func _Initial() local $var local $C_INI $var = EnvGet("TEMP") $var = StringTrimLeft($var, 12) $var = StringTrimRight($var, 14) Switch $var Case "klumbca" $C_INI = "cak" Case "spencert" $C_INI = "rts" Case "abneymd" $C_INI = "ma" Case "yoosebj" $C_INI = "bjy" Case "nowaksj" $C_INI = "sn" Case "alexanpk" $C_INI = "pka" Case "keyessl" $C_INI = "slk" case Else $C_INI = "999" EndSwitch Return $C_INI EndFunc ;########### End function to determine 947 initials ############# ;########### function to do a III search from the main screen ############# Func _IIIsearch($a, $b) If WinExists("[TITLE:Millennium; CLASS:SunAwtFrame]") Then WinActivate("[TITLE:Millennium; CLASS:SunAwtFrame]") Else MsgBox(64, "nope", "Please log into Millennium.") Exit EndIf WinWaitActive("[TITLE:Millennium; CLASSS:SunAwtFrame]") Sleep(0100) _SendEx("!n") Sleep(0100) _SendEx("!n") Sleep(0100) _SendEx($a) Sleep(0100) _SendEx($b) Sleep(0100) _SendEx("{ENTER}") Sleep(0400) EndFunc ;########### function to do a III search from the main screen ############# ;########### function to left mouse click on data fields in III ############# Func _WinClick($x) Local $winwidth, $winheight AutoItSetOption("MouseCoordMode", 0) $winwidth = _ArrayToString($x, "", 2, 2) $winheight = _ArrayToString($x, "", 3, 3) $winwidth *= .3 $winheight *= .7 MouseMove($winwidth, $winheight) MouseClick("left") EndFunc ;########### function to left mouse click on data fields in III ############# ;########### function to help create variables from III fixed fields ############# Func _IIIfixed($a, $b) local $x, $y, $z $x = _ArrayToString($a, @TAB, $b, $b) $y = StringRegExpReplace ($x, "\t+[A-Z]", "fnord") $z = StringSplit($y, "fnord", 1) Return $z EndFunc ;########### End function to help create variables from III fixed fields #############