No Addons, No Problem (TJH & DPS Meter on Beta)

Mists of Pandaria Beta discussion

Moderators: Fridmarr, Worldie, Aergis, Sabindeus, PsiVen

No Addons, No Problem (TJH & DPS Meter on Beta)

Postby _Chloe » Wed May 09, 2012 6:10 am

Currently you cannot execute any "/script" commands on Beta and the Secure flag is still active as well, hindering the use of addons and scripts.
Behold the Pandaclysm!
Basically this was the CBHLib I was working on near the end of WotLK, now shrunk down to size to fit in some macros. With this backbone, you could make a small TJH (ThatJustHappened) mod running and now a working personal DPS Meter on Beta.

Instructions: Just copy and paste into macros or directly into the chat panel in order. I would recommend macros because every time you see a loading screen you have to re-enter or click all this. Also is a pain because of the 255 character limit.
>>BASE CODE<<
Code: Select all
/dump (function() RunScript=function(a) loadstring(a)(); end; end)()

Code: Select all
/run CBH={}; CBH.RC={}; CBH.PETGUID = UnitGUID("pet"); CBH.PGUID = UnitGUID("player");

Code: Select all
/run function CBH:Console(msg) if msg == nil then msg = "nil" end; DEFAULT_CHAT_FRAME:AddMessage(msg); end

Code: Select all
/run function CBH:Error(msg) UIErrorsFrame:AddMessage(msg, 1.0, 1.0, 0, 1, 10); end

Code: Select all
/run function CBH:Message(msg,channel) SendChatMessage(msg, channel); end

Code: Select all
/run function CBH:COMBAT_LOG_EVENT_UNFILTERED(...) for i=1, table.getn(CBH.RC) do if CBH.RC[i][1]==select(2,...) then CBH.RC[i][2](self, ...); end end end

Code: Select all
/run CBHF=CreateFrame("Frame"); CBHF:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");  CBHF:SetScript("OnEvent", function(self, event, ...) CBH[event](self, ...) end );

Code: Select all
/run function CBH:RegisterCLUE(event, functionToRegister) table.insert(CBH.RC, {event, functionToRegister}); end


CBH:Console(string) - Prints string to default chat frame
CBH:Error(string) - Prints string to UIErrorFrame in a yellow text
CBH:Message(string, channel) - Broadcasts string to specified channel. For valid channel strings see here.
CBH:RegisterCLUE(eventType, function) - COMBAT_LOG_UNFILTERED_EVENT eventType. function is the specified function to execute when the eventType is recognized.

>> TJH <<
Examples:
Sacred Shield Falling Off (Self Only)
Code: Select all
/run function SSDOWN(self, ...) if select(4,...) == CBH.PGUID and select(12,...) == 20925 then CBH:Console(">> Sacred Shield Has Faded! <<"); end end;

Code: Select all
/run CBH:RegisterCLUE("SPELL_AURA_REMOVED", function(self, ...) SSDOWN(self, ...) end);

Ardent Defender Up & Down (Party Announce)
Code: Select all
/run function ADUP(self, ...) if select(4,...) == CBH.PGUID and select(12,...) == 31850 then CBH:Message(">> Ardent Defender Up! <<", "PARTY"); end end;

Code: Select all
/run CBH:RegisterCLUE("SPELL_AURA_APPLIED", function(self, ...) ADUP(self, ...) end);

Code: Select all
/run function ADDOWN(self, ...) if select(4,...) == CBH.PGUID and select(12,...) == 31850 then CBH:Console(">> Ardent Defender Down! <<", "PARTY"); end end;

Code: Select all
/run CBH:RegisterCLUE("SPELL_AURA_APPLIED", function(self, ...) ADDOWN(self, ...) end);

Issues:
GoAK currently does not produce a combat log event, so it cannot be monitored.

>> DPS Meter <<
Note: This should be 95% accurate. Still need some testing with pet classes.
Code: Select all
/run CBH.dps = 0; CBH.D=0; CBH.t=0; CBH.cST=0;

Code: Select all
/run function CBH:UNIT_PET(unit) if unit == "player" then CBH.PETGUID = UnitGUID("pet") else CBH.PETGUID"0x0" end end CBHF:RegisterEvent("UNIT_PET");

