Coder Social home page Coder Social logo

aoe2hd_numpad_macro's Introduction

AoE2HD_numpad_macro

USE VIEW RAW

SetBatchLines, -1 ; Waiting-time script does not need to run super fast defSleep := 20 longSleep := 40 lastKey := "" autoTimeout := 0

; loop encompasses all except for exit loop { ;autotimeout section to reset last keydown if(autoTimeout > 200){ lastKey := "" autoTimeout := 0 } autoTimeout++

; fast click, this one is getkeystate because that detects keydown while the :: detects only keyup
if GetKeyState("Numpad0", "P"){
	if GetKeyState("a", "P"){
		lastKey := "a"
	}
	if GetKeyState("s", "P"){
		lastKey := "s"
	}
	if GetKeyState("d", "P"){
		lastKey := "d"
	}
	if GetKeyState("f", "P"){
		lastKey := "f"
	}
	if GetKeyState("g", "P"){
		lastKey := "g"
	}
	;it needs to do it this way, if it tries to send the key while anything other than numpad0 is held, it won't repeat
	send {%lastKey%}
}
continue

Numpad0::
if GetKeyState("a", "P"){
	send {a}
}
continue

; stag defense
Numpad1::
send {c}
sleep, %defSleep%
send {s}
continue

; build lumber
Numpad4::
send {a}
sleep, %defSleep%
send {r}
continue

; build house array
Numpad5::
MouseGetPos, xpos, ypos
send {a}
sleep, %defSleep%
send {q}
loop, 20{
	send +{LButton}
	xpos -= 36
	ypos += 18
	MouseMove, xpos, ypos
}
continue

; build mining
Numpad6::
send {a}
sleep, %defSleep%
send {e}
continue

; build palisade
Numpad7::
send {s}
sleep, %defSleep%
send {s}
continue

; build farm
Numpad8::
send {a}
sleep, %defSleep%
send {a}
continue

; build mill
Numpad9::
send {a}
sleep, %defSleep%
send {w}
continue

;sleep, %defSleep%
return

}

Numpad3::exitapp

aoe2hd_numpad_macro's People

Contributors

mercalyn avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.