Quantcast
McRun - Official thread - Page 2 - WoWInterface
Thread Tools Display Modes
05-21-10, 11:48 AM   #21
dafire
Premium Member
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 216
Thanks.. I think that this whole addon in a macro thing is a great idea .. I don't use many macros yet and look forward to play around with that stuff
  Reply With Quote
05-21-10, 01:21 PM   #22
dafire
Premium Member
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 216
I just played around with it.. and at least the buttons are changing when I switch the talents.. that's all a wanted to know for now

Changing the layout on switching talents would be even better

Hmm.. I think there is some more important stuff missing... a petbar / vehicleui comes to my mind

Last edited by dafire : 05-21-10 at 01:41 PM.
  Reply With Quote
05-21-10, 03:42 PM   #23
Cogwheel
Sans Poisson
 
Cogwheel's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 237
Originally Posted by dafire View Post
Hmm.. I think there is some more important stuff missing... a petbar / vehicleui comes to my mind
I could probably find a simple way to reattach the built-in pet bar to one of the CogsBar bars.

Vehicle support might be a bit too complex to handle elegantly within the space limitations. At the very least I can make sure the built-in one shows up. There might be a way to hack it in the current version with clever use of state paging though...

To be continued...
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote
05-22-10, 06:31 PM   #24
Tuller
A Warpwood Thunder Caller
 
Tuller's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 91
It needs some work, but here's McBag


Commands:
/mb - Toggle window.

1:
Code:
local F,CNS,Mt,C,g=CF('Button','McBag',UIParent),GetContainerNumSlots,setmetatable,ceil,{0,1,2,3,4,5}local B,H=function(i,b)b=F.b[i]b.size=CNS(i)return b end,function(i)for k,v in pairs(g)do if v==i then return k end end end Ij(F,{b=Mt({},{__index=
2:
Code:
function(t,k,f)f=CF('Frame',F:GetName()..'B'..k,F)f:SetID(k)t[k]=f f.i=Mt({},{__index=function(t,i,s)s=CF('Button',f:GetName()..'Item'..i,f,'ContainerFrameItemButtonTemplate')s:SetID(i)t[i]=s return s end})return f end}),lo=function(c,p,i,z,t)i,z=1,36+p
3:
Code:
for _,b in ipairs(g)do for _,v in pairs(B(b).i)do F.H(v)end for s=1,CNS(b)do t=B(b).i[s]t:ClearAllPoints()F.SP(t,'TOPLEFT',F,'TOPLEFT',(i-1)%c*z+8,-(C(i/c)-1)*z-24)F.S(t)i=i+1 end F.up(b)end F:SS(z*min(c,i)-p+16,z*(C(i/c)-1)-p+32)end,up=function(i)if H(i)
4:
Code:
then ContainerFrame_Update(B(i))end end,ul=function(i,s)if H(i)and s then ContainerFrame_UpdateLockedItem(B(i),s)end end})F:SetBackdrop{bgFile=[[Interface\ChatFrame\ChatFrameBackground]],edgeFile=[[Interface\Tooltips\UI-Tooltip-Border]],edgeSize=16,tile=1
5:
Code:
,tileSize=16,insets={left=4,right=4,top=4,bottom=4}}F:SetBackdropColor(0,0,0,.5)F:SSc('OnEvent',function(s,e,...)s[e](...)end)F.RE=function(e,m)F:R(e)F[e]=F[m]end F.RE('BAG_UPDATE','up')F.RE('ITEM_LOCK_CHANGED','ul')F:MM()F.lo(8,2)F:SP('RIGHT',-48,0)F:H()
6:
Code:
SL(function()if F:IsShown()then F:H()else F:S()end end,'/mb')
Original:
Code:
local F,CNS,Mt,C,g=CF('Button','McBag',UIParent),GetContainerNumSlots,setmetatable,ceil,{0,1,2,3,4,5}
local B,H=function(i,b) b=F.b[i] b.size=CNS(i) return b end,function(i)for k,v in pairs(g) do if v == i then return k end end end
Ij(F,{
	b=Mt({},{__index=function(t,k,f)
		f=CF('Frame',F:GetName()..'B'..k,F) f:SetID(k) t[k]=f
		f.i=Mt({},{__index=function(t,i,s)
			s=CF('Button',f:GetName()..'Item'..i,f,'ContainerFrameItemButtonTemplate') s:SetID(i) t[i]=s
			return s
		end})
		return f
	end}),
	lo=function(c,p,i,z,t)
		i,z=1,36+p
		for _,b in ipairs(g) do
			for _,v in pairs(B(b).i) do F.H(v) end
			for s=1,CNS(b) do
				t=B(b).i[s]
				t:ClearAllPoints()
				F.SP(t,'TOPLEFT',F,'TOPLEFT',(i-1)%c*z+8,-(C(i/c)-1)*z-24)
				F.S(t)
				i=i+1
			end
			F.up(b)
		end
		F:SS(z*min(c,i)-p+16,z*(C(i/c)-1)-p+32)
	end,
	up=function(i)
		if H(i) then
			ContainerFrame_Update(B(i))
		end
	end,
	ul=function(i,s)
		if H(i) and s then
			ContainerFrame_UpdateLockedItem(B(i),s)
		end
	end
})

F:SetBackdrop{
	bgFile=[[Interface\ChatFrame\ChatFrameBackground]],
	edgeFile=[[Interface\Tooltips\UI-Tooltip-Border]],
	edgeSize=16,
	tile=1,
	tileSize=16,
	insets={left=4,right=4,top=4,bottom=4}}
F:SetBackdropColor(0,0,0,.5)

F:SSc('OnEvent',function(s,e,...)s[e](...)end)
F.RE = function(e,m) F:R(e) F[e]=F[m] end
F.RE('BAG_UPDATE','up')
F.RE('ITEM_LOCK_CHANGED','ul')
F:MM()

F.lo(8,2)
F:SP('RIGHT',-48,0)
F:H()
SL(function()if F:IsShown() then F:H() else F:S() end end, '/mb')

Last edited by Tuller : 05-22-10 at 07:19 PM.
  Reply With Quote
05-22-10, 06:36 PM   #25
Cogwheel
Sans Poisson
 
Cogwheel's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 237



I luff you!


__________________
[SIGPIC][/SIGPIC]
  Reply With Quote
05-23-10, 04:45 AM   #26
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
I think it might be a nice addition to the McRun macro if we were able to separate the McRun mods using <> this would allow the naming of each snippet by having name<code>, it would also make it substantially easier for an external addon created to manage snippets to differentiate between different snippets.
something like this
lua Code:
  1. /run local function m(p,e)local s,i,f,c={},0,GetMacroInfo repeat s[i]=c i=i+1 c,c,c=f(p..i)until(not c)table.concat(s," "):gsub("%b<>",function(x)setfenv(loadstring(x:sub(2,-2)),e and setmetatable(e,{__index=_G})or _G)()end)end m"McLib"m"McLoad"McRun=m

Also the current Mc<addons> are making pretty quick progress

Last edited by Slakah : 05-23-10 at 05:24 AM.
  Reply With Quote
05-24-10, 03:28 PM   #27
pingbo
A Defias Bandit
Join Date: May 2006
Posts: 3
McCC

Here's a CooldownCount (this code is basically taken from evl's BlizzardTweaks and then stuffed through a meat grinder).

1:
Code:
local h,c,t,b,x,U=hooksecurefunc,"CENTER"U=function(f,e)if f.x and f.a then t=ceil(f.s+f.d-GetTime())if f.e>0 and t>0 then f.x:T(t)else f.x:T""f.a=false end end end h("ActionButton_OnUpdate",U)h("CooldownFrame_SetTimer",function(f,s,d,e)b=Ij(f:GetParent(
2:
Code:
))if s>0 and d>3 and e>0 then if not b.x then t=CF("Frame",b:N().."C",f)t:SzPt(32,32,c,b,c)x=Ij(t:CF(nil,"ARTWORK"))x:SetFont(NAMEPLATE_FONT,20)x:SetTextColor(1,.9,.2)x:SAP(t)x:SetJustifyH(c)b.x=x else b.x:T""end b.a,b.s,b.d,b.e=true,s,d,e U(f,1)end end)
Original:
Code:
local h,c,t,b,x,U=hooksecurefunc,"CENTER"
U=function(f,e)
	if f.x and f.a then
		t=ceil(f.s+f.d-GetTime())
		if f.e>0 and t>0 then
			f.x:T(t)
		else
			f.x:T""
			f.a=false
		end
	end
end
h("ActionButton_OnUpdate",U)
h("CooldownFrame_SetTimer",function(f,s,d,e)
	b=Ij(f:GetParent())
	if s>0 and d>3 and e>0 then
		if not b.x then
			t=CF("Frame",b:N().."C",f)
			t:SzPt(32,32,c,b,c)
			x=Ij(t:CF(nil,"ARTWORK"))
			x:SetFont(NAMEPLATE_FONT,20)
			x:SetTextColor(1,.9,.2)
			x:SAP(t)
			x:SetJustifyH(c)
			b.x=x
		else
			b.x:T""
		end
		b.a,b.s,b.d,b.e=true,s,d,e
		U(f,1)
	end
end)

Edit: With McRun 1.3 and a lot of finessing, I was able to get this down to 2 macros. I removed the stipulation that it only shows for abilities with less than one minute cooldowns, mostly to save space (so an ability with a 2-minute cooldown might show up as "1..." for a while until it gets below 100 seconds).

Last edited by pingbo : 05-26-10 at 01:14 PM. Reason: new version
  Reply With Quote
05-25-10, 10:12 PM   #28
Cogwheel
Sans Poisson
 
Cogwheel's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 237
Originally Posted by Slakah View Post
I think it might be a nice addition to the McRun macro if we were able to separate the McRun mods using <> this would allow the naming of each snippet by having name<code>, it would also make it substantially easier for an external addon created to manage snippets to differentiate between different snippets.
something like this
lua Code:
  1. /run local function m(p,e)local s,i,f,c={},0,GetMacroInfo repeat s[i]=c i=i+1 c,c,c=f(p..i)until(not c)table.concat(s," "):gsub("%b<>",function(x)setfenv(loadstring(x:sub(2,-2)),e and setmetatable(e,{__index=_G})or _G)()end)end m"McLib"m"McLoad"McRun=m
if 1 > 1 - 1 then this:fail() end



Put another way, any additions to the "syntax" of McRun scripts would either interfere with the lua syntax or require too much code to accomplish robustly (special comments, for instance would consume a lot of characters). Plus, I don't think you'd gain more characters than you would save by tighter packing (or at least not enough to make the extra library weight worth it).

That or I'm just being stubborn. I don't want to make any changes to McRun's fundamental architecture at this point.

<edit>
As far as McRun management addons, I think using the names of the macros will suffice.
</edit>

Also the current Mc<addons> are making pretty quick progress

le squee
__________________
[SIGPIC][/SIGPIC]

Last edited by Cogwheel : 05-26-10 at 09:52 AM.
  Reply With Quote
05-25-10, 11:45 PM   #29
Cogwheel
Sans Poisson
 
Cogwheel's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 237
V1.3

New version posted. See the link in the OP for details.

Thanks to everyone's enthusiasm, I've been able to identify several methods that are worth the additional macro slot for McLib:

:N (GetName)
:SAP (SetAllPoints)
:CAP (ClearAllPoints)
:T (SetText)
:FT (SetFormattedText)
:CF (CreateFontString)
:HS (HookScript)

I've also added a couple more code shortening tips.
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote
05-26-10, 01:48 PM   #30
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
Holy crap. This is like bringing Twiiter to WoW.
To bad I need textures.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
06-30-10, 05:21 PM   #31
Cogwheel
Sans Poisson
 
Cogwheel's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 237
So now that the NDA is lifted, I might as well mention the reason i made this... Addons were disabled through most of the Cataclysm Alpha and i NEED my bar mods!
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote
06-30-10, 05:30 PM   #32
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
And here I thought you had a completely unrelated mental disorder...
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote
07-02-10, 01:29 AM   #33
ffcloud2000
A Fallenroot Satyr
Join Date: Jul 2005
Posts: 24
Would anyone be able to make a script that would allow me to add keybinds to Main Action Bar 2? I was trying to do it hacking away at CogsBar but wasn't having any luck It's the bar under keys 1,2,3 etc etc (uses ActionID 13-24)

or if someone could help me make a CogsBar config that creates 1 12button bar with keybinds and sets the bar offscreen

trying to cheat but not working out too well
Code:
bars={
 {B=24,W=12,V=-500,H=0,
  K={'nil','nil','nil','nil','nil','nil',
     'nil','nil','nil','nil','nil','nil',
     'Z','X','SHIFT-Q','SHIFT-E',
     'SHIFT-W','SHIFT-A','SHIFT-S','SHIFT-D',
     'F1','F2','F3','F4',},
 },}
