Advertisement
N3rdsWithGame

textbox.lua

May 3rd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. local textboxAddr = 0x1D887C
  2.  
  3. local textboxState = 0
  4. local midTextbox = false
  5.  
  6. local fastTB = {}
  7. fastTB['B']=1
  8.  
  9. local closeTB={}
  10. closeTB['A']=1
  11.  
  12. while true do
  13.   textboxState = mainmemory.readbyte(textboxAddr)
  14.  
  15.   if textboxState == 0x35 then
  16.     joypad.set(closeTB,1)
  17.     midTextbox = false
  18.   elseif textboxState == 0x34 then
  19.     joypad.set(closeTB,1)
  20.   elseif textboxState == 0x06 then
  21.     if midTextbox==false then
  22.       joypad.set(fastTB,1)
  23.     end
  24.     midTextbox=true
  25.   elseif textboxState==0x0 then
  26.     midTextbox=false
  27.   end
  28.   emu.frameadvance()
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement