Advertisement
Guest User

power rangers

a guest
Aug 26th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.58 KB | None | 0 0
  1. local function textbox(xstart,ystart,width,height,text,id)
  2.  
  3. left  = xstart
  4. down  = ystart+height
  5. right = xstart+width
  6. up    = ystart
  7.  
  8. gui.drawbox(left,down,right,up,"")
  9. gui.text(left+2,up+2,text)
  10.  
  11. if keys.leftclick and mousex>=left and mousex<=right and mousey>=up and mousey<=down then
  12.     command=id
  13. end
  14.  
  15. end;
  16.  
  17. startframe=movie.framecount()-1
  18. startx = 65536*memory.readbyte(0x7E0EA2) + 256*memory.readbyte(0x7E0EA1) + memory.readbyte(0x7E0EA3)
  19. topspeed=512
  20.  
  21. w=0
  22. move=0
  23.  
  24. while true do
  25.  
  26. local function displayer()
  27.  
  28. --here starts the old script
  29. mf=movie.framecount()-1
  30. xpos = 65536*memory.readbyte(0x7E0EA2) + 256*memory.readbyte(0x7E0EA1) + memory.readbyte(0x7E0EA3)
  31.  
  32. predx=startx + topspeed*(mf-startframe)
  33. lostx=predx-xpos
  34. lostf=lostx/topspeed
  35.  
  36. min=math.floor(mf/3600)
  37. sec=math.floor(math.mod(mf,3600)/60)
  38.  
  39. texty=30
  40.  
  41. gui.text(10,texty,"X pos: " .. xpos)
  42. gui.text(10,texty+8,"Lost X: " .. lostx)
  43. gui.text(10,texty+16,"Lost F: " .. lostf)
  44. gui.text(10,texty+24,"Time: " .. min .. ":" .. sec)
  45. end
  46.  
  47. gui.register(displayer)
  48.  
  49. command=0
  50. keys=input.get()
  51. key1={}
  52.  
  53. mousex=keys.xmouse
  54. mousey=keys.ymouse
  55.  
  56. gui.text(156,12,"4 sword hit")
  57. textbox(106,20,30,12,"Left1",4)
  58. textbox(136,20,30,12,"Left",3)
  59. textbox(166,20,30,12,"Still",1)
  60. textbox(196,20,30,12,"Right",2)
  61. textbox(226,20,30,12,"Right1",5)
  62.  
  63. --gui.text(156,32,"Normal form")
  64. --textbox(106,40,30,12,"Left 6hit",6)
  65. --textbox(136,40,30,12,"Right 6hit",7)
  66. --textbox(136,40,30,12,"Left 4kick",8)
  67.  
  68. if command>0 then move=command end
  69.  
  70. if command>=1 and command<=5 then
  71.     w=43
  72. end
  73.  
  74. if command>=6 and command<=7 then
  75.     w=71
  76. end
  77.  
  78. if move>=1 and move<=5 and w>0 then
  79.     if w==43 then
  80.         key1.Y=1
  81.         if move==2 then key1.right=1 end
  82.         if move==3 then key1.left=1 end
  83.         if move==4 then key1.left=1 end
  84.         if move==5 then key1.right=1 end
  85.     end
  86.  
  87.     if w==29 then
  88.         key1.Y=1
  89.         if move==2 then key1.right=1 end
  90.         if move==3 then key1.left=1 end
  91.     end
  92.  
  93.     if w==15 then
  94.         key1.Y=1
  95.         if move==2 then key1.right=1 end
  96.         if move==3 then key1.left=1 end
  97.     end
  98.  
  99.     if w==1 then
  100.         key1.Y=1
  101.         if move==2 then key1.right=1 end
  102.         if move==3 then key1.left=1 end
  103.     end
  104.  
  105.     joypad.set(1,key1)
  106. end
  107.    
  108. if move>=6 and move<=7 and w>0 then
  109.     if w==71 then
  110.         key1.Y=1
  111.     end
  112.  
  113.     if w==60 then
  114.         key1.Y=1
  115.     end
  116.  
  117.     if w==49 then
  118.         key1.Y=1
  119.     end
  120.  
  121.     if w==31 then
  122.         if move==6 then key1.left=1 end
  123.         if move==7 then key1.right=1 end
  124.     end
  125.  
  126.     if w==30 then
  127.         key1.Y=1
  128.     end
  129.  
  130.     if w==19 then
  131.         key1.Y=1
  132.     end
  133.  
  134.     if w==1 then
  135.         key1.Y=1
  136.     end
  137.  
  138.     joypad.set(1,key1)
  139. end
  140.  
  141. if w>0 then w=w-1 end
  142.  
  143.    snes9x.frameadvance()
  144. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement