Register for your free account! | Forgot your password?

Go Back   elitepvpers > World of Warcraft > WoW Addons
You last visited: Today at 02:46

  • Please register to post and access all features, it's quick, easy and FREE!

 

Lua Frage, whatever.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2008
Posts: 169
Received Thanks: 11
Lua Frage, whatever.

Code:
running = 0
entrytime = 0
inbattle = 0
join = 0
joinpause = 0

function AutojoinOnLoad()
	DEFAULT_CHAT_FRAME:AddMessage("<Autojoin an>", 1, 0, 0)

	this:RegisterEvent("ZONE_CHANGED_NEW_AREA")
	this:RegisterEvent("BATTLEFIELDS_SHOW")
	this:RegisterEvent("UPDATE_BATTLEFIELD_STATUS")

 	SlashCmdList["BGASSISTTOGGLE"] = AutojoinToggle;
 	SLASH_AUTOJOINTOGGLE1 = "/toggle";

end

function AutojoinToggle()
	if (running == 0) then
		running = 1
		DEFAULT_CHAT_FRAME:AddMessage("<Autojoin an>", 0, 1, 0)
	else
		running = 0
		DEFAULT_CHAT_FRAME:AddMessage("<Autojoin aus>", 1, 0, 0)
	end
end

function AutojoinOnEvent()

	if (event == "ZONE_CHANGED_NEW_AREA") then
		SetMapToCurrentZone()

	elseif (event == "UPDATE_BATTLEFIELD_STATUS") then
		if (running == 1) then
			InBattle()
			if (inbattle == 0) then
				local index = nil
				for i=1, MAX_BATTLEFIELD_QUEUES do
					status, mapName, instanceID = GetBattlefieldStatus(i)
					if status == "confirm" then
						DEFAULT_CHAT_FRAME:AddMessage("<Joini in 10 sekunden>", 1, 0.5, 0)
						entrytime = GetTime()
						index = i
						bgindex = index
					end
				end
			end
		end
	end

end

function AutojoinOnUpdate()

	if (running == 1) then
		InBattle()
		if (inbattle == 0) then
			if (GetBattlefieldStatus(1) == "none") or (GetBattlefieldStatus(2) == "none") or (GetBattlefieldStatus(3) == "none") then
				if (joinpause == 0) then
					if (join == 0) then
						join = 1
						BattlegroundType1:Click();
						joinpause = GetTime()
					elseif (join == 1) then
						join = 2
						BattlegroundType2:Click();
						joinpause = GetTime()
					elseif (join == 2) then
						join = 0
						BattlegroundType3:Click();
						joinpause = GetTime()
					end
				else
					if (GetTime() > (joinpause + .5)) then
						JoinBattlefield(0)
						joinpause = 0
					end
				end
			end
		end

		if UnitIsDeadOrGhost("player") then
			RepopMe()
		end

		expiration = GetBattlefieldInstanceExpiration()
			if (expiration > 0) then
			LeaveBattlefield()
		end
	
		if (entrytime > 0) then
			if (GetTime() > (entrytime + 10)) then
				AcceptBattlefieldPort(bgindex,1)
				StaticPopup_Hide("CONFIRM_BATTLEFIELD_ENTRY")
				bgindex = nil
				entrytime = 0
			end
		end
	end

end

function InBattle()
	if (GetRealZoneText() == "Alterac Valley") or (GetRealZoneText() == "Warsong Gulch") or (GetRealZoneText() == "Arathi Basin") then
		inbattle = 1
	else
		inbattle = 0
	end
end


So, per /toggle wird autoqueue und autojoin aktiviert, allerdings nur fuer AV, AB und WS.

Wie bekomme ichs hin, das es für ADS und Strand auch anmeldet? oder z.B. nur für Strand/ADS?

/edit:

Michael Jackson has died btw.
mfG



globalleecher is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
Frage zum 173mt2 geht net regestrieren wegen Zeichnung oder ist das frage.
es geht einfach net.kann jemand helfen oder übersetzung geben bitte.
2 Replies - Metin2 PServer - Discussions / Questions



All times are GMT +1. The time now is 02:46.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.