1.12 Poison Macro--HELP NEEDED! menu

User Tag List

Results 1 to 2 of 2
  1. #1
    testcharsdf's Avatar Member
    Reputation
    1
    Join Date
    Aug 2016
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    1.12 Poison Macro--HELP NEEDED!

    I have no Lua skills whatsoever.

    MACRO 1: What I want is to combine the following macros into one SuperMacro!

    Macro 1:
    /run pAy={[16]="Instant Poison VI",[17]="Deadly Poison VI"};UA=UseAction;mE,_,_,oE=GetWeaponEnchantInfo();if mE==nil then pK=16;UA(XX);elseif oE==nil then pK=17;UA(XX);end;

    Macro 2: (slot XX)
    /run for i=0,4 do for j=1,GetContainerNumSlots(i) do cSI=GetContainerItemLink(i,j);if cSI then if(strfind(cSI,pAy[pK]))then UseContainerItem(i,j);PickupInventoryItem(pK);do return;end;end;end;end;end;

    What I ended up with is:

    /run PSN={[16]="Instant Poison",[17]="Instant Poison"}; mE,_,_,oE=GetWeaponEnchantInfo(); if mE==nil then n=16; elseif oE==nil then n=17; end; while n>=16 do for i=0,4 do for j=1,32,1 do cSI=GetContainerItemLink(i,j); if cSI and (strfind(cSI,PSN[n])) then UseContainerItem(i,j); PickupInventoryItem(n); do return end; end; end; end; end; end; end;

    but I honestly have no idea how to debug properly. The error message I get is: "<string>:"PSN={[16]="Instant Poison",[17]="Instant Poison"}; mE,_,_,oE=Ge...":1: `end' expected near `<eof>'" but since I don't know Lua I can't really tell if I put too many ends, not enough ends or whether something else is broken.

    Help me repair it or come up with a better, working solution please! thx

    1.12 Poison Macro--HELP NEEDED!
  2. #2
    Oderus's Avatar Active Member
    Reputation
    17
    Join Date
    Dec 2008
    Posts
    23
    Thanks G/R
    3/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by testcharsdf View Post
    I have no Lua skills whatsoever.

    MACRO 1: What I want is to combine the following macros into one SuperMacro!

    Macro 1:
    /run pAy={[16]="Instant Poison VI",[17]="Deadly Poison VI"};UA=UseAction;mE,_,_,oE=GetWeaponEnchantInfo();if mE==nil then pK=16;UA(XX);elseif oE==nil then pK=17;UA(XX);end;

    Macro 2: (slot XX)
    /run for i=0,4 do for j=1,GetContainerNumSlots(i) do cSI=GetContainerItemLink(i,j);if cSI then if(strfind(cSI,pAy[pK]))then UseContainerItem(i,j);PickupInventoryItem(pK);do return;end;end;end;end;end;

    What I ended up with is:

    /run PSN={[16]="Instant Poison",[17]="Instant Poison"}; mE,_,_,oE=GetWeaponEnchantInfo(); if mE==nil then n=16; elseif oE==nil then n=17; end; while n>=16 do for i=0,4 do for j=1,32,1 do cSI=GetContainerItemLink(i,j); if cSI and (strfind(cSI,PSN[n])) then UseContainerItem(i,j); PickupInventoryItem(n); do return end; end; end; end; end; end; end;

    but I honestly have no idea how to debug properly. The error message I get is: "<string>:"PSN={[16]="Instant Poison",[17]="Instant Poison"}; mE,_,_,oE=Ge...":1: `end' expected near `<eof>'" but since I don't know Lua I can't really tell if I put too many ends, not enough ends or whether something else is broken.

    Help me repair it or come up with a better, working solution please! thx


    Paste this code into notepad and save it as addonname.Lua you can change addon name to whatever.

    make a macro in game that has just the command /dp or /dpspoison put it on your bar. If you click it, it will poison your main hand. if you hold Alt it will poison your offhand. If you hold Ctrl it will use Deadly poison instead of instant poison. Ctrl+alt = Deadly poison on offhand. It will also announce how much poison you have remaining.


    Code:
    SLASH_DDPOISON1, SLASH_DDPOISON2 = "/dpspoison", "/dp"
    function SlashCmdList.DDPOISON()
    	if not IsControlKeyDown() then
    	local instant=0
    		for  x=0,4,1 do 
    			for  y=1,GetContainerNumSlots(x),1 do z= GetContainerItemLink(x,y)
    				if z and string.find(z,"Instant Poison") then
    				local _, itemCount = GetContainerItemInfo(x,y);
    				instant= instant + itemCount;
    				UseContainerItem(x,y)
    				end
    			end
    		end
    		
    		
    		if IsAltKeyDown() then
    		PickupInventoryItem(17) ReplaceEnchant() ClearCursor()
    		if instant==0 then DEFAULT_CHAT_FRAME:AddMessage("You have no Instant Poison. Purchase more!")
    		else instant= instant - 1
    		DEFAULT_CHAT_FRAME:AddMessage("Using Instant Poison on Off-hand. "..instant.." remaining.")end
    		
    		else PickupInventoryItem(16) ReplaceEnchant() ClearCursor()
    		if instant==0 then DEFAULT_CHAT_FRAME:AddMessage("You have no Instant Poison. Purchase more!") 
    		else instant= instant - 1
    		DEFAULT_CHAT_FRAME:AddMessage("Using Instant Poison on Main-hand. "..instant.." remaining.")end
    		end	
    		end
    
    		
    
    	if IsControlKeyDown() then
    	local deadly=0
    		for  x=0,4,1 do 
    			for y=1,16,1 do z= GetContainerItemLink(x,y)
    				if z and string.find(z,"Deadly Poison") then
    					local _, itemCount = GetContainerItemInfo(x,y);
    					deadly = deadly + itemCount
    					UseContainerItem(x,y)
    				end
    			end
    		end
    		
    		if IsAltKeyDown() then
    		PickupInventoryItem(16) ReplaceEnchant() ClearCursor()
    		if deadly==0 then DEFAULT_CHAT_FRAME:AddMessage("You have no Deadly Poison. Purchase more!") end
    		if not deadly==0 then
    		DEFAULT_CHAT_FRAME:AddMessage("Using Deadly Poison on Main-hand. "..deadly.." remaining.")end
    		
    		else PickupInventoryItem(17) ReplaceEnchant() ClearCursor()
    		if deadly==0 then DEFAULT_CHAT_FRAME:AddMessage("You have no Deadly Poison. Purchase more!") end
    		if not deadly==0 then
    		DEFAULT_CHAT_FRAME:AddMessage("Using Deadly Poison on Off-hand. "..deadly.." remaining.")end
    		end	
    		end
    end



    after you make your LUA file you will need to make a second file in notepad


    put this code into your 2nd file and name it addonname.toc again you can name addonname anything you like.


    Code:
    ## Interface: 120000
    ## Title: Addonname
    ## Notes: "This is the text that will show up in-game character select screen if you open the Addon window
    ## Author: Oderus
    
    addonname.lua

    Make sure you change addonname.lua to the same name as whatever your named your lua file.


    After that put it into a folder with your addon name and put it in your addons folder.



    Sorry i know its not what you necessarily asked for but im just sharing my own personal script that i use.

    I also have this code built into my rotation to spam my chat window if my poisons are about to fade or are missing; You can add conditionals to make it only spam if youre out of combat or 100+ energy so it doesnt spam so bad.


    Code:
    		hasMainHandEnchant, mainHandExpiration, mainHandCharges, hasOffHandEnchant, offHandExpiration, offHandCharges = GetWeaponEnchantInfo();
    		if not hasMainHandEnchant then DEFAULT_CHAT_FRAME:AddMessage("Missing poison in Main hand") end
    		if not hasOffHandEnchant then DEFAULT_CHAT_FRAME:AddMessage("Missing poison in Off hand") end
    		if hasMainHandEnchant and (mainHandExpiration/1000)<=180 then DEFAULT_CHAT_FRAME:AddMessage("Poison expiring in Main hand..") end
    		if hasOffHandEnchant and (offHandExpiration/1000)<=180 then DEFAULT_CHAT_FRAME:AddMessage("Poison expiring in Off hand..") end
    Last edited by Oderus; 02-26-2017 at 03:11 AM.

Similar Threads

  1. Need a ability spam macro, help ~
    By Icegrip in forum Diablo 3 Bots Questions & Requests
    Replies: 6
    Last Post: 07-25-2012, 06:38 PM
  2. [Macro} request, need help please. Prot warrior macro
    By macronoob in forum WoW UI, Macros and Talent Specs
    Replies: 3
    Last Post: 06-04-2012, 04:04 AM
  3. [MACRO] Switch, need help please!
    By Nyarly in forum WoW UI, Macros and Talent Specs
    Replies: 5
    Last Post: 04-18-2011, 11:05 PM
  4. [LUA/macro] Another "need help" thread, easy rep.
    By Ssateneth in forum WoW UI, Macros and Talent Specs
    Replies: 15
    Last Post: 11-26-2010, 06:04 AM
  5. Macro help needed
    By Fenryr in forum Programming
    Replies: 3
    Last Post: 01-02-2009, 02:01 PM
All times are GMT -5. The time now is 10:21 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search