Thread Tools Display Modes
10-08-12, 10:17 PM   #1
ssbattousai
A Murloc Raider
Join Date: Oct 2012
Posts: 4
simple rollonloot

Problem

/run rollonloot(rollID,1|2|3);

doesn't work, does anyone have a working macro that 'needs on the loot' rather than clicking on it.

Please no addons and no redirection to sites.

Then also a /run ConfirmLootRoll(rollID, 1|2|3); to complete the macro

Any ideas would be greatly appreciated.

Thank you all!
  Reply With Quote
10-08-12, 10:19 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Is that your actual macro? Lua (the programming language WoW's interface uses) is case-sensitive, so "rollonloot" is not the same as "RollOnLoot".
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-08-12, 10:29 PM   #3
ssbattousai
A Murloc Raider
Join Date: Oct 2012
Posts: 4
Originally Posted by Phanx View Post
Is that your actual macro? Lua (the programming language WoW's interface uses) is case-sensitive, so "rollonloot" is not the same as "RollOnLoot".
Yep, sorry I was writing it off the top of my head, here is the correct question

/script RollOnLoot(1, 2);
/script ConfirmLootRoll(1, 2);

I want that to work, any ideas?
  Reply With Quote
10-08-12, 11:56 PM   #4
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
You can't make that work in a macro. Macros execute in order, without any wait between commands. You would need to have an AddOn which listens for the CONFIRM_LOOT_ROLL event, at which point your ConFirmLootRoll(id) would be executed.
__________________
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
10-09-12, 10:07 AM   #5
Sharparam
A Flamescale Wyrmkin
 
Sharparam's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 102
Might be a possible with a macro such as this:
lua Code:
  1. /run local f=CreateFrame"Frame"f:SetScript("OnEvent",function(s,e,i,r)ConfirmLootRoll(i,r)s:UnregisterEvent(e)s:SetScript("OnEvent",nil)end)f:RegisterEvent"CONFIRM_LOOT_ROLL"RollOnLoot(1,2)

This could have unintended side-effects though since the script confirms the first CONFIRM_LOOT_ROLL event, which *should* be the RollOnLoot executed right after frame creation, but it *might* not be.

Then I'm not sure about performance of creating a new frame every time the macro is called.
  Reply With Quote
10-09-12, 10:35 AM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,325
You can modify the code to store the frame in a global and check for the global before trying to create the frame. something like the following.
Lua Code:
  1. /run local f=CRF or CreateFrame("Frame","CRF")f:SetScript("OnEvent",function(s,e,i,r)ConfirmLootRoll(i,r)s:UnregisterEvent(e)s:SetScript("OnEvent",nil)end)f:RegisterEvent"CONFIRM_LOOT_ROLL"RollOnLoot(1,2)
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » simple rollonloot


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