Skip to content

Commit

Permalink
new files
Browse files Browse the repository at this point in the history
  • Loading branch information
willwade committed May 9, 2014
1 parent 631f48e commit 71b35ba
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Autohotkey/Mouse2Cursor/MouseCursor.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#SingleInstance Force
#Persistent
#NoEnv
SetTitleMatchMode, 2
SizeOfMovement=50 ; in pixels
TimeToPoll=10 ; ms - Time to Poll.

Loop
{
IfWinNotActive, Notepad ; Thus we only ever use this behavior in Notepad
{
Sleep 500 ; Optional. I don't know if this has any positive effect on script performance.
Continue
}
MouseGetPos, VarX1, VarY1
Sleep TimeToPoll
MouseGetPos, VarX2, VarY2
VarX:=VarX1-VarX2
VarY:=VarY1-VarY2

If(VarX>SizeOfMovement) ; if VarX1 was greater than VarX2, and that difference is greater than 50
Send {Left}
If(VarX<-SizeOfMovement)
Send {Right}
If(VarY>SizeOfMovement)
Send {Up}
If(VarY<-SizeOfMovement)
Send {Down}
}
42 changes: 42 additions & 0 deletions Autohotkey/MouseKeys/Cursor2Mouse.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#SingleInstance Force
#Persistent
#NoEnv
SetBatchLines, -1
SetDefaultMouseSpeed, 0
SetMouseDelay, 2 ;Change this number here to control the mouse speed. (the lower the number the faster the mouse speed & the higher the number the slower the mouse speed)

Up::
Key = Up
X = 0
Y = -1
Goto, Move_Mouse

Down::
Key = Down
X = 0
Y = 1
Goto, Move_Mouse

Left::
Key = Left
X = -1
Y = 0
Goto, Move_Mouse

Right::
Key = Right
X = 1
Y = 0
Goto, Move_Mouse



Move_Mouse:
Loop
{
MouseMove, %X%, %Y%, , R
GetKeyState, State, %Key%, P
If State = U
Break
}
Return
68 changes: 68 additions & 0 deletions Regedit/ToggleDHCP2Fixed.wsf
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<job><script language="VBScript">
Option Explicit

On Error Resume Next

Dim objWMIService
Dim objNetAdapter
Dim strComputer
Dim arrIPAddress
Dim arrSubnetMask
Dim arrGateway
Dim colNetAdapters
Dim errEnableStatic
Dim errGateways
Dim strInput
Dim errFailed

errFailed = 0

Dim response = MsgBox("title", MsgBoxStyle.YesNo, "Hospital-DHCP switcher")

If response = MsgBoxResult.Yes Then

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableDHCP()
If Not errEnable = 0 Then
WScript.Echo "Setting DHCP Failed."
errFailed = 1
End If
Next
Else
strComputer = "."
arrIPAddress = Array("192.168.81.95")
arrSubnetMask = Array("255.255.255.0")
arrGateway = Array("192.168.81.1")

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

For Each objNetAdapter in colNetAdapters
errEnableStatic = objNetAdapter.EnableStatic(arrIPAddress, arrSubnetMask)
If Not errEnableStatic = 0 Then
WScript.Echo "Failure assigning IP/Subnet."
errFailed = 1
End If

errGateways = objNetAdapter.SetGateways(arrGateway)
If Not errGateways = 0 Then
WScript.Echo "Failure assigning Gateway."
errFailed = 1
End If

Next

End If

If errFailed = 0 Then

WScript.Echo "IP Settings Successfully Modified."

End If

WScript.Quit
</script></job>

0 comments on commit 71b35ba

Please sign in to comment.