Here is a collection of ProTRG functions that facilitate the making of EUDs and DC arithmetic. Actually, I'm still in the concept stage for the DC arithmetic and it will take me significantly longer, so I'll release what I have done so far with the EUDs. It contains a function for EUD Keypresses and almost everything mentioned
.
EDIT: Added functions for DC assignment, multiplication, division, and assignment to resource. Even though multiplication and division are nowhere near as efficient as Morphling's MT scripts..
Release 3: Vast improvements.
SYNOPSIS:
dcList[53] - List of usable death counters.
trgEx - Constant passable parameter specifying exclusion. Value is 4294967295.
dcInit(dcl) - Initializes a list of variables to unique death counters (dcList).
trgHyperCommon(to, qual, com) - Sets four common hyper triggers.
[to: Trigger Owner]
[qual: Qualification Conditions (list of conditions, excludable)]
[com: Comment (excludable)]
trgHyperSwitch(to, to2, s, qual, com) - Sets a pair of switch hyper triggers.
[to: Trigger Owner]
[to2: Trigger Owner]
[s: Switch]
[qual: Qualification Conditions (list of conditions, excludable)]
[com: Comment (excludable)]
epdKeypress(key) - Detects pressing of a key.
[key: String ID of Key (refer to the declaration for a list)]
epdScreen(coLX, coLY, coMX, coMY) - Detects coordinates of the screen.
[coLX: Screen Coordinate Least X (excludable)]
[coLY: Screen Coordinate Least Y (excludable)]
[coMX: Screen Coordinate Most X (excludable)]
[coMY: Screen Coordinate Most Y (excludable)]
epdMouse(coLX, coLY, coMX, coMY) - Detects coordinates of the mouse.
[coLX: Mouse Coordinate Least X (excludable)]
[coLY: Mouse Coordinate Least Y (excludable)]
[coMX: Mouse Coordinate Most X (excludable)]
[coMY: Mouse Coordinate Most Y (excludable)]
epdSelection(p, slot, uiL, uiM) - Detects selection of a unit.
[p: Player]
[slot: Slot of Selection (0-11)]
[uiL: Unit Index Least (excludable)]
[uiM: Unit Index Most (excludable)]
epdHotkey(p, hkey, slot, uiL, uiM) - Detects hotkey of a unit.
[p: Player]
[hkey: Hotkey (0-9)]
[slot: Slot of Hotkey (0-11)]
[uiL: Unit Index Least (excludable)]
[uiM: Unit Index Most (excludable)]
epdHealth(ui, hpL, decL, hpM, decM) - Detects health points of a unit.
[ui: Unit Index]
[hpL: Health Points Least (excludable)]
[decL: Decimal Least (0-255, excludable ONLY if hpL is excluded)]
[hpM: Health Points Most (excludable)]
[decM: Decimal Most (0-255, excludable ONLY if hpM is excluded)]
epdShield(ui, spL, decL, spM, decM) - Detects shield points of a unit.
[ui: Unit Index]
[spL: Shield Points Least (excludable)]
[decL: Decimal Least (0-255, excludable ONLY if spL is excluded)]
[spM: Shield Points Most (excludable)]
[decM: Decimal Most (0-255, excludable ONLY if spM is excluded)]
epdEnergy(ui, epL, decL, epM, decM) - Detects energy points of a unit.
[ui: Unit Index]
[epL: Energy Points Least (excludable)]
[decL: Decimal Least (0-255, excludable ONLY if epL is excluded)]
[epM: Energy Points Most (excludable)]
[decM: Decimal Most (0-255, excludable ONLY if epM is excluded)]
epdCoordinate(ui, coLX, coLY, coMX, coMY) - Detects coordinates of a unit.
[ui: Unit Index]
[coLX: Coordinate Least X (excludable ONLY if coLY is excluded)]
[coLY: Coordinate Least Y (excludable ONLY if coLX is excluded)]
[coMX: Coordinate Most X (excludable ONLY if coMY is excluded)]
[coMY: Coordinate Most Y (excludable ONLY if coMX is excluded)]
epdOrderCoordinate(ui, coLX, coLY, coMX, coMY) - Detects order coordinates of a unit.
[ui: Unit Index]
[coLX: Order Coordinate Least X (excludable ONLY if coLY is excluded)]
[coLY: Order Coordinate Least Y (excludable ONLY if coLX is excluded)]
[coMX: Order Coordinate Most X (excludable ONLY if coMY is excluded)]
[coMY: Order Coordinate Most Y (excludable ONLY if coMX is excluded)]
epdRallyCoordinate(ui, coLX, coLY, coMX, coMY) - Detects rally coordinates of a unit.
[ui: Unit Index]
[coLX: Rally Coordinate Least X (excludable ONLY if coLY is excluded)]
[coLY: Rally Coordinate Least Y (excludable ONLY if coLX is excluded)]
[coMX: Rally Coordinate Most X (excludable ONLY if coMY is excluded)]
[coMY: Rally Coordinate Most Y (excludable ONLY if coMX is excluded)]
epdDirection(ui, offL, offM) - Detects direction of a unit.
[ui: Unit Index]
[offL: Clockwise Offset Least (0-255, excludable)]
[offM: Clockwise Offset Most (0-255, excludable)]
epdOwner(ui, pL, pM) - Detects owner of a unit.
[ui: Unit Index]
[pL: Player Least (excludable)]
[pM: Player Most (excludable)]
epdTarget(ui, tuiL, tuiM) - Detects targeting unit of a unit.
[ui: Unit Index]
[tuiL: Target Unit Index Least (excludable)]
[tuiM: Target Unit Index Most (excludable)]
epdAttackCooldown(ui, cdL, cdM) - Detects attack cooldown of a unit.
[ui: Unit Index]
[cdL: Cooldown Least (excludable)]
[cdM: Cooldown Most (excludable)]
epdKillCount(ui, kcL, kcM) - Detects kill count of a unit.
[ui: Unit Index]
[kcL: Kill Count Least (excludable)]
[kcM: Kill Count Most (excludable)]
epdBlind(ui, state) - Detects blind state of a unit.
[ui: Unit Index]
[state: Binary State]
epdMaelstrom(ui, tL, tM) - Detects maelstrom timer of a unit.
[ui: Unit Index]
[tL: Timer Least (excludable)]
[tM: Time Most (excludable)]
dcAssign(src, dst, max, to, dco, qual, com, stor, ret) - Assigns a death counter to another death counter.
[src: Source Death Counter]
[dst: Destination Death Counter]
[max: Maximum Value (power of 2)]
[to: Trigger Owner]
[dco: Death Counter Owner]
[qual: Qualifying Conditions (list of conditions, excludable)]
[com: Comment (excludable)]
[stor: Storage Death Counter (excludable ONLY if ret is 0)]
[ret: Binary Specifier to Retain Source Death Counter]
dcMultiply(mand, mier, prod, amax, imax, to, dco, qual, com, stor, stor2, aret, iret) - Multiplies two death counters.
[mand: Multiplicand Death Counter]
[mier: Multiplier Death Counter]
[prod: Product Death Counter]
[amax: Maximum Value of Multiplicand Death Counter (power of 2)]
[imax: Maximum Value of Multiplier Death Counter (power of 2)]
[to: Trigger Owner]
[dco: Death Counter Owner]
[qual: Qualifying Conditions (list of conditions, excludable)]
[com: Comment (excludable)]
[stor: Storage Death Counter]
[stor2: Storage Death Counter (excludable ONLY if iret is 0]
[aret: Binary Specifier to Retain Multiplicand Death Counter]
[iret: Binary Specifier to Retain Multiplier Death Counter]
dcDivide(dend, dsor, quo, emax, smax, to, dco, qual, com, stor, stor2, stor3, eret, sret) - Divides two death counters.
[dend: Dividend Death Counter]
[dsor: Divisor Death Counter]
[quo: Quotient Death Counter]
[emax: Maximum Value of Dividend Death Counter (power of 2)]
[smax: Maximum Value of Divisor Death Counter (power of 2)]
[to: Trigger Owner]
[dco: Death Counter Owner]
[qual: Qualifying Conditions (list of conditions, excludable)]
[com: Comment (excludable)]
[stor: Storage Death Counter]
[stor2: Storage Death Counter]
[stor3: Storage Death Counter (excludable ONLY if eret is 0)]
[eret: Binary Specifier to Retain Dividend Death Counter]
[sret: Binary Specifier to Retain Divisor Death Counter]
dcResource(dc, res, max, to, dco, ro, qual, com, stor, ret, clear) - Sets a death counter to a resource.
[dc: Death Counter]
[res: Resource Type]
[max: Maximum Value (power of 2)]
[to: Trigger Owner]
[dco: Death Counter Owner]
[ro: Resource Owner]
[qual: Qualifying Conditions (list of conditions, excludable)]
[com: Comment (excludable)]
[stor: Storage Death Couter (excludable ONLY if ret is 0)]
[ret: Binary Specifier to Retain Death Counter]
[clear: Binary Specifier to Initialize Resource to 0]