v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "User:Digger"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
m (upd)
Line 3: Line 3:
  
  
== BEHOLD THE MOUSE SCRIPT ==
+
== BEHOLD THE MOUSE SCRIPT 1.1 ==
  
 
I dedicate this script to '''ignir''', who, unable to use mouse in DF, left this awesome game long ago.
 
I dedicate this script to '''ignir''', who, unable to use mouse in DF, left this awesome game long ago.
 +
 +
[UPDATE] Added some minor tweaks/comments/explanations, simplified some hotkeys, fixed 1(omg) typo. The script now starts suspended, you have to "Alt + s" to enable it.
 +
 
<pre>
 
<pre>
 
;This is a script that enables basic mouse controls in DF. The precision of the scipt is ~1 tile for me.
 
;This is a script that enables basic mouse controls in DF. The precision of the scipt is ~1 tile for me.
Line 15: Line 18:
 
;Once you get a hand of it, you will realize that you can navigate to the places you can't even see on the screen.
 
;Once you get a hand of it, you will realize that you can navigate to the places you can't even see on the screen.
  
 
+
Suspend ;This one suspends the script in the beginning.
 
#InstallMouseHook ;This module of AutoHotKey tracks the mouse movement and clicks, it is not enabled by default, see AutoHotKey's readme for details
 
#InstallMouseHook ;This module of AutoHotKey tracks the mouse movement and clicks, it is not enabled by default, see AutoHotKey's readme for details
^+!z::Reload ;This one obviously reloads the script
+
^`::Reload ;This one obviously reloads the script = Ctrl + tilda(under Esc)
^!s::Suspend ;This one toggles hotkeys on and off
+
!s::Suspend ;This one toggles hotkeys on and off = Alt + s
  
  
Line 51: Line 54:
  
  
;these ones scroll Up/Down. Hold Left Ctrl & scroll! Hold z instead of Ctrl for a speed boost.
+
;these ones scroll Up/Down. Hold Left Ctrl & scroll! Hold a instead of Ctrl for a speed boost.
 
~LCtrl & WheelUp::
 
~LCtrl & WheelUp::
 
Loop %A_EventInfo%
 
Loop %A_EventInfo%
Line 76: Line 79:
 
Loop %A_EventInfo%
 
Loop %A_EventInfo%
 
{
 
{
Send {NumpadPgDown}
+
Send {NumpadPgDn}
 
}
 
}
 
return
 
return
Line 97: Line 100:
  
  
;Makes an Enter of Left Shift & LMB click.
+
;Makes an Enter of Left Shift/Left Ctrl & LMB click.
 
LShift & LButton::
 
LShift & LButton::
 +
Send {Enter}
 +
return
 +
 +
LCtrl & LButton::
 
Send {Enter}
 
Send {Enter}
 
return
 
return
Line 149: Line 156:
 
{
 
{
 
;estimating number of tiles to move, change 12x12 to YOUR tile size in order to get it right, it might be different in fullscreen/windowed, making it harder for you to use mouse
 
;estimating number of tiles to move, change 12x12 to YOUR tile size in order to get it right, it might be different in fullscreen/windowed, making it harder for you to use mouse
xpos2 /= 12
+
xpos2 /= 12 ;Change 12 to your tileset width
ypos2 /= 12
+
ypos2 /= 12 ;Change 12 to your tileset height
 
;MsgBox %xpos2% %ypos2%
 
;MsgBox %xpos2% %ypos2%
 
}
 
}
Line 197: Line 204:
 
return
 
return
  
 +
;Resetting mouse coordinates
 
LWin::
 
LWin::
 
xpos1 = 0
 
xpos1 = 0
Line 202: Line 210:
 
xpos2 = 0
 
xpos2 = 0
 
ypos2 = 0
 
ypos2 = 0
 +
return
 +
 +
 +
;Toggling left-right
 +
LCtrl & z::
 +
{
 +
Send {NumpadLeft}
 +
}
 +
return
 +
 +
LCtrl & x::
 +
{
 +
Send {NumpadRight}
 +
}
 +
return
 +
 +
 +
;Simple Ctrl + a to toggle 20 items in a trade window, perfect for people who buy all/sell all.
 +
$^a::
 +
Loop 20
 +
{
 +
Send {Enter}
 +
Sleep 30
 +
Send {Down}
 +
}
 
return
 
return
 
</pre>
 
</pre>

Revision as of 23:27, 4 March 2008

Hi, I'm Digger, usually I go by a nick of Meat_Grinder or Kaktyc, however in case of digging a fortress I had to assume this one. Usually I'm adding some minor stuff and just being nitpicky, feel free to remind me of that when you think I go overboard. These are my first wiki-contributions after all :)


BEHOLD THE MOUSE SCRIPT 1.1

I dedicate this script to ignir, who, unable to use mouse in DF, left this awesome game long ago.

[UPDATE] Added some minor tweaks/comments/explanations, simplified some hotkeys, fixed 1(omg) typo. The script now starts suspended, you have to "Alt + s" to enable it.

;This is a script that enables basic mouse controls in DF. The precision of the scipt is ~1 tile for me.
;Feel free to modify it, however remember that DF cannot tell where your mouse is, and AutoHotKey cannot tell where the DF's cursor is, so it is your job to synchronize them :)
;Alright, I did everything to KILL that Numpad control setup >:) Laptop users could probably easily play with this one.
;The only problem with this control is that it takes 2 mouseclicks to navigate, so it will probably kill your mouse(instead of your keyboard, what DF inevitably does) in the long run.

;Recommendations: 12x12 tileset, Windowed mode, wide/large screen, 3-button wheeled mouse, brains.
;Once you get a hand of it, you will realize that you can navigate to the places you can't even see on the screen.

Suspend			;This one suspends the script in the beginning.
#InstallMouseHook 	;This module of AutoHotKey tracks the mouse movement and clicks, it is not enabled by default, see AutoHotKey's readme for details
^`::Reload		;This one obviously reloads the script = Ctrl + tilda(under Esc)
!s::Suspend		;This one toggles hotkeys on and off = Alt + s


