Advertisement
imbuedl

deku princess goron pound clip setup code

Dec 25th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 21.62 KB | None | 0 0
  1. itools = dofile('lib_input_tools.lua')
  2. core = dofile('lib_core.lua')
  3.  
  4.  
  5.  
  6.  
  7. -- Define functions to perform each movement option (except for 'Nothing')
  8.  
  9. -- Movement_Options = ['Turn Right', 'Turn Left', 'Turn Down', 'Turn Up', 'Untargeted Horizontal Slash',
  10. -- 'Untargeted Horizontal Slash, Shield', 'Targeted Vertical Slash', 'Targeted Vertical Slash, Untarget ASAP',
  11. -- 'Untargeted Right Slash', 'Untargeted Right Slash, Shield', 'Targeted Forward Thrust',
  12. -- 'Targeted Forward Thrust, Untarget ASAP', 'Nothing']
  13.  
  14. function Turn_Right()
  15.    
  16.     -- Press Z to target for 1 visual frame, then do nothing for 5 visual frames, then hold Right for 1 visual frame
  17.     -- clear inputs at the start of each function for safety
  18.     -- advance visual frame at the start for safety
  19.    
  20.     itools.clear_inputs()
  21.    
  22.     itools.vframe_advance()
  23.    
  24.     itools.vframe_advance({['Z']=true})
  25.    
  26.     itools.vframe_advance()
  27.     itools.vframe_advance()
  28.     itools.vframe_advance()
  29.     itools.vframe_advance()
  30.     itools.vframe_advance()
  31.    
  32.     itools.vframe_advance({['X Axis']=127,['Y Axis']=0})
  33.    
  34.     itools.clear_inputs()
  35.    
  36.     itools.vframe_advance()
  37.    
  38. end
  39.  
  40. function Turn_Left()
  41.    
  42.     itools.clear_inputs()
  43.    
  44.     itools.vframe_advance()
  45.    
  46.     itools.vframe_advance({['Z']=true})
  47.    
  48.     itools.vframe_advance()
  49.     itools.vframe_advance()
  50.     itools.vframe_advance()
  51.     itools.vframe_advance()
  52.     itools.vframe_advance()
  53.    
  54.     itools.vframe_advance({['X Axis']=-128,['Y Axis']=0})
  55.    
  56.     itools.clear_inputs()
  57.    
  58.     itools.vframe_advance()
  59.    
  60. end
  61.  
  62. function Turn_Down()
  63.    
  64.     itools.clear_inputs()
  65.    
  66.     itools.vframe_advance()
  67.    
  68.     itools.vframe_advance({['Z']=true})
  69.    
  70.     itools.vframe_advance()
  71.     itools.vframe_advance()
  72.     itools.vframe_advance()
  73.     itools.vframe_advance()
  74.     itools.vframe_advance()
  75.    
  76.     itools.vframe_advance({['X Axis']=0,['Y Axis']=-128})
  77.    
  78.     itools.clear_inputs()
  79.    
  80.     itools.vframe_advance()
  81.    
  82. end
  83.  
  84. function Turn_Up()
  85.    
  86.     itools.clear_inputs()
  87.    
  88.     itools.vframe_advance()
  89.    
  90.     itools.vframe_advance({['Z']=true})
  91.    
  92.     itools.clear_inputs()
  93.    
  94.     itools.vframe_advance()
  95.     itools.vframe_advance()
  96.     itools.vframe_advance()
  97.     itools.vframe_advance()
  98.     itools.vframe_advance()
  99.    
  100.     itools.vframe_advance({['X Axis']=0,['Y Axis']=127})
  101.    
  102.     itools.clear_inputs()
  103.    
  104.     itools.vframe_advance()
  105.    
  106. end
  107.  
  108. function Untargeted_Horizontal_Slash()
  109.    
  110.     itools.clear_inputs()
  111.    
  112.     itools.vframe_advance()
  113.    
  114.     itools.vframe_advance()
  115.    
  116.     itools.vframe_advance({['B']=true})
  117.    
  118.     itools.clear_inputs()
  119.    
  120.     itools.vframe_advance()
  121.     itools.vframe_advance()
  122.     itools.vframe_advance()
  123.     itools.vframe_advance()
  124.     itools.vframe_advance()
  125.     itools.vframe_advance()
  126.     itools.vframe_advance()
  127.     itools.vframe_advance()
  128.     itools.vframe_advance()
  129.     itools.vframe_advance()
  130.     itools.vframe_advance()
  131.     itools.vframe_advance()
  132.     itools.vframe_advance()
  133.     itools.vframe_advance()
  134.     itools.vframe_advance()
  135.    
  136. end
  137.  
  138. function Untargeted_Horizontal_Slash_Shield()
  139.    
  140.     itools.clear_inputs()
  141.    
  142.     itools.vframe_advance()
  143.    
  144.     itools.vframe_advance({['B']=true})
  145.    
  146.     itools.clear_inputs()
  147.    
  148.     itools.vframe_advance({['R']=true})
  149.    
  150.     itools.vframe_advance({['R']=true})
  151.     itools.vframe_advance({['R']=true})
  152.     itools.vframe_advance({['R']=true})
  153.     itools.vframe_advance({['R']=true})
  154.     itools.vframe_advance({['R']=true})
  155.     itools.vframe_advance({['R']=true})
  156.     itools.vframe_advance({['R']=true})
  157.     itools.vframe_advance({['R']=true})
  158.     itools.vframe_advance({['R']=true})
  159.    
  160.     itools.clear_inputs()
  161.    
  162.     itools.vframe_advance()
  163.     itools.vframe_advance()
  164.     itools.vframe_advance()
  165.     itools.vframe_advance()
  166.     itools.vframe_advance()
  167.     itools.vframe_advance()
  168.     itools.vframe_advance()
  169.    
  170.    
  171.     itools.vframe_advance()
  172. end
  173.  
  174. function Targeted_Vertical_Slash()
  175.    
  176.     itools.clear_inputs()
  177.    
  178.     itools.vframe_advance()
  179.    
  180.     itools.vframe_advance({['B']=true, ['Z']=true})
  181.    
  182.     itools.vframe_advance({['Z']=true})
  183.     itools.vframe_advance({['Z']=true})
  184.     itools.vframe_advance({['Z']=true})
  185.     itools.vframe_advance({['Z']=true})
  186.     itools.vframe_advance({['Z']=true})
  187.     itools.vframe_advance({['Z']=true})
  188.     itools.vframe_advance({['Z']=true})
  189.     itools.vframe_advance({['Z']=true})
  190.    
  191.     itools.clear_inputs()
  192.    
  193.     itools.vframe_advance()
  194.     itools.vframe_advance()
  195.     itools.vframe_advance()
  196.     itools.vframe_advance()
  197.     itools.vframe_advance()
  198.     itools.vframe_advance()
  199.     itools.vframe_advance()
  200.    
  201.     itools.clear_inputs()
  202.    
  203.     itools.vframe_advance()
  204. end
  205.  
  206. function Targeted_Vertical_Slash_Untarget_ASAP()
  207.    
  208.     itools.clear_inputs()
  209.    
  210.     itools.vframe_advance()
  211.    
  212.     itools.vframe_advance({['B']=true, ['Z']=true})
  213.    
  214.     itools.clear_inputs()
  215.    
  216.     itools.vframe_advance()
  217.     itools.vframe_advance()
  218.     itools.vframe_advance()
  219.     itools.vframe_advance()
  220.     itools.vframe_advance()
  221.     itools.vframe_advance()
  222.     itools.vframe_advance()
  223.     itools.vframe_advance()
  224.     itools.vframe_advance()
  225.     itools.vframe_advance()
  226.     itools.vframe_advance()
  227.     itools.vframe_advance()
  228.     itools.vframe_advance()
  229.    
  230.     itools.vframe_advance()
  231. end
  232.  
  233. function Untargeted_Right_Slash()
  234.    
  235.     itools.clear_inputs()
  236.    
  237.     itools.vframe_advance()
  238.    
  239.     itools.vframe_advance({['Z']=true})
  240.    
  241.     itools.clear_inputs()
  242.    
  243.     itools.vframe_advance()
  244.     itools.vframe_advance()
  245.     itools.vframe_advance()
  246.     itools.vframe_advance()
  247.     itools.vframe_advance()
  248.    
  249.     itools.vframe_advance({['X Axis']=127,['Y Axis']=0,['B']=true})
  250.    
  251.     itools.clear_inputs()
  252.    
  253.     itools.vframe_advance()
  254.     itools.vframe_advance()
  255.     itools.vframe_advance()
  256.     itools.vframe_advance()
  257.     itools.vframe_advance()
  258.     itools.vframe_advance()
  259.     itools.vframe_advance()
  260.     itools.vframe_advance()
  261.     itools.vframe_advance()
  262.     itools.vframe_advance()
  263.     itools.vframe_advance()
  264.     itools.vframe_advance()
  265.     itools.vframe_advance()
  266.     itools.vframe_advance()
  267.     itools.vframe_advance()
  268.     itools.vframe_advance()
  269.    
  270.     itools.vframe_advance()
  271. end
  272.  
  273. function Untargeted_Right_Slash_Shield()
  274.    
  275.     itools.clear_inputs()
  276.    
  277.     itools.vframe_advance()
  278.    
  279.     itools.vframe_advance({['Z']=true})
  280.    
  281.     itools.clear_inputs()
  282.    
  283.     itools.vframe_advance()
  284.     itools.vframe_advance()
  285.     itools.vframe_advance()
  286.     itools.vframe_advance()
  287.     itools.vframe_advance()
  288.    
  289.     itools.vframe_advance({['X Axis']=127,['Y Axis']=0,['B']=true})
  290.    
  291.     itools.clear_inputs()
  292.    
  293.     itools.vframe_advance({['R']=true})
  294.     itools.vframe_advance({['R']=true})
  295.     itools.vframe_advance({['R']=true})
  296.     itools.vframe_advance({['R']=true})
  297.     itools.vframe_advance({['R']=true})
  298.     itools.vframe_advance({['R']=true})
  299.     itools.vframe_advance({['R']=true})
  300.     itools.vframe_advance({['R']=true})
  301.     itools.vframe_advance({['R']=true})
  302.    
  303.     itools.clear_inputs()
  304.    
  305.     itools.vframe_advance()
  306.     itools.vframe_advance()
  307.     itools.vframe_advance()
  308.     itools.vframe_advance()
  309.     itools.vframe_advance()
  310.     itools.vframe_advance()
  311.     itools.vframe_advance()
  312.    
  313.     itools.vframe_advance()
  314. end
  315.  
  316. function Targeted_Forward_Thrust()
  317.    
  318.     itools.clear_inputs()
  319.    
  320.     itools.vframe_advance()
  321.    
  322.     itools.vframe_advance()
  323.    
  324.     itools.vframe_advance({['Z']=true})
  325.    
  326.     itools.clear_inputs()
  327.    
  328.     itools.vframe_advance()
  329.     itools.vframe_advance()
  330.     itools.vframe_advance()
  331.     itools.vframe_advance()
  332.     itools.vframe_advance()
  333.    
  334.     itools.vframe_advance({['X Axis']=0,['Y Axis']=127,['B']=true,['Z']=true})
  335.    
  336.     itools.clear_inputs()
  337.    
  338.     itools.vframe_advance({['Z']=true})
  339.     itools.vframe_advance({['Z']=true})
  340.     itools.vframe_advance({['Z']=true})
  341.     itools.vframe_advance({['Z']=true})
  342.     itools.vframe_advance({['Z']=true})
  343.     itools.vframe_advance({['Z']=true})
  344.     itools.vframe_advance({['Z']=true})
  345.     itools.vframe_advance({['Z']=true})
  346.    
  347.     itools.clear_inputs()
  348.    
  349.     itools.vframe_advance()
  350.     itools.vframe_advance()
  351.     itools.vframe_advance()
  352.     itools.vframe_advance()
  353.    
  354.     itools.vframe_advance()
  355. end
  356.  
  357. function Targeted_Forward_Thrust_Untarget_ASAP()
  358.    
  359.     itools.clear_inputs()
  360.    
  361.     itools.vframe_advance()
  362.    
  363.     itools.vframe_advance({['Z']=true})
  364.    
  365.     itools.clear_inputs()
  366.    
  367.     itools.vframe_advance()
  368.     itools.vframe_advance()
  369.     itools.vframe_advance()
  370.     itools.vframe_advance()
  371.     itools.vframe_advance()
  372.    
  373.     itools.vframe_advance({['X Axis']=0,['Y Axis']=127,['B']=true,['Z']=true})
  374.    
  375.     itools.clear_inputs()
  376.    
  377.     itools.vframe_advance()
  378.     itools.vframe_advance()
  379.     itools.vframe_advance()
  380.     itools.vframe_advance()
  381.     itools.vframe_advance()
  382.     itools.vframe_advance()
  383.     itools.vframe_advance()
  384.     itools.vframe_advance()
  385.     itools.vframe_advance()
  386.     itools.vframe_advance()
  387.     itools.vframe_advance()
  388.    
  389.     itools.vframe_advance()
  390. end
  391.  
  392. function Perform_Goron_Pound_Clip()
  393.    
  394.     itools.clear_inputs()
  395.    
  396.     itools.vframe_advance()
  397.     itools.vframe_advance()
  398.     itools.vframe_advance()
  399.     itools.vframe_advance()
  400.     itools.vframe_advance()
  401.    
  402.     itools.vframe_advance({['Z']=true})
  403.    
  404.     itools.clear_inputs()
  405.    
  406.     itools.vframe_advance()
  407.     itools.vframe_advance()
  408.     itools.vframe_advance()
  409.     itools.vframe_advance()
  410.     itools.vframe_advance()
  411.    
  412.     itools.vframe_advance({['X Axis']=0,['Y Axis']=-128,['C Down']=true})
  413.    
  414.     itools.clear_inputs()
  415.    
  416.     itools.vframe_advance()
  417.    
  418.     -- This input sets down the bomb
  419.     itools.vframe_advance({['A']=true})
  420.    
  421.     itools.clear_inputs()
  422.    
  423.     itools.vframe_advance()
  424.     itools.vframe_advance()
  425.     itools.vframe_advance()
  426.     itools.vframe_advance()
  427.     itools.vframe_advance()
  428.     itools.vframe_advance()
  429.     itools.vframe_advance()
  430.     itools.vframe_advance()
  431.     itools.vframe_advance()
  432.     itools.vframe_advance()
  433.     itools.vframe_advance()
  434.    
  435.     itools.vframe_advance({['C Right']=true})
  436.    
  437.     itools.clear_inputs()
  438.    
  439.     itools.vframe_advance()
  440.     itools.vframe_advance()
  441.     itools.vframe_advance()
  442.     itools.vframe_advance()
  443.    
  444.     -- Skip mask transition cutscene
  445.     itools.vframe_advance({['A']=true})
  446.    
  447.     itools.clear_inputs()
  448.    
  449.     itools.vframe_advance()
  450.     itools.vframe_advance()
  451.     itools.vframe_advance()
  452.     itools.vframe_advance()
  453.     itools.vframe_advance()
  454.     itools.vframe_advance()
  455.     itools.vframe_advance()
  456.     itools.vframe_advance()
  457.     itools.vframe_advance()
  458.     itools.vframe_advance()
  459.     itools.vframe_advance()
  460.     itools.vframe_advance()
  461.     itools.vframe_advance()
  462.     itools.vframe_advance()
  463.     itools.vframe_advance()
  464.     itools.vframe_advance()
  465.     itools.vframe_advance()
  466.     itools.vframe_advance()
  467.     itools.vframe_advance()
  468.     itools.vframe_advance()
  469.     itools.vframe_advance()
  470.    
  471.     -- control stick direction for mask transition
  472.     itools.vframe_advance({['X Axis']=0,['Y Axis']=127})
  473.    
  474.     itools.clear_inputs()
  475.    
  476.     -- turn up before curling
  477.     itools.vframe_advance({['X Axis']=0,['Y Axis']=127})
  478.    
  479.     itools.clear_inputs()
  480.    
  481.     -- find out how many frames to wait before curling + pounding so bomb timing is correct --- 27
  482.    
  483.     itools.vframe_advance()
  484.     itools.vframe_advance()
  485.     itools.vframe_advance()
  486.     itools.vframe_advance()
  487.     itools.vframe_advance()
  488.     itools.vframe_advance()
  489.     itools.vframe_advance()
  490.     itools.vframe_advance()
  491.     itools.vframe_advance()
  492.     itools.vframe_advance()
  493.     itools.vframe_advance()
  494.     itools.vframe_advance()
  495.     itools.vframe_advance()
  496.     itools.vframe_advance()
  497.     itools.vframe_advance()
  498.     itools.vframe_advance()
  499.     itools.vframe_advance()
  500.     itools.vframe_advance()
  501.     itools.vframe_advance()
  502.     itools.vframe_advance()
  503.     itools.vframe_advance()
  504.     itools.vframe_advance()
  505.     itools.vframe_advance()
  506.     itools.vframe_advance()
  507.     itools.vframe_advance()
  508.     itools.vframe_advance()
  509.     itools.vframe_advance()
  510.    
  511.     -- curl
  512.     itools.vframe_advance({['A']=true})
  513.    
  514.     itools.vframe_advance({['A']=true})
  515.     itools.vframe_advance({['A']=true})
  516.     itools.vframe_advance({['A']=true})
  517.     itools.vframe_advance({['A']=true})
  518.     itools.vframe_advance({['A']=true})
  519.     itools.vframe_advance({['A']=true})
  520.     itools.vframe_advance({['A']=true})
  521.    
  522.     -- pound
  523.     itools.vframe_advance({['A']=true,['B']=true})
  524.    
  525.     itools.clear_inputs()
  526.    
  527.     itools.vframe_advance({['A']=true})
  528.     itools.vframe_advance({['A']=true})
  529.     itools.vframe_advance({['A']=true})
  530.     itools.vframe_advance({['A']=true})
  531.     itools.vframe_advance({['A']=true})
  532.     itools.vframe_advance({['A']=true})
  533.     itools.vframe_advance({['A']=true})
  534.     itools.vframe_advance({['A']=true})
  535.     itools.vframe_advance({['A']=true})
  536.     itools.vframe_advance({['A']=true})
  537.     itools.vframe_advance({['A']=true})
  538.     itools.vframe_advance({['A']=true})
  539.     itools.vframe_advance({['A']=true})
  540.     itools.vframe_advance({['A']=true})
  541.     itools.vframe_advance({['A']=true})
  542.     itools.vframe_advance({['A']=true})
  543.     itools.vframe_advance({['A']=true})
  544.    
  545.     -- release A after 17 frames (have -11 y velocity at this point)
  546.     itools.clear_inputs()
  547.    
  548.     -- 4 frames of -20 y velocity followed by a frame of 15 linear velocity
  549.     itools.vframe_advance()
  550.     itools.vframe_advance()
  551.     itools.vframe_advance()
  552.     itools.vframe_advance()
  553.     itools.vframe_advance()
  554.    
  555.     -- wait 6 visual frames for position to become constant
  556.    
  557.     itools.vframe_advance()
  558.     itools.vframe_advance()
  559.     itools.vframe_advance()
  560.     itools.vframe_advance()
  561.     itools.vframe_advance()
  562.     itools.vframe_advance()
  563.    
  564.     -- waiting even more just in case
  565.    
  566.     itools.vframe_advance()
  567.     itools.vframe_advance()
  568.     itools.vframe_advance()
  569.     itools.vframe_advance()
  570.     itools.vframe_advance()
  571.    
  572.     itools.vframe_advance()
  573. end
  574.  
  575.  
  576. file = io.open('deku princess goron pound clip permutations 4 options.txt')
  577. contents = file:read('*a')
  578. file:close()
  579.  
  580. function split(input)
  581.     local t={} ; i=1
  582.     for str in string.gmatch(input, '([^\n]+)') do
  583.         t[i] = str
  584.         i = i + 1
  585.     end
  586.     return t
  587. end
  588.  
  589. function advance(amount)
  590.     for i = 1, amount, 1 do
  591.         itools.vframe_advance()
  592.     end
  593. end
  594.  
  595. perms = split(contents)
  596. file_write = io.open('deku princess goron pound clip data.txt', 'w+')
  597.  
  598. Clip_Exists = false
  599. Line_Count = 1
  600.  
  601. ikeeta = 1
  602. while ikeeta <= table.getn(perms) do
  603.    
  604.     line = perms[ikeeta]
  605.    
  606.     --if input.get().C then
  607.     --    break
  608.     --end
  609.  
  610.     -- STUFF HERE
  611.     print('Line: ' .. Line_Count .. '    Clip Exists ' .. tostring(Clip_Exists))
  612.    
  613.     Redunant_Position = false
  614.     Valid_Position = false
  615.     Angle_In_Range = false
  616.     Clip_Successful = false
  617.    
  618.     itools.clear_inputs()
  619.  
  620.     -- load save state (4)
  621.     itools.load_state(4)
  622.    
  623.     Positions = {}
  624.    
  625.     X_Position = core.read_float_be(0x3FFDD4,'RDRAM')
  626.     Z_Position = core.read_float_be(0x3FFDDC,'RDRAM')
  627.     Y_Position = core.read_float_be(0x3FFDD8,'RDRAM')
  628.    
  629.     Positions['X' .. tostring(X_Position) .. 'Z' .. tostring(Z_Position) .. 'Y' .. tostring( Y_Position)] = true
  630.  
  631.     previous_index = 1
  632.     for i = 1, string.len(line), 1 do
  633.         if string.sub(line, i, i) == '&' then
  634.            
  635.             if string.sub(line, previous_index, i-1) == 'Turn Right' then
  636.                
  637.                 Turn_Right()
  638.                
  639.             elseif string.sub(line, previous_index, i-1) == 'Turn Left' then
  640.            
  641.                 Turn_Left()
  642.            
  643.             elseif string.sub(line, previous_index, i-1) == 'Turn Down' then
  644.                
  645.                 Turn_Down()
  646.                
  647.             elseif string.sub(line, previous_index, i-1) == 'Turn Up' then
  648.                
  649.                 Turn_Up()
  650.                
  651.             elseif string.sub(line, previous_index, i-1) == 'Untargeted Horizontal Slash' then
  652.                
  653.                 Untargeted_Horizontal_Slash()
  654.                
  655.                 if Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] == true then
  656.                     Redunant_Position = true
  657.                 else
  658.                     Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] = true
  659.                 end
  660.                
  661.             elseif string.sub(line, previous_index, i-1) == 'Untargeted Horizontal Slash, Shield' then
  662.                
  663.                 Untargeted_Horizontal_Slash_Shield()
  664.                
  665.                 if Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] == true then
  666.                     Redunant_Position = true
  667.                 else
  668.                     Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] = true
  669.                 end
  670.                
  671.             elseif string.sub(line, previous_index, i-1) == 'Targeted Vertical Slash' then
  672.                
  673.                 Targeted_Vertical_Slash()
  674.                
  675.                 if Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] == true then
  676.                     Redunant_Position = true
  677.                 else
  678.                     Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] = true
  679.                 end
  680.                
  681.             elseif string.sub(line, previous_index, i-1) == 'Targeted Vertical Slash, Untarget ASAP' then
  682.                
  683.                 Targeted_Vertical_Slash_Untarget_ASAP()
  684.                
  685.                 if Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] == true then
  686.                     Redunant_Position = true
  687.                 else
  688.                     Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] = true
  689.                 end
  690.                
  691.             elseif string.sub(line, previous_index, i-1) == 'Untargeted Right Slash' then
  692.                
  693.                 Untargeted_Right_Slash()
  694.                
  695.                 if Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] == true then
  696.                     Redunant_Position = true
  697.                 else
  698.                     Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] = true
  699.                 end
  700.                
  701.             elseif string.sub(line, previous_index, i-1) == 'Untargeted Right Slash, Shield' then
  702.                
  703.                 Untargeted_Right_Slash_Shield()
  704.                
  705.                 if Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] == true then
  706.                     Redunant_Position = true
  707.                 else
  708.                     Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] = true
  709.                 end
  710.                
  711.             elseif string.sub(line, previous_index, i-1) == 'Targeted Forward Thrust' then
  712.            
  713.                 Targeted_Forward_Thrust()
  714.                
  715.                 if Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] == true then
  716.                     Redunant_Position = true
  717.                 else
  718.                     Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] = true
  719.                 end
  720.            
  721.             elseif string.sub(line, previous_index, i-1) == 'Targeted Forward Thrust, Untarget ASAP' then
  722.                
  723.                 Targeted_Forward_Thrust_Untarget_ASAP()
  724.                
  725.                 if Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] == true then
  726.                     Redunant_Position = true
  727.                 else
  728.                     Positions['X' .. tostring(core.read_float_be(0x3FFDD4,'RDRAM')) .. 'Z' .. tostring(core.read_float_be(0x3FFDDC,'RDRAM')) .. 'Y' .. tostring(core.read_float_be(0x3FFDD8,'RDRAM'))] = true
  729.                 end
  730.                
  731.             end
  732.            
  733.             previous_index = i + 1
  734.         end
  735.     end
  736.    
  737.     -- Update Positions
  738.     X_Position = core.read_float_be(0x3FFDD4,'RDRAM')
  739.     Z_Position = core.read_float_be(0x3FFDDC,'RDRAM')
  740.     Y_Position = core.read_float_be(0x3FFDD8,'RDRAM')
  741.  
  742.     -- Check if link has a valid position before attempting the goron pound clip
  743.    
  744.     if X_Position >= -1877 and Z_Position <= 105.8205 and Z_Position <= -.96828*X_Position - 1692.75739432 then
  745.        
  746.         Valid_Position = true
  747.        
  748.         -- Before doing goron pound clip, make sure link is targeted facing the wall (doesn't have to stay targeted)
  749.         -- because Perform_Goron_Pound_Clip() assumes link is facing the wall with camera angle roughly aligned with
  750.         -- link's angle
  751.        
  752.         Angle = memory.read_s16_be(0x3FFE6E,'RDRAM')
  753.        
  754.         if Angle <= 25215 and Angle >= 23215 then
  755.            
  756.             Turn_Left()
  757.             Angle_In_Range = true
  758.        
  759.         elseif Angle <= -7553 and Angle >= -9553 then
  760.            
  761.             Turn_Right()
  762.             Angle_In_Range = true
  763.            
  764.         elseif Angle <= 8831 and Angle >= 6831 then
  765.            
  766.             Turn_Down()
  767.             Angle_In_Range = true
  768.        
  769.         elseif Angle <= -23937 and Angle >= -25937 then
  770.            
  771.             Angle_In_Range = true
  772.            
  773.         end
  774.        
  775.         -- wait 5 visual frames or so in this function
  776.         Perform_Goron_Pound_Clip()
  777.        
  778.         -- Update Positions
  779.         X_Position = core.read_float_be(0x3FFDD4,'RDRAM')
  780.         Z_Position = core.read_float_be(0x3FFDDC,'RDRAM')
  781.         Y_Position = core.read_float_be(0x3FFDD8,'RDRAM')
  782.        
  783.         -- Check if the goron pound clip was successful or not
  784.        
  785.         if Z_Position < -.96828*X_Position - 1750 then
  786.            
  787.             Clip_Successful = true
  788.            
  789.             print('SUCCESS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
  790.             Clip_Exists = true
  791.        
  792.         end
  793.    
  794.    
  795.     end
  796.  
  797.     file_write:write('Permutation = ' .. line .. '\n')
  798.    
  799.     if Redundant_Position == true then
  800.        
  801.         file_write:write('Redundant Position?: Yes\n')
  802.        
  803.     elseif Redundant_Position == false then
  804.        
  805.         file_write:write('Redundant Position?: No\n')
  806.        
  807.     end
  808.    
  809.     if Valid_Position == true then
  810.    
  811.         file_write:write('Valid Position?: Yes\n')
  812.    
  813.     elseif Valid_Position == false then
  814.        
  815.         file_write:write('Valid Position?: No\n')
  816.        
  817.     end
  818.    
  819.     if Angle_In_Range == true then
  820.        
  821.         file_write:write('Angle in Range?: Yes\n')
  822.    
  823.     elseif Angle_In_Range == false then
  824.        
  825.         file_write:write('Angle in Range?: No\n')
  826.        
  827.     end
  828.    
  829.     if Clip_Successful == true then
  830.        
  831.         file_write:write('Clip Successful?: Yes\n')
  832.    
  833.     elseif Clip_Successful == false then
  834.        
  835.         file_write:write('Clip Successful?: No\n')
  836.    
  837.     end
  838.    
  839.     file_write:write('---\n')
  840.    
  841.     Line_Count = Line_Count + 1
  842.     -- END
  843.  
  844.     ikeeta = ikeeta + 1
  845. end
  846.  
  847. file_write:close()
  848. print('done')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement