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.

Editing User:Daedalusai

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.


The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 32: Line 32:
 
x := 0
 
x := 0
 
y := 0
 
y := 0
keystateflags := 0x0
 
 
 
 
;timer
 
;timer
Line 57: Line 56:
 
SetTimer, supplementchkswitch, Off
 
SetTimer, supplementchkswitch, Off
 
SetTimer, supplementchk, Off
 
SetTimer, supplementchk, Off
keystateflags := Chkkey(x, y)
+
if ChkaxisX(x) != 0
if keystateflags & 0x3 != 0
 
 
GuiControl, Text, TXvalue, % "X: " x
 
GuiControl, Text, TXvalue, % "X: " x
if keystateflags & 0xc != 0
+
if ChkaxisY(y) != 0
 
GuiControl, Text, TYvalue, % "Y: " y
 
GuiControl, Text, TYvalue, % "Y: " y
 
SetTimer, supplementchkswitch, On
 
SetTimer, supplementchkswitch, On
Line 76: Line 74:
 
;timer routine
 
;timer routine
 
supplementchk:
 
supplementchk:
if ( Chkkey(x, y) = 0x0 )
+
if (ChkaxisX(x)+ChkaxisY(y) = 0)
 
{
 
{
 
SetTimer, supplementchk, Off
 
SetTimer, supplementchk, Off
Line 92: Line 90:
 
;Functions
 
;Functions
  
Chkkey(ByRef x, ByRef y)
+
ChkaxisX(ByRef x)
 
{
 
{
keyflag := 0x0
+
xmove := 0
chkstateLR := 0x0
 
chkstateUD := 0x0
 
chkstateall := 0x0
 
 
steps := 1
 
steps := 1
 
prefix := ""
 
prefix := ""
 
GetKeyState, state, Left, P
 
GetKeyState, state, Left, P
 
if state = D
 
if state = D
keyflag += 0x1
+
xmove += 1
 
GetKeyState, state, Right, P
 
GetKeyState, state, Right, P
 
if state = D
 
if state = D
keyflag += 0x2
+
xmove += 3
GetKeyState, state, Up, P
 
if state = D
 
keyflag += 0x4
 
GetKeyState, state, Down, P
 
if state = D
 
keyflag += 0x8
 
 
 
if ( keyflag = 0x0 or keyflag = 0xf )
 
{
 
Return keyflag
 
}
 
chkstateLR := keyflag & 0x3
 
chkstateUD := keyflag & 0xc
 
 
 
 
GetKeyState, state, Shift, P
 
GetKeyState, state, Shift, P
 
if state = D
 
if state = D
Line 138: Line 119:
 
steps := 0
 
steps := 0
 
}
 
}
 
+
if xmove != 4
if ( chkstateLR != 0x3 and chkstateLR != 0x0 )
 
 
{
 
{
if chkstateLR = 0x1
+
if xmove != 0
 
{
 
{
Send %prefix%{Left}
+
if xmove = 1
x -= %steps%
+
{
 +
Send %prefix%{Left}
 +
x -= %steps%
 +
Return 1
 +
}
 +
else
 +
{
 +
Send %prefix%{Right}
 +
x += %steps%
 +
Return 3
 +
}
 
}
 
}
if chkstateLR = 0x2
+
else
 
{
 
{
Send %prefix%{Right}
+
Return 0
x += %steps%
 
 
}
 
}
 +
}
 +
else
 +
{
 +
Return 4
 +
}
 +
Return
 
}
 
}
  
if ( chkstateUD != 0xc and chkstateUD != 0x0 )
+
ChkaxisY(ByRef y)
{
+
{
if chkstateUD = 0x4
+
ymove := 0
 +
steps := 1
 +
prefix := ""
 +
GetKeyState, state, Up, P
 +
if state = D
 +
ymove += 1
 +
GetKeyState, state, Down, P
 +
if state = D
 +
ymove += 3
 +
GetKeyState, state, Shift,
 +
if state = D
 +
{
 +
prefix := prefix "+"
 +
steps := 10
 +
}
 +
GetKeyState, state,Ctrl,
 +
if state = D
 +
{
 +
prefix := prefix "^"
 +
steps := 0
 +
}
 +
GetKeyState, state, Alt,
 +
if state = D
 +
{
 +
prefix := prefix "!"
 +
steps := 0
 +
}
 +
if ymove != 4
 +
{
 +
if ymove != 0
 
{
 
{
Send %prefix%{Up}
+
if ymove = 1
y += %steps%
+
{
 +
Send %prefix%{Up}
 +
y += %steps%
 +
Return 1
 +
}
 +
else
 +
{
 +
Send %prefix%{Down}
 +
y -= %steps%
 +
Return 3
 +
}
 
}
 
}
if chkstateUD = 0x8
+
else
 
{
 
{
Send %prefix%{Down}
+
Return 0
y -= %steps%
 
 
}
 
}
 
}
 
}
 
+
else
fexit:
+
{
Return keyflag
+
Return 4
 +
}
 +
Return
 
}
 
}
  

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)