Advertisement
dragonbane

Lua Custom Function Documentation

Feb 19th, 2017
545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. ReadValue8(memoryAddress as Number) //Reads 1 Byte from the address
  2. ReadValue16(memoryAddress as Number) //Reads 2 Byte from the address
  3. ReadValue32(memoryAddress as Number) //Reads 4 Byte from the address
  4. ReadValueFloat(memoryAddress as Number) //Reads 4 Bytes as a Float from the address
  5. ReadValueString(memoryAddress as Number, length as Number) //Reads "length" amount of characters from the address as a String
  6.  
  7. WriteValue8(memoryAddress as Number, value as Number) //Writes 1 Byte to the address
  8. WriteValue16(memoryAddress as Number, value as Number) //Writes 2 Byte to the address
  9. WriteValue32(memoryAddress as Number, value as Number) //Writes 4 Byte to the address
  10. WriteValueFloat(memoryAddress as Number, value as Number) //Writes 4 Bytes as a Float to the address
  11. WriteValueString(memoryAddress as Number, text as String) //Writes the string to the address
  12.  
  13. GetPointerNormal(memoryAddress as Number) //Reads the pointer address from the memory, checks if its valid and if so returns the normal address. You can use this function for example to get Links Pointer from the address 0x3ad860. To the return value you simply need to add the offset 0x34E4 and then do a ReadValueFloat with the resulting address to get Links speed (in TWW)
  14.  
  15. PressButton(Button as String) //Presses the indicated button down, can call this with "Start" for example to press the Start button down. This is a bit buggy still and Buttons need to be pressed every frame or they are automatically released
  16.  
  17. ReleaseButton(Button as String) //Releases the indicated button. Not really needed atm cause buttons are pressed for only 1 frame
  18.  
  19. SetMainStickX(pos as Number) //Sets the main control stick X Pos
  20. SetMainStickY(pos as Number) //Sets the main control stick Y Pos
  21.  
  22. SetCStickX(pos as Number) //Sets the C-Stick X Pos
  23. SetCStickY(pos as Number) //Sets the C-Stick Y Pos
  24.  
  25. SaveState(useSlot as Boolean, slotID/stateName as Number/String) //Saves the current state in the indicated slot number or fileName
  26. LoadState(useSlot as Boolean, slotID/stateName as Number/String) //Loads the state from the indicated slot number or fileName
  27.  
  28. GetFrameCount() //Returns the current visual frame count. Can use this and a global variable for example to check for frame advancements and how long the script is running in frames
  29.  
  30. GetInputFrameCount() //Returns the current input frame count
  31.  
  32. MsgBox(message as String, delayMS as Number) //Dolphin will show the indicated message in the upper-left corner for the indicated length (in milliseconds). Default length is 5 seconds
  33.  
  34. CancelScript() //Cancels the script
  35.  
  36.  
  37. Button List:
  38.  
  39. A
  40. B
  41. X
  42. Y
  43. Z
  44. L
  45. R
  46. Start
  47. D-Up
  48. D-Down
  49. D-Left
  50. D-Right
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement