Guest User

Untitled

a guest
Nov 21st, 2016
796
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.03 KB | None | 0 0
  1. ------------------------------------------------------------------
  2. -- ATTENTION: These are the API functions currently implemented
  3. -- in EWT. The documentation is a copy from FireHack because the
  4. -- idea is EWT to mirror FireHack's API. If you need an API that
  5. -- is missing here or an API isn't behaving properly, let me know!
  6. ------------------------------------------------------------------
  7.  
  8.  
  9. ------------------------- Active Player -------------------
  10.  
  11. --- Stop falling.
  12. function StopFalling () end
  13.  
  14. --- Move to a position.
  15. -- X (number) - The X coordinate
  16. -- Y (number) - The Y coordinate
  17. -- Z (number) - The Z coordinate
  18. -- InstantTurn (boolean) - Whether to instantly turn toward the destination
  19. function MoveTo (X, Y, Z[, InstantTurn])
  20.  
  21. --- Set the direction that the player is facing (angle in XY).
  22. -- Direction (number) - The direction in radians
  23. -- Update (boolean) - Whether to immediately notify the server
  24. function FaceDirection (Direction[, Update])
  25.  
  26. --- Set the maximum angle from the XY plane that the player can move at
  27. -- Angle (number) - The maximum angle in degrees
  28. -- Note that the angle must be between 0º and 90º.
  29. function SetMaximumClimbAngle (Angle)
  30.  
  31. ------------------------- Object --------------------------
  32.  
  33. ObjectType = {
  34. Object,
  35. Item,
  36. Container,
  37. Unit,
  38. Player,
  39. GameObject,
  40. DynamicObject,
  41. Corpse,
  42. AreaTrigger,
  43. SceneObject,
  44. All,
  45. }
  46.  
  47. ObjectTypes = {
  48. None = 0x0,
  49. Object = 0x1,
  50. Item = 0x2,
  51. Container = 0x4,
  52. Unit = 0x8,
  53. Player = 0x10,
  54. GameObject = 0x20,
  55. DynamicObject = 0x40,
  56. Corpse = 0x80,
  57. AreaTrigger = 0x100,
  58. SceneObject = 0x200,
  59. All = 0xFFFFFFFF,
  60. };
  61.  
  62. --- Get an object's pointer.
  63. -- Object (object) - The object
  64. -- returns (string) - The pointer as a hexadecimal string prefixed by 0x
  65. function ObjectPointer (Object)
  66.  
  67. --- Get an object's position.
  68. -- Object (object) - The object
  69. -- returns (number, number, number) - The X, Y, and Z coordinates
  70. function ObjectPosition (Object)
  71.  
  72. --- Get an object's facing.
  73. -- Object (object) - The object
  74. -- returns (number) - The facing (angle in XY) in radians
  75. function ObjectFacing (Object)
  76. GetObjectFacing = ObjectFacing
  77.  
  78. --- Get an object's GUID.
  79. -- Object (object) - The object
  80. -- returns (string) - The GUID
  81. function ObjectGUID (Object)
  82.  
  83. --- Get whether an object exists in the object manager.
  84. -- Object (object) - The object
  85. -- returns (boolean) - Whether the object exists in the object manager
  86. -- Note that if the object does not exist in the object manager it is invalid.
  87. function ObjectExists (Object)
  88.  
  89. --- Get an object's name.
  90. -- Object (object) - The object
  91. -- returns (string) - The name
  92. function ObjectName (Object)
  93.  
  94. --- Get whether an object is of a type.
  95. -- Object (object) - The object
  96. -- Type (ObjectType member) - The type
  97. -- returns (boolean) - Whether the object is of the type
  98. function ObjectIsType (Object, Type)
  99.  
  100. --- Get an object's type ID.
  101. -- Object (object) - The object
  102. -- returns (integer) - The type ID or nil if there is none
  103. function ObjectID (Object)
  104.  
  105. --- Get an object's type flags.
  106. -- Object (object) - The object
  107. -- returns (integer) - One or more members of the ObjectType table combined with bit.bor
  108. function ObjectTypeFlags (Object)
  109. ObjectType = ObjectTypeFlags
  110.  
  111. --- Get the distance between two objects.
  112. -- Object1 (object) - The first object
  113. -- Object2 (object) - The second object
  114. -- returns (number) - The distance
  115. function GetDistanceBetweenObjects (Object1, Object2)
  116.  
  117. --- Get the angles between two objects.
  118. -- Object1 (object) - The first object
  119. -- Object2 (object) - The second object
  120. -- returns (number, number) - The facing (angle in XY) and pitch (angle from XY) from the first object to the second
  121. function GetAnglesBetweenObjects (Object1, Object2)
  122.  
  123. --- Get the position that is between two objects and a specified distance from the first object.
  124. -- Object1 (object) - The first object
  125. -- Object2 (object) - The second object
  126. -- Distance (number) - The distance from the first object
  127. -- returns (number, number, number) - The X, Y, and Z coordinates
  128. function GetPositionBetweenObjects (Object1, Object2, Distance)
  129.  
  130. --- Get whether an object is facing another.
  131. -- Object1 (object) - The first object
  132. -- Object2 (object) - The second object
  133. -- returns (boolean) - Whether the first object is facing the second
  134. function ObjectIsFacing (Object1, Object2)
  135.  
  136. --- Get whether an object is behind another.
  137. -- Object1 (object) - The first object
  138. -- Object2 (object) - The second object
  139. -- returns (boolean) - Whether the first object is behind the second
  140. function ObjectIsBehind (Object1, Object2)
  141.  
  142. --- Get one of an object's descriptors.
  143. -- Object (object) - The object
  144. -- Offset (integer) - The descriptor offset
  145. -- Type (Type member) - The descriptor type
  146. -- returns (Type) - The descriptor value
  147. function ObjectDescriptor (Object, Offset, Type)
  148.  
  149. --- Get one of an object's fields.
  150. -- Object (object) - The object
  151. -- Offset (integer) - The field offset
  152. -- Type (Type member) - The field type
  153. -- returns (Type) - The field value
  154. function ObjectField (Object, Offset, Type)
  155.  
  156. ------------------------- Object Manager ------------------
  157.  
  158. --- Get the number of objects in the object manager.
  159. -- returns (integer) - The number of objects in the object manager
  160. function GetObjectCount ()
  161. ObjectCount = GetObjectCount
  162.  
  163. --- Get an object in the object manager from its index.
  164. -- Index (integer) - The one-based index of the object
  165. -- returns (object) - The object
  166. function GetObjectWithIndex (Index)
  167. ObjectWithIndex = GetObjectWithIndex
  168.  
  169. --- Get an object in the object manager from its pointer.
  170. -- Pointer (string) - A pointer to the object as a hexadecimal string prefixed by 0x
  171. -- returns (object) - The object
  172. function GetObjectWithPointer (Pointer)
  173.  
  174. --- Get an object in the object manager from its GUID.
  175. -- GUID (string) - The GUID
  176. -- returns (object) - The object or nil if it does not in the object manager
  177. function GetObjectWithGUID (GUID)
  178.  
  179. ------------------------- Unit ----------------------------
  180.  
  181. --- Get an object's facing direction.
  182. -- @param Object The object. It must be of type Unit.
  183. -- @param Object The object.
  184. -- @param Angle The frontal cone angle in degrees. Default: 180 degrees
  185. -- @return Boolean. Whether it is facing or not.
  186. function UnitIsFacing (Object, Object[, Angle]) end
  187.  
  188. --- Get a unit's movement flags.
  189. -- Unit (unit) - The unit
  190. -- returns (integer) - The movement flags
  191. function UnitMovementFlags (Unit)
  192.  
  193. --- Get a unit's bounding radius.
  194. -- Unit (unit) - The unit
  195. -- returns (number) - The bounding radius
  196. function UnitBoundingRadius (Unit)
  197.  
  198. --- Get a unit's combat reach.
  199. -- Unit (unit) - The unit
  200. -- returns (number) - The combat reach
  201. function UnitCombatReach (Unit)
  202.  
  203. --- Get a unit's target.
  204. -- Unit (unit) - The unit
  205. -- returns (unit) - The target or nil if there is none
  206. function UnitTarget (Unit)
  207.  
  208. --- Get a unit's creator.
  209. -- Unit (unit) - The unit
  210. -- returns (unit) - The creator or nil if there is none
  211. function UnitCreator (Unit)
  212.  
  213. ------------------------- World ---------------------------
  214.  
  215. --- Perform a raycast between two positions.
  216. -- StartX (number) - The starting X coordinate
  217. -- StartY (number) - The starting Y coordinate
  218. -- StartZ (number) - The starting Z coordinate
  219. -- EndX (number) - The ending X coordinate
  220. -- EndY (number) - The ending Y coordinate
  221. -- EndZ (number) - The ending Z coordinate
  222. -- Flags (integer) - One or more members of the HitFlags table combined with bit.bor
  223. -- returns (number, number, number) - The X, Y, and Z coordinates of the hit position, or nil if there was no hit
  224. function TraceLine (StartX, StartY, StartZ, EndX, EndY, EndZ, Flags)
  225.  
  226. --- Get the camera position.
  227. -- returns (number, number, number) - The X, Y, and Z coordinates of the camera
  228. function GetCameraPosition ()
  229.  
  230. --- Cancel the pending spell if any.
  231. function CancelPendingSpell ()
  232.  
  233. --- Simulate a click at a position in the game-world.
  234. -- X (number) - The X coordinate
  235. -- Y (number) - The Y coordinate
  236. -- Z (number) - The Z coordinate
  237. -- Right (boolean) - Whether to right click rather than left click
  238. function ClickPosition (X, Y, Z[, Right])
  239.  
  240. --- Get whether an AoE spell is pending a target.
  241. -- returns (boolean) - Whether an AoE spell is pending a target
  242. function IsAoEPending ()
  243.  
  244. --- Get the screen coordinates relative from World coordinates
  245. -- @param X The X coordinate.
  246. -- @param Y The Y coordinate.
  247. -- @param Z The Z coordinate.
  248. -- @return The X and Y screen coordinates for the corresponding World coordinates.
  249. function WorldToScreen (X, Y, Z) end
  250.  
  251. ------------------------- Hacks ---------------------------
  252.  
  253. Hacks = {
  254. Fly = "Fly",
  255. Hover = "Hover",
  256. Climb = "Climb",
  257. MovingLoot = "MovingLoot",
  258. WaterWalk = "WaterWalk",
  259. M2Collision = "M2Collision",
  260. WMOCollision = "WMOCollision",
  261. TerrainCollision = "TerrainCollision",
  262. Zoom = "Zoom",
  263. AlwaysFacing = "AlwaysFacing",
  264. NoAutoAway = "NoAutoAway",
  265. NoSwim = "NoSwim",
  266. MultiJump = "MultiJump",
  267. CRZBlocking = "CRZBlocking",
  268. M2Rendering = "M2Rendering",
  269. WMORendering = "WMORendering",
  270. TerrainRendering = "TerrainRendering",
  271. LiquidRendering = "LiquidRendering",
  272. CollisionRendering = "CollisionRendering",
  273. MountainRendering = "MountainRendering",
  274. DetailsRendering = "DetailsRendering",
  275. Wireframe = "Wireframe",
  276. Freeze = "Freeze",
  277. MovingCast = "MovingCast",
  278. GoClick = "GoClick",
  279. UnlockLua = "UnlockLua",
  280. SimpleUnlock = "SimpleUnlock"
  281. }
  282.  
  283. --- Get whether a hack is enabled.
  284. -- Hack (Hacks member) - The hack
  285. -- returns (boolean) - Whether the hack is enabled
  286. function IsHackEnabled (Hack)
  287.  
  288. --- Set whether a hack is enabled.
  289. -- Hack (Hacks member) - The hack
  290. -- Enable (boolean) - Whether the hack is to be enabled
  291. function SetHackEnabled (Hack, Enable)
  292. SetOptionEnabled = SetHackEnabled
  293.  
  294. ------------------------- File ----------------------------
  295.  
  296. --- Get the names of the files in a directory.
  297. -- Path (string) - The path to the files
  298. -- returns (table) - The file names
  299. -- Example: "C:\*" would retrieve the names of all of the files in C:\.
  300. -- Example: "C:\*.dll" would retrieve the names of all of the .dll files in C:\.
  301. function GetDirectoryFiles (Path)
  302.  
  303. --- Get the contents of a text file.
  304. -- Path (string) - The file path
  305. -- returns (string) - The file contents
  306. function ReadFile (Path)
  307.  
  308. --- Set the contents of or append a text file.
  309. -- Path (string) - The file path
  310. -- String (string) - The string to write
  311. -- Append (boolean) - Whether to append rather than overwrite
  312. function WriteFile (Path, Contents[, Append])
  313.  
  314. --- Get the directory that the hack is in.
  315. -- @return The directory that the hack is in.
  316. function GetHackDirectory () end
  317. GetFireHackDirectory = GetHackDirectory
  318.  
  319. --- Get the directory that WoW is in.
  320. -- returns (string) - The directory that WoW is in
  321. function GetWoWDirectory ()
  322.  
  323. ------------------------- Scripts -------------------------
  324.  
  325. --- Load a script from the Scripts folder.
  326. -- FileName (string) - The script file name
  327. -- returns - The return values of the script if any
  328. function LoadScript (FileName)
  329.  
  330. --- Get the file name of the currently executing script.
  331. -- returns (string) - The file name of the currently executing script
  332. -- Note that this can only be called from within a script.
  333. function GetScriptName ()
  334.  
  335. ------------------------- Miscellaneous -------------------
  336.  
  337. Types = {
  338. Bool = "bool",
  339. Char = "char",
  340. Byte = "byte",
  341. SByte = "char",
  342. UByte = "byte",
  343. Short = "short",
  344. SShort = "short",
  345. UShort = "ushort",
  346. Int = "int",
  347. SInt = "int",
  348. UInt = "uint",
  349. Long = "long",
  350. SLong = "long",
  351. ULong = "ulong",
  352. Float = "float",
  353. Double = "double",
  354. String = "string",
  355. GUID = "guid",
  356. };
  357.  
  358. --- Open a URL in the default handler for the scheme.
  359. -- URL (string) - The URL
  360. function OpenURL (URL)
  361.  
  362. --- Download data from a URL using an HTTP GET request.
  363. -- @param Host The host.
  364. -- @param URL The rest of the URL.
  365. -- @param Secure Whether to use HTTPS.
  366. -- @param OnComplete A function that is called with the data when the request completes.
  367. -- @param OnError A function that is called with the error message if an error occurs.
  368. function DownloadURL (Host, URL, Secure, OnComplete, OnError) end
  369.  
  370. --- Get a session variable.
  371. -- Name (string) - The variable name
  372. -- returns (string) - The value
  373. function GetSessionVariable (Name)
  374.  
  375. --- Set a session variable.
  376. -- Name (string) - The variable name
  377. -- Value (string) - The new value
  378. function SetSessionVariable (Name)
  379.  
  380. --- Get whether the game client is the foreground window.
  381. -- returns (boolean) - Whether the game client is the foreground window
  382. function IsForeground ()
  383.  
  384. --- Get the state of a key.
  385. -- Key (integer) - The virtual key code
  386. -- returns (boolean, boolean) - Whether the key is down and whether the key is toggled
  387. -- Virtual Key Codes: https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
  388. function GetKeyState (Key)
  389.  
  390. --- Get an offset used by EWT
  391. -- Name (string) - The offset name
  392. -- returns (number) - The offset value if found
  393. -- Example: GetOffset("FrameScript_RegisterFunction") or GetOffset("CGGameObject_C__Animation") for Fishing bobber animation
  394. function GetOffset (Name)
  395.  
  396. --- Get a WoW descriptor
  397. -- Group (string) - The group that the descriptor belongs
  398. -- Name (string) - The descriptor name
  399. -- returns (number) - The offset value if found
  400. -- Example: GetDescriptor("CGObjectData", "Scale") or GetDescriptor("CGPlayerData", "PlayerTitle")
  401. -- Notes: Descriptor name follows an upper camel case convention, like UpperCamelCase.
  402. -- For a list of WoW descriptors, check Ownedcore's Info Dump Threads in the Memory Editing Section
  403. function GetDescriptor (Group, Name)
Advertisement
Add Comment
Please, Sign In to add comment