Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Sep 5th, 2010 | Syntax: Lua | Size: 4.33 KB | Hits: 26 | Expires: Never
Copy text to clipboard
  1. -- Does the next prompt need gagging? If so, make it so!
  2.  
  3. if gagPrompt == 1 then
  4.         gagPrompt = 0
  5.         deleteLine()
  6. end
  7.  
  8.  
  9.  
  10. -- Do we have our prompt timer variable set? We do? Then show the time!
  11.  
  12.         prTimer = os.clock()
  13.         echo(" [" .. prTimer .. "]\n")
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20. -- Do we have health/mana tracking enabled? If so, display changes
  21.  
  22. if tracking == 1 then
  23.     healthDifference = tonumber(matches[2]) - currentHealth
  24.     manaDifference = tonumber(matches[3]) - currentMana
  25.  
  26.     moveCursorEnd("main")
  27.    
  28.     if (healthDifference<0 and manaDifference<0) then
  29.         insertText(string.format(" (%d Health, %d Mana)", healthDifference, manaDifference))
  30.     elseif healthDifference>0 and manaDifference<0 then
  31.         insertText(string.format("(+%d Health, %d Mana)", healthDifference, manaDifference))
  32.     elseif healthDifference<0 and manaDifference>0 then
  33.         insertText(string.format("(%d Health, +%d Mana)", healthDifference, manaDifference))
  34.     elseif healthDifference>0 and manaDifference>0 then
  35.         insertText(string.format("(+%d Health, +%d Mana)", healthDifference, manaDifference))
  36.     elseif healthDifference>0 then
  37.         insertText(string.format("(+%d Health)", healthDifference))
  38.     elseif manaDifference>0 then
  39.         insertText(string.format("(+%d Mana)", manaDifference))
  40.     elseif healthDifference<0 then
  41.         insertText(string.format("(%d Health)", healthDifference))
  42.     elseif manaDifference<0 then
  43.         insertText(string.format("(%d Mana)", manaDifference))
  44.     end
  45. end -- End of health and mana tracking echoes
  46.  
  47.  
  48.  
  49. -- Let us populate our variables as per our current prompt
  50.  
  51. currentHealth = tonumber(matches[2])
  52. currentMana = tonumber(matches[3])
  53. currentEndurance = tonumber(matches[4])
  54. currentWillpower = tonumber(matches[5])
  55. currentBlood = tonumber(matches[6])
  56. currentExperience = tonumber(matches[7])
  57. currentStance = tostring(matches[9])
  58. promptStats = tostring(matches[10])
  59. promptEqBal = tostring(matches[11])
  60. promptLRBal = tostring(matches[12])
  61.  
  62. if string.find(promptStats, "c") then cloak = 1 else cloak = 0 end
  63. if string.find(promptStats, "s") then sileris = 1 else sileris = 0 end
  64. if string.find(promptStats, "d") then deaf = 1 else deaf = 0 end
  65. if string.find(promptStats, "b") then blind = 1 else blind = 0 end
  66. if string.find(promptStats, "a") then airborne = 1 else airborne = 0 end
  67. if string.find(promptStats, "p") then prone = 1 else prone = 0 end
  68.  
  69. if string.find(promptEqBal, "e") then equilibrium = 1 else equilibrium = 0 end
  70. if string.find(promptEqBal, "b") then balance = 1 else balance = 0 end
  71.  
  72. if string.find(promptLRBal, "l") then leftArmBalance = 1 else leftArmBalance = 0 end
  73. if string.find(promptLRBal, "r") then rightArmBalance = 1 else rightArmBalance = 0 end
  74.  
  75. if string.find(currentStance, "SCS") or string.find(currentStance, "DRS") then stanced = 1 else stanced = 0 end
  76.  
  77. if equilibrium == 1 and balance == 1 and leftArmBalance == 1 and rightArmBalance == 1 then sync = 1 else sync = 0 end
  78.  
  79.  
  80. --Debugging
  81.  
  82. -- if stanced == 1 then echo("Stanced!") end
  83.  
  84. -- Actions to be executed on balance regain
  85.  
  86. --if sync == 1 then
  87. --      if needTransmute == 1 then tmuteHealth(500)
  88. --      end
  89. --end
  90.  
  91.  
  92.  
  93. -- Auto Sipping/Mossing and Transmute Section
  94.  
  95. if paused == 0 then
  96.     if healBalance == 1 and sipFailsafe == 0 and priority == 1 then
  97.         if currentHealth < sipHealth then
  98.             send ("sip health")
  99.             healBalance = 0.5
  100.             tempTimer(1.5, [[ sipBalance = 1 ]])
  101.         elseif currentMana < sipMana then
  102.             send("sip mana")
  103.             healBalance = 0.5
  104.             tempTimer(1.5, [[ sipBalance = 1 ]])
  105.         end
  106.     elseif healBalance == 1 and sipFailsafe == 0 then
  107.         if currentMana < sipMana then
  108.             send ("sip mana")
  109.             healBalance = 0.5
  110.             tempTimer(1.5, [[ sipBalance = 1 ]])
  111.         elseif currentHealth < sipHealth then
  112.             send ("sip health")
  113.             healBalance = 0.5
  114.             tempTimer(1.5, [[ sipBalance = 1 ]])
  115.         end
  116.     end
  117.  
  118. --      if transmuteBalance == 1 then
  119. --              if currentHealth < tmuteHealth then
  120. --                      needTransmute = 1
  121. --              end
  122. --      end
  123.    
  124.  
  125.         if mossBalance == 1 and mossFailsafe == 0 and (currentHealth < mossHealth or currentMana < mossMana) then
  126.                 send ("outc moss")
  127.                 send ("eat moss")
  128.                 mossBalance = 0.5
  129.                 tempTimer(1.5, [[ mossBalance = 1 ]])
  130.         end -- End of Auto sipping/mossing and transmute cection
  131. end -- End section
  132.  
  133.  
  134.  
  135. -- Here we now deal with 'proneness'
  136.  
  137. --if prone == 1 then send("stand") end