;these ones scroll -/+. Just scroll the wheel! Hold shift for a speed boost.
~WheelUp::
Loop %A_EventInfo%
{
	Send {NumpadSub}
}
return

~WheelDown::
Loop %A_EventInfo%
{
	Send {NumpadAdd}
}
return

~LShift & WheelUp::
Loop %A_EventInfo%
{
	Send {NumpadDiv}
}
return

~LShift & WheelDown::
Loop %A_EventInfo%
{
	Send {NumpadMult}
}
return


;these ones scroll Up/Down. Hold Left Ctrl & scroll! Hold a instead of Ctrl for a speed boost.
~LCtrl & WheelUp::
Loop %A_EventInfo%
{
	Send {NumpadUp}
}
return

~LCtrl & WheelDown::
Loop %A_EventInfo%
{
	Send {NumpadDown}
}
return

~z & WheelUp::
Loop %A_EventInfo%
{
	Send {NumpadPgUp}
}
return

~z & WheelDown::
Loop %A_EventInfo%
{
	Send {NumpadPgDn}
}
return


;Switching z-levels. Hold Left Alt & scroll the wheel! Alt for altitude ;)
~LAlt & WheelUp::
Loop %A_EventInfo%
{
	Send +{<}
}
return

~LAlt & WheelDown::
Loop %A_EventInfo%
{
	Send +{>}
}
return


;Makes an Enter of Left Shift/Left Ctrl & LMB click.
LShift & LButton::
Send {Enter}
return

LCtrl & LButton::
Send {Enter}
return


;These two make a "c" of a MMB click both with and without Left shift
LShift & MButton::
Send {c}
return

MButton::
Send {c}
return


;RMB click is made into a Space both with and without Left Shift by these two
LShift & RButton::
Send {Space}
return

RButton::
Send {Space}
return


;My supreme script that tracks mouse movements in between two LMB clicks and transforms them into cursor movements. You WILL have to adjust the 2 values down there if you are not using 12x12 tileset.
LButton::
Label1:
CoordMode, Mouse, Screen
;estimating coordinates
IfEqual xpos1, 0
{
	IfEqual ypos1, 0
	{
		MouseGetPos, xpos1, ypos1
	}
}else{
	IfEqual xpos2, 0
	{
		IfEqual ypos2, 0
		{
			MouseGetPos, xpos2, ypos2
			{
				;estimating difference in coordinates
				xpos2 -= %xpos1%
				ypos2 -= %ypos1%
				;MsgBox %xpos2% %ypos2%
			}

			{
				;estimating number of tiles to move, change 12x12 to YOUR tile size in order to get it right, it might be different in fullscreen/windowed, making it harder for you to use mouse
				xpos2 /= 12 ;Change 12 to your tileset width
				ypos2 /= 12 ;Change 12 to your tileset height
				;MsgBox %xpos2% %ypos2%
			}
			;moving the cursor
			Loop % Abs(xpos2)
			{
				If xpos2 > 0
				{
					Send {Right}
					;MsgBox WIN
				}else If xpos2 < 0
				{
					Send {Left}
					;MsgBox WIN
				}
			}
			Loop % Abs(ypos2)
			{
				if ypos2 > 0
				{
					Send {Down}
					;MsgBox WIN
				}else if ypos2 < 0
				{
					Send {Up}
					;MsgBox WIN
				}
			}
		} else
		{
			xpos1 = 0
			ypos1 = 0
			xpos2 = 0
			ypos2 = 0
			gosub Label1
		}
	} else
	{
		xpos1 = 0
		ypos1 = 0
		xpos2 = 0
		ypos2 = 0
		gosub Label1
	}
}
return

;Resetting mouse coordinates
LWin::
xpos1 = 0
ypos1 = 0
xpos2 = 0
ypos2 = 0
return


;Toggling left-right
LCtrl & z::
{
	Send {NumpadLeft}
}
return

LCtrl & x::
{
	Send {NumpadRight}
}
return


;Simple Ctrl + a to toggle 20 items in a trade window, perfect for people who buy all/sell all.
$^a:: 
Loop 20
{
	Send {Enter}
	Sleep 30
	Send {Down}
}
return