[Request] Logout on death macro menu

User Tag List

Results 1 to 3 of 3
  1. #1
    Muramasa's Avatar Active Member

    Reputation
    35
    Join Date
    Aug 2008
    Posts
    191
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Request] Logout on death macro

    As the title suggests, I'd like to know if there's perhaps a /script or /run command line that will log me out if my character is dead.

    The following works, now if only someone could compress it into macro form I would be a happy camper:

    Code:
    --[[
    	BGRelease - because having to click the Release button is annoying.
    ]]
    
    -- Create an addon object using the Ace3 libraries
    BGR = LibStub("AceAddon-3.0"):NewAddon("BGR", "AceEvent-3.0")
    
    -- Define the battlegrounds here
    local BGs = {
    	["Winterspring"] = true,
    	["Tanaris"] = true,
    	["Stranglethorn Vale"] = true,
    }
    
    function BGR:OnInitialize()
    	-- Default is to enable the addon for a new profile
    	self.defaults = {
    		profile = {
    			enabled = true,
    		},
    	}
    	
    	self.db = LibStub:GetLibrary("AceDB-3.0"):New("BGReleaseDB", self.defaults)
    end
    
    function BGR:OnEnable()
    	-- Watch for the omgidied event
    	self:RegisterEvent("PLAYER_DEAD")
    end
    
    function BGR:OnDisable()
    	-- Is it polite or necessary to unregister events
    	-- when using AceEvent? I guess I'll do it just to 
    	-- be safe.
    	self:UnregisterEvent("PLAYER_DEAD")
    end
    
    function BGR:Print(str)
    	DEFAULT_CHAT_FRAME:AddMessage(str)
    end
    
    function BGR:PLAYER_DEAD()
    	-- If BGR is enabled,
    	-- and you're in a defined battleground,
    	-- and you don't have a Soulstone on,
    	-- then release when killed.
    	if (self.db.profile.enabled and BGs[GetRealZoneText()] and not HasSoulstone()) then
    		Logout()
    	end
    end
    
    -- Register slash commands /bgr and /bgrelease.
    -- Note: should probably do this with Ace3 stuff, but
    -- this is the way I already knew how to do it. Should
    -- rewrite later.
    SLASH_BGR1 = "/bgr"
    SLASH_BGR2 = "/bgrelease"
    SlashCmdList["BGR"] = function(input)
    	local self = BGR
    	local cmd = string.lower(string.trim(input) or "")
    	local status = ""
    	local showSyntax = false
    
    	if (cmd == "on") then
    		-- Enable the addon functionality
    		self.db.profile.enabled = true
    		status = "|cFF00FF00Enabled|r"
    	elseif (cmd == "off") then
    		-- Disable the addon functionality
    		self.db.profile.enabled = false
    		status = "|cFFFF0000Disabled|r"
    	else
    		-- Get the current status
    		if (self.db.profile.enabled) then
    			status = "|cFF00FF00Enabled|r"
    		else
    			status = "|cFFFF0000Disabled|r"
    		end
    		showSyntax = true
    	end
    	
    	-- Display the current status
    	self:Print("BGRelease: " .. status)
    
    	-- If no valid arguments were passed to the slash command,
    	-- display the syntax message
    	if (showSyntax) then
    		self:Print("BGRelease: '/bgr on' to enable")
    		self:Print("BGRelease: '/bgr off' to disable")
    	end
    end
    Last edited by Muramasa; 08-05-2010 at 07:57 AM. Reason: Help
    All who possess the blade go mad.

    [Request] Logout on death macro
  2. #2
    Rock Lee's Avatar Banned
    Reputation
    41
    Join Date
    Jul 2010
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No idea if it works.
    Code:
    /script if (IsAlive()== false) then /logout /console logout end

  3. #3
    Muramasa's Avatar Active Member

    Reputation
    35
    Join Date
    Aug 2008
    Posts
    191
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ^ Does not work
    All who possess the blade go mad.

Similar Threads

  1. Request: Queue Proving Grounds Macro?
    By Altastretas in forum WoW UI, Macros and Talent Specs
    Replies: 0
    Last Post: 02-05-2016, 03:56 PM
  2. [Request] Bank deposit/withdraw macros
    By phyte in forum WoW UI, Macros and Talent Specs
    Replies: 2
    Last Post: 06-24-2012, 10:43 PM
  3. [Request] NE Female > Death Knight
    By Lokin in forum WoW ME Questions and Requests
    Replies: 8
    Last Post: 06-04-2008, 03:32 PM
  4. [REQUEST] MM Shot Rotation macro.
    By Performer in forum World of Warcraft General
    Replies: 2
    Last Post: 01-19-2008, 03:55 AM
  5. Rogue blind macro request
    By albundy_1 in forum World of Warcraft General
    Replies: 2
    Last Post: 03-22-2007, 09:23 AM
All times are GMT -5. The time now is 10:12 PM. 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