Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------------------------------------------
- -- ATTENTION: These are the API functions currently implemented
- -- in EWT. The documentation is a copy from FireHack because the
- -- idea is EWT to mirror FireHack's API. If you need an API that
- -- is missing here or an API isn't behaving properly, let me know!
- ------------------------------------------------------------------
- ------------------------- Active Player -------------------
- --- Stop falling.
- function StopFalling () end
- --- Move to a position.
- -- X (number) - The X coordinate
- -- Y (number) - The Y coordinate
- -- Z (number) - The Z coordinate
- -- InstantTurn (boolean) - Whether to instantly turn toward the destination
- function MoveTo (X, Y, Z[, InstantTurn])
- --- Set the direction that the player is facing (angle in XY).
- -- Direction (number) - The direction in radians
- -- Update (boolean) - Whether to immediately notify the server
- function FaceDirection (Direction[, Update])
- --- Set the maximum angle from the XY plane that the player can move at
- -- Angle (number) - The maximum angle in degrees
- -- Note that the angle must be between 0º and 90º.
- function SetMaximumClimbAngle (Angle)
- ------------------------- Object --------------------------
- ObjectType = {
- Object,
- Item,
- Container,
- Unit,
- Player,
- GameObject,
- DynamicObject,
- Corpse,
- AreaTrigger,
- SceneObject,
- All,
- }
- ObjectTypes = {
- None = 0x0,
- Object = 0x1,
- Item = 0x2,
- Container = 0x4,
- Unit = 0x8,
- Player = 0x10,
- GameObject = 0x20,
- DynamicObject = 0x40,
- Corpse = 0x80,
- AreaTrigger = 0x100,
- SceneObject = 0x200,
- All = 0xFFFFFFFF,
- };
- --- Get an object's pointer.
- -- Object (object) - The object
- -- returns (string) - The pointer as a hexadecimal string prefixed by 0x
- function ObjectPointer (Object)
- --- Get an object's position.
- -- Object (object) - The object
- -- returns (number, number, number) - The X, Y, and Z coordinates
- function ObjectPosition (Object)
- --- Get an object's facing.
- -- Object (object) - The object
- -- returns (number) - The facing (angle in XY) in radians
- function ObjectFacing (Object)
- GetObjectFacing = ObjectFacing
- --- Get an object's GUID.
- -- Object (object) - The object
- -- returns (string) - The GUID
- function ObjectGUID (Object)
- --- Get whether an object exists in the object manager.
- -- Object (object) - The object
- -- returns (boolean) - Whether the object exists in the object manager
- -- Note that if the object does not exist in the object manager it is invalid.
- function ObjectExists (Object)
- --- Get an object's name.
- -- Object (object) - The object
- -- returns (string) - The name
- function ObjectName (Object)
- --- Get whether an object is of a type.
- -- Object (object) - The object
- -- Type (ObjectType member) - The type
- -- returns (boolean) - Whether the object is of the type
- function ObjectIsType (Object, Type)
- --- Get an object's type ID.
- -- Object (object) - The object
- -- returns (integer) - The type ID or nil if there is none
- function ObjectID (Object)
- --- Get an object's type flags.
- -- Object (object) - The object
- -- returns (integer) - One or more members of the ObjectType table combined with bit.bor
- function ObjectTypeFlags (Object)
- ObjectType = ObjectTypeFlags
- --- Get the distance between two objects.
- -- Object1 (object) - The first object
- -- Object2 (object) - The second object
- -- returns (number) - The distance
- function GetDistanceBetweenObjects (Object1, Object2)
- --- Get the angles between two objects.
- -- Object1 (object) - The first object
- -- Object2 (object) - The second object
- -- returns (number, number) - The facing (angle in XY) and pitch (angle from XY) from the first object to the second
- function GetAnglesBetweenObjects (Object1, Object2)
- --- Get the position that is between two objects and a specified distance from the first object.
- -- Object1 (object) - The first object
- -- Object2 (object) - The second object
- -- Distance (number) - The distance from the first object
- -- returns (number, number, number) - The X, Y, and Z coordinates
- function GetPositionBetweenObjects (Object1, Object2, Distance)
- --- Get whether an object is facing another.
- -- Object1 (object) - The first object
- -- Object2 (object) - The second object
- -- returns (boolean) - Whether the first object is facing the second
- function ObjectIsFacing (Object1, Object2)
- --- Get whether an object is behind another.
- -- Object1 (object) - The first object
- -- Object2 (object) - The second object
- -- returns (boolean) - Whether the first object is behind the second
- function ObjectIsBehind (Object1, Object2)
- --- Get one of an object's descriptors.
- -- Object (object) - The object
- -- Offset (integer) - The descriptor offset
- -- Type (Type member) - The descriptor type
- -- returns (Type) - The descriptor value
- function ObjectDescriptor (Object, Offset, Type)
- --- Get one of an object's fields.
- -- Object (object) - The object
- -- Offset (integer) - The field offset
- -- Type (Type member) - The field type
- -- returns (Type) - The field value
- function ObjectField (Object, Offset, Type)
- ------------------------- Object Manager ------------------
- --- Get the number of objects in the object manager.
- -- returns (integer) - The number of objects in the object manager
- function GetObjectCount ()
- ObjectCount = GetObjectCount
- --- Get an object in the object manager from its index.
- -- Index (integer) - The one-based index of the object
- -- returns (object) - The object
- function GetObjectWithIndex (Index)
- ObjectWithIndex = GetObjectWithIndex
- --- Get an object in the object manager from its pointer.
- -- Pointer (string) - A pointer to the object as a hexadecimal string prefixed by 0x
- -- returns (object) - The object
- function GetObjectWithPointer (Pointer)
- --- Get an object in the object manager from its GUID.
- -- GUID (string) - The GUID
- -- returns (object) - The object or nil if it does not in the object manager
- function GetObjectWithGUID (GUID)
- ------------------------- Unit ----------------------------
- --- Get an object's facing direction.
- -- @param Object The object. It must be of type Unit.
- -- @param Object The object.
- -- @param Angle The frontal cone angle in degrees. Default: 180 degrees
- -- @return Boolean. Whether it is facing or not.
- function UnitIsFacing (Object, Object[, Angle]) end
- --- Get a unit's movement flags.
- -- Unit (unit) - The unit
- -- returns (integer) - The movement flags
- function UnitMovementFlags (Unit)
- --- Get a unit's bounding radius.
- -- Unit (unit) - The unit
- -- returns (number) - The bounding radius
- function UnitBoundingRadius (Unit)
- --- Get a unit's combat reach.
- -- Unit (unit) - The unit
- -- returns (number) - The combat reach
- function UnitCombatReach (Unit)
- --- Get a unit's target.
- -- Unit (unit) - The unit
- -- returns (unit) - The target or nil if there is none
- function UnitTarget (Unit)
- --- Get a unit's creator.
- -- Unit (unit) - The unit
- -- returns (unit) - The creator or nil if there is none
- function UnitCreator (Unit)
- ------------------------- World ---------------------------
- --- Perform a raycast between two positions.
- -- StartX (number) - The starting X coordinate
- -- StartY (number) - The starting Y coordinate
- -- StartZ (number) - The starting Z coordinate
- -- EndX (number) - The ending X coordinate
- -- EndY (number) - The ending Y coordinate
- -- EndZ (number) - The ending Z coordinate
- -- Flags (integer) - One or more members of the HitFlags table combined with bit.bor
- -- returns (number, number, number) - The X, Y, and Z coordinates of the hit position, or nil if there was no hit
- function TraceLine (StartX, StartY, StartZ, EndX, EndY, EndZ, Flags)
- --- Get the camera position.
- -- returns (number, number, number) - The X, Y, and Z coordinates of the camera
- function GetCameraPosition ()
- --- Cancel the pending spell if any.
- function CancelPendingSpell ()
- --- Simulate a click at a position in the game-world.
- -- X (number) - The X coordinate
- -- Y (number) - The Y coordinate
- -- Z (number) - The Z coordinate
- -- Right (boolean) - Whether to right click rather than left click
- function ClickPosition (X, Y, Z[, Right])
- --- Get whether an AoE spell is pending a target.
- -- returns (boolean) - Whether an AoE spell is pending a target
- function IsAoEPending ()
- --- Get the screen coordinates relative from World coordinates
- -- @param X The X coordinate.
- -- @param Y The Y coordinate.
- -- @param Z The Z coordinate.
- -- @return The X and Y screen coordinates for the corresponding World coordinates.
- function WorldToScreen (X, Y, Z) end
- ------------------------- Hacks ---------------------------
- Hacks = {
- Fly = "Fly",
- Hover = "Hover",
- Climb = "Climb",
- MovingLoot = "MovingLoot",
- WaterWalk = "WaterWalk",
- M2Collision = "M2Collision",
- WMOCollision = "WMOCollision",
- TerrainCollision = "TerrainCollision",
- Zoom = "Zoom",
- AlwaysFacing = "AlwaysFacing",
- NoAutoAway = "NoAutoAway",
- NoSwim = "NoSwim",
- MultiJump = "MultiJump",
- CRZBlocking = "CRZBlocking",
- M2Rendering = "M2Rendering",
- WMORendering = "WMORendering",
- TerrainRendering = "TerrainRendering",
- LiquidRendering = "LiquidRendering",
- CollisionRendering = "CollisionRendering",
- MountainRendering = "MountainRendering",
- DetailsRendering = "DetailsRendering",
- Wireframe = "Wireframe",
- Freeze = "Freeze",
- MovingCast = "MovingCast",
- GoClick = "GoClick",
- UnlockLua = "UnlockLua",
- SimpleUnlock = "SimpleUnlock"
- }
- --- Get whether a hack is enabled.
- -- Hack (Hacks member) - The hack
- -- returns (boolean) - Whether the hack is enabled
- function IsHackEnabled (Hack)
- --- Set whether a hack is enabled.
- -- Hack (Hacks member) - The hack
- -- Enable (boolean) - Whether the hack is to be enabled
- function SetHackEnabled (Hack, Enable)
- SetOptionEnabled = SetHackEnabled
- ------------------------- File ----------------------------
- --- Get the names of the files in a directory.
- -- Path (string) - The path to the files
- -- returns (table) - The file names
- -- Example: "C:\*" would retrieve the names of all of the files in C:\.
- -- Example: "C:\*.dll" would retrieve the names of all of the .dll files in C:\.
- function GetDirectoryFiles (Path)
- --- Get the contents of a text file.
- -- Path (string) - The file path
- -- returns (string) - The file contents
- function ReadFile (Path)
- --- Set the contents of or append a text file.
- -- Path (string) - The file path
- -- String (string) - The string to write
- -- Append (boolean) - Whether to append rather than overwrite
- function WriteFile (Path, Contents[, Append])
- --- Get the directory that the hack is in.
- -- @return The directory that the hack is in.
- function GetHackDirectory () end
- GetFireHackDirectory = GetHackDirectory
- --- Get the directory that WoW is in.
- -- returns (string) - The directory that WoW is in
- function GetWoWDirectory ()
- ------------------------- Scripts -------------------------
- --- Load a script from the Scripts folder.
- -- FileName (string) - The script file name
- -- returns - The return values of the script if any
- function LoadScript (FileName)
- --- Get the file name of the currently executing script.
- -- returns (string) - The file name of the currently executing script
- -- Note that this can only be called from within a script.
- function GetScriptName ()
- ------------------------- Miscellaneous -------------------
- Types = {
- Bool = "bool",
- Char = "char",
- Byte = "byte",
- SByte = "char",
- UByte = "byte",
- Short = "short",
- SShort = "short",
- UShort = "ushort",
- Int = "int",
- SInt = "int",
- UInt = "uint",
- Long = "long",
- SLong = "long",
- ULong = "ulong",
- Float = "float",
- Double = "double",
- String = "string",
- GUID = "guid",
- };
- --- Open a URL in the default handler for the scheme.
- -- URL (string) - The URL
- function OpenURL (URL)
- --- Download data from a URL using an HTTP GET request.
- -- @param Host The host.
- -- @param URL The rest of the URL.
- -- @param Secure Whether to use HTTPS.
- -- @param OnComplete A function that is called with the data when the request completes.
- -- @param OnError A function that is called with the error message if an error occurs.
- function DownloadURL (Host, URL, Secure, OnComplete, OnError) end
- --- Get a session variable.
- -- Name (string) - The variable name
- -- returns (string) - The value
- function GetSessionVariable (Name)
- --- Set a session variable.
- -- Name (string) - The variable name
- -- Value (string) - The new value
- function SetSessionVariable (Name)
- --- Get whether the game client is the foreground window.
- -- returns (boolean) - Whether the game client is the foreground window
- function IsForeground ()
- --- Get the state of a key.
- -- Key (integer) - The virtual key code
- -- returns (boolean, boolean) - Whether the key is down and whether the key is toggled
- -- Virtual Key Codes: https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
- function GetKeyState (Key)
- --- Get an offset used by EWT
- -- Name (string) - The offset name
- -- returns (number) - The offset value if found
- -- Example: GetOffset("FrameScript_RegisterFunction") or GetOffset("CGGameObject_C__Animation") for Fishing bobber animation
- function GetOffset (Name)
- --- Get a WoW descriptor
- -- Group (string) - The group that the descriptor belongs
- -- Name (string) - The descriptor name
- -- returns (number) - The offset value if found
- -- Example: GetDescriptor("CGObjectData", "Scale") or GetDescriptor("CGPlayerData", "PlayerTitle")
- -- Notes: Descriptor name follows an upper camel case convention, like UpperCamelCase.
- -- For a list of WoW descriptors, check Ownedcore's Info Dump Threads in the Memory Editing Section
- function GetDescriptor (Group, Name)
Advertisement
Add Comment
Please, Sign In to add comment