Rolanmen1

Fire Emblem - Position Swap

Dec 20th, 2011
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. cursorX = 0x0202BBCC
  2. cursorY = 0x0202BBCE
  3.  
  4. X = 0x0202BD60
  5. Y = 0x0202BD61
  6.  
  7. c = {}
  8.  
  9. units = {}
  10. size = 1
  11.  
  12. while true do
  13.     c = input.get()
  14.     if c.Q then
  15.         units = {}
  16.         size = 1
  17.         for i = 0, 131, 1 do
  18.             if(memory.readbyte(cursorX) == memory.readbyte(X+(i*72)) and memory.readbyte(cursorY) == memory.readbyte(Y+(i*72))) then
  19.                 units[size] = i
  20.                 size = size + 1
  21.             end
  22.         end
  23.     elseif c.W and size > 0 then
  24.         for i = 1, size-1, 1 do
  25.             memory.writebyte(X+(units[i]*72),memory.readbyte(cursorX))
  26.             memory.writebyte(Y+(units[i]*72),memory.readbyte(cursorY))
  27.         end
  28.     end
  29.     emu.frameadvance()
  30. end
Advertisement
Add Comment
Please, Sign In to add comment