nevermind i got it to work .. tho it would be nice to do it without the nils..
__________________

Last edited by ffcloud2000 : 07-02-10 at 02:59 AM.
  Reply With Quote
07-02-10, 03:22 AM   #34
ffcloud2000
A Fallenroot Satyr
Join Date: Jul 2005
Posts: 24
Originally Posted by Slakah View Post
lua Code:
  1. local f,l=CF()f:SSc("OnEvent",function()for b=0,4 do for s=0,GetContainerNumSlots(b)do l=GetContainerItemLink(b,s)if l and select(3,GetItemInfo(l))==0 then ShowMerchantSellCursor(1)UseContainerItem(b,s)end end end end)f:R"MERCHANT_SHOW"

Ok heres an autojunk seller, 237 characters (it's not tested but it's pretty much identical to tekjunkseller).
Causes my fps to drop hard when i run it and makes AutoMcRun's memory usage to go through the roof
__________________
  Reply With Quote
07-02-10, 09:12 AM   #35
Cogwheel
Sans Poisson
 
Cogwheel's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 237
Originally Posted by ffcloud2000 View Post
nevermind i got it to work .. tho it would be nice to do it without the nils..
Glad you got it working. FWIW, the the nils shouldn't be in quotes otherwise it's trying to set the binding to a key called "nil". Since there's no key called "nil" it doesn't really break anything, but removing the quotes will help keep the character count down

I agree it would be nice to have more direct control over the action slots used, but there are too many "would be nice"s to fit inside just a few macro slots. (I can think of a few I'd like as well).
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote
07-02-10, 09:30 AM   #36
Cogwheel
Sans Poisson
 
Cogwheel's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 237
Originally Posted by ffcloud2000 View Post
Causes my fps to drop hard when i run it and makes AutoMcRun's memory usage to go through the roof
Would I be correct in assuming the FPS drop is only temporary? I don't see anything obviously wrong with the code.

This kind of performance impact is actually inevitable for any auto-junk selling addon. The API calls involved generate a lot of information (read: memory usage). There's also the effect of all the "sell item" calls which depends on your latency. This is simply the side effect of sending several (dozens?) of server requests.

The only way to get around these is to sell items asynchronously, but that requires a lot of extra code overhead (and if you walk away from the vendor during the process, not everything will be sold).
__________________
[SIGPIC][/SIGPIC]

Last edited by Cogwheel : 07-02-10 at 09:36 AM.
  Reply With Quote
07-03-10, 08:20 AM   #37
slickwalker
A Deviate Faerie Dragon
 
slickwalker's Avatar
Join Date: May 2005
Posts: 18
You really are a coding genius Cog.
  Reply With Quote
07-05-10, 06:53 AM   #38
mikelley517
A Defias Bandit
Join Date: Feb 2010
Posts: 2
Question McLoad Script-noob question.

I love the idea of this, but I am no code writer. I see that all these are required to be included in a "McLoad script" but I have not seen an example of the mcload script. Did I miss something obvious? Thanks for the help!
  Reply With Quote
07-05-10, 08:00 AM   #39
Cogwheel
Sans Poisson
 
Cogwheel's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 237
Originally Posted by mikelley517 View Post
I love the idea of this, but I am no code writer. I see that all these are required to be included in a "McLoad script" but I have not seen an example of the mcload script. Did I miss something obvious? Thanks for the help!
The section of the main McRun page called "Creating the McRun addon loader(s)" describes McLoad itself, and "Installing a McRun addon" gives an example of adding an addon to it.

I'm also working on a more beginner-friendly walkthrough that should be done in the not-too-distant future.
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote
07-06-10, 03:55 AM   #40
mikelley517
A Defias Bandit
Join Date: Feb 2010
Posts: 2
Originally Posted by Cogwheel View Post
The section of the main McRun page called "Creating the McRun addon loader(s)" describes McLoad itself, and "Installing a McRun addon" gives an example of adding an addon to it.

I'm also working on a more beginner-friendly walkthrough that should be done in the not-too-distant future.
Thank you. I did get the bars to work, but I was wondering if there is a way to hide the blizz main action bar, or if I just move this bar to where i want it and ignore the other. Thanks for all the work and the quick response!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Released AddOns » McRun - Official thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off