Maespark

AugmentAttacks-OpenEUO

Jul 8th, 2021 (edited)
662
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.56 KB | None | 0 0
  1. --[[
  2. Note: This script is to be used in conjunction with a UOSteam script which reads error messages created by this OpenEUO script. The methods for using UO.Click are commented out, but I left them there in case you would like to fiddle with using them, but I don't recommend it. They interrupt a lot of normal playing actions.
  3. ]]--
  4.  
  5. --Set maxFollowers to your own maximum, this prevents Vortex Strike from using itself when you already have capped followers.
  6. local maxFollowers = 10
  7.  
  8.  
  9. local atk = ''
  10. --This function just exists for finding the gumps to activate augment abilities.
  11. --   You pass it the width, height, and which attack you're using. You then line up a UO.GetPix
  12. --   to verify that you're reading the correct gump, assuming you have more than 1 augment skill gump.
  13. BuffsScanConts = function(ContSX,ContSY,atk)
  14.     local X,Y,SX,SY,_
  15.     for i=0,999 do
  16.         _,X,Y,SX,SY,_,_,_,_ = UO.GetCont(i)
  17.         if X == nil then
  18.               break
  19.         end
  20.         if SX == ContSX and SY == ContSY then
  21.               if X ~= 0 then
  22.                  --print("Gump found moving to top")
  23.                  local pix = 0
  24.                  if atk == 'vs' then
  25.                     --This UO.GetPix must target a unique pixel on the gump you wish to target.
  26.                     pix = UO.GetPix(X+30,Y+85)
  27.                     --print(pix)
  28.                     --This if statement then checks to make sure that that pixel has the exact coloring that you checked for.
  29.                     if pix == 524362 or pix == 1581353 then
  30.                            UO.ContTop(i)
  31.                            if UO.ContPosX ~= 0 and UO.ContPosY ~= 0 then
  32.                             --UO.ContPosX = 0
  33.                             --UO.ContPosY = 0                
  34.                                end
  35.                             end
  36.                             --This UO.GetPix must target a unique pixel on the gump you wish to target.
  37.                             pix = UO.GetPix(X+30,Y+147)
  38.                             --This if statement then checks to make sure that that pixel has the exact coloring that you checked for.
  39.                             if pix == 10272206 or pix == 2687174 then
  40.                                UO.ContTop(i)
  41.                             end
  42.                          end
  43.                          if atk == 'sp' then
  44.                          --This UO.GetPix must target a unique pixel on the gump you wish to target.
  45.                             pix = UO.GetPix(X+30,Y+85)
  46.                     --This if statement then checks to make sure that that pixel has the exact coloring that you checked for.
  47.                     if pix == 10278639 or pix == 3211486 then
  48.                            UO.ContTop(i)
  49.                            if UO.ContPosX ~= 0 and UO.ContPosY ~= 0 then
  50.                             --UO.ContPosX = 0
  51.                             --UO.ContPosY = 0                
  52.                                end
  53.                             end
  54.                          end
  55.                       end  
  56.                       break
  57.         end
  58.     end
  59.     if X == nil then
  60.         return nil
  61.     end
  62.     return X,Y
  63. end
  64.  
  65. --This function governs the actions taken if you are trying to trigger ShieldSpikes.
  66. function ShieldSpikes()
  67.    --Sets to 'sp' so that BuffScanConts knows which gump to look for.
  68.    atk = 'sp'
  69.    local conX, conY = nil
  70.    conX, conY = BuffsScanConts(70,122,atk)
  71.    if conX ~= nil and conY ~= nil then
  72.       local shieldSpike = UO.GetPix(conX+30,conY+85)
  73.       --print(shieldSpike) --Uncomment this to print out the result of of your UO.GetPix
  74.       if shieldSpike == 10278639 then
  75.          if string.match(UO.CharStatus,'G') then --Triggers only if in War Mode
  76.             UO.Macro(49,3) --This invokes the virtue of Valor, yielding a unique error message in game.
  77.          end
  78.          --UO.Click(conX+30,conY+85,true,true,true,false) --Uncomment this if you want to use UO.Click. I do not recommend.
  79.          wait(500)
  80.       elseif shieldSpike ~= 3211486 and shieldSpike ~= 10278639 then
  81.          --print('Re-equip your shield!')
  82.       end
  83.    end
  84. end
  85.  
  86. --This function governs the actions taken if you are trying to trigger Vortex Strike
  87. function VortexStrike()
  88.    --Sets to 'vs' so that the BuffScansConts knows which gump to look for.
  89.    atk = 'vs'
  90.    followers = UO.Followers
  91.          
  92.    if followers < maxFollowers then
  93.       local conX, conY = nil
  94.       conX, conY = BuffsScanConts(70,169,atk) --Look for a Vortex Strike gump that has an additional ability on it.
  95.       if conX == nil then
  96.          conX, conY = BuffsScanConts(70,122,atk) --Look for a Vortex Strike gump that only has Vortex Strike.
  97.       end
  98.       if conX ~= nil and conY ~= nil then
  99.          local vortexStrike = UO.GetPix(conX+30,conY+85)
  100.          --print(vortexStrike)
  101.          if vortexStrike == 1581353 then
  102.             if string.match(UO.CharStatus,'G') then --If in War Mode.
  103.                UO.Macro(49,6) --Invokes a virtue that doesn't exist, yielding a unique error message in game.
  104.             end
  105.             --UO.Click(conX+30,conY+85,true,true,true,false) --Uncomment to use UO.Click. I do not recommend.
  106.             wait(500)
  107.          elseif vortexStrike ~= 524362 and vortexStrike ~= 1581353 then
  108.             vortexStrike = UO.GetPix(conX+30,conY+147)
  109.             --print(vortexStrike)
  110.             if vortexStrike == 10272206 then   --2687174 active color
  111.                if string.match(UO.CharStatus,'G') then --If in War Mode.
  112.                   UO.Macro(49,6) --Invokes a virtue that doesn't exist, yielding a unique error message in game.
  113.                end
  114.                --UO.Click(conX+30,conY+147,true,true,true,false) --Uncomment to use UO.Click. I do not recommend.
  115.                wait(500)
  116.             end
  117.          end
  118.       end
  119.    end
  120. end
Add Comment
Please, Sign In to add comment