Code: Select all
/run function CBH:PLAYER_REGEN_DISABLED() CBH.t=0; CBH.cST = 0; CBH.D = 0;  end; CBHF:RegisterEvent("PLAYER_REGEN_DISABLED");

Code: Select all
/run function CBH:PLAYER_REGEN_ENABLED() CBH.dps=CBH.D/(CBH.t-CBH.cST); CBH:Console("DPS: "..string.format("%.1fK",CBH.dps)); end; CBHF:RegisterEvent("PLAYER_REGEN_ENABLED");

Code: Select all
/run CBH.dpsevents={SWING_DAMAGE=true,RANGE_DAMAGE=true,SPELL_DAMAGE=true,SPELL_PERIODIC_DAMAGE=true,DAMAGE_SHIELD=true,DAMAGE_SPLIT=true}

Code: Select all
/run function DPS(_,t, eT, _, Id, _, _, _, _, _, _, _, sI, _, _, d) if Id==CBH.PGUID or Id==CBH.PETGUID then if eT=="SWING_DAMAGE" then d=sI end CBH.D=CBH.D+d end if CBH.cST==0 then CBH.cST=t else CBH.t=t end end

Code: Select all
/run CBH:RegisterCLUE("SWING_DAMAGE",function(self,...)DPS(self,...)end);CBH:RegisterCLUE("RANGE_DAMAGE",function(self,...)DPS(self,...)end);CBH:RegisterCLUE("SPELL_DAMAGE",function(self,...)DPS(self,...)end);

Code: Select all
/run CBH:RegisterCLUE("SPELL_PERIODIC_DAMAGE",function(self,...)DPS(self,...)end);CBH:RegisterCLUE("DAMAGE_SHIELD",function(self,...)DPS(self,...)end);CBH:RegisterCLUE("DAMAGE_SPLIT",function(self,...)DPS(self,...)end);


This displays your DPS to only you after you exit combat.

Note: The first macro command is what overwrites the RunScript() function using the /dump command, allowing scripts to be ran from macros and the chat frame.
User avatar
_Chloe
Moderator
 
Posts: 971
Joined: Fri Dec 07, 2007 6:36 pm
Location: Santa Monica, CA

Re: No Addons, No Problem (TJH & DPS Meter on Beta)

Postby _Chloe » Wed May 09, 2012 6:11 am

Reserved.
User avatar
_Chloe
Moderator
 
Posts: 971
Joined: Fri Dec 07, 2007 6:36 pm
Location: Santa Monica, CA

Re: No Addons, No Problem (TJH & DPS Meter on Beta)

Postby Sabindeus » Wed May 09, 2012 8:12 am

oh man, this is a lot of code. *rofling IRL*
Image
Turn In, an NPC interaction automator - http://wow.curse.com/downloads/wow-addo ... rn-in.aspx
User avatar
Sabindeus
Moderator
 
Posts: 10476
Joined: Mon May 14, 2007 9:24 am

Re: No Addons, No Problem (TJH & DPS Meter on Beta)

Postby fuzzygeek » Wed May 09, 2012 9:34 am

Has the combat log format changed significantly in MoP? Could someone post some strings?
Image
User avatar
fuzzygeek
Maintankadonor
 
Posts: 5130
Joined: Wed Aug 01, 2007 1:58 pm

Re: No Addons, No Problem (TJH & DPS Meter on Beta)

Postby _Chloe » Wed May 09, 2012 9:42 am

No it hasn't. It's the same as it is in 4.3.

EDIT:
http://pastebin.com/nyeFPALw
User avatar
_Chloe
Moderator
 
Posts: 971
Joined: Fri Dec 07, 2007 6:36 pm
Location: Santa Monica, CA

Re: No Addons, No Problem (TJH & DPS Meter on Beta)

Postby fuzzygeek » Wed May 09, 2012 1:44 pm

Excellent. Thank you.
Image
User avatar
fuzzygeek
Maintankadonor
 
Posts: 5130
Joined: Wed Aug 01, 2007 1:58 pm


Return to Mists of Pandaria Beta

Who is online

Users browsing this forum: No registered users and 0 guests

Who is online

In total there are 0 users online :: 0 registered, 0 hidden and 0 guests (based on users active over the past 5 minutes)
Most users ever online was 380 on Tue Oct 14, 2008 6:28 pm

Users browsing this forum: No registered users and 0 guests