Download
(2Kb)
Download
Updated: 05-16-15 02:16 PM
Pictures
File Info
Compatibility:
The Adventure Continues (6.1)
Updated:05-16-15 02:16 PM
Created:03-28-15 10:16 AM
Downloads:2,415
Favorites:10
MD5:

Daily Scrapmetal quest

Version: 0.9
by: evantaur, bsmorgan

Auto accepts and completes the daily quest given by Dwarven Bunker / War Mill

Slash Commands:
/dbd reward - Automatically picks quest reward based on follower average armor/weapon iLevel determined by Altoholic.
/dbd disable|enable - Turns addon on/off

0.9 Added slash command "/dbd reward". State is saved per character. Automatically picks quest reward based on follower average armor/weapon iLevel determined by Altoholic.

0.8 Added slash commands "/dbd disable" and "/dbd enable". State is saved per character.

0.7 Should no longer whine about "quest log is full" when quest log is full but already have "Scrap Meltdown" in questlog

0.6 Cleanup the indentation (tabs and spaces).

0.5 does no longer autoaccept quest if you don't have enough scrap to complete it or if you don't have enough space in your quest log

0.4 Cleanup the indentation (tabs and spaces).

0.3 bsmorgan's patch that fixes a variable leak and adds support for altoholic's data store

0.2 Now uses quest/npc IDs instead of names... should work for everyone now (thanks to bsmorgan)

0.1b
- Added support for German client (thanks to Da_bernie)
Optional Files (0)


Post A Reply Comment Options
Unread 04-13-15, 03:55 PM  
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view AddOns

Forum posts: 219
File comments: 158
Uploads: 3
Below is a patch to use DataStore_Garrisons (patch submitted and should be included in Altoholic) to help decide which reward would be better (marked with an "*" in the chat output).

I include it here at this time because it also fixes a global leak of quest_id and it should not generate any errors if Altoholic isn't installed or the patch hasn't been incorporated.

Code:
--- D:/WowOld/DBD/DBD.toc	Sat Apr 04 18:44:12 2015
+++ D:/World of Warcraft/Interface/AddOns/DBD/DBD.toc	Mon Apr 13 13:21:50 2015
@@ -3,4 +3,5 @@
 ## Notes: Autoaccepts and completes scrapmetal daily from Dwarven Bunker / War Mill
 ## Author: Evantaur
 ## Version: 0.2
+## OptionalDeps: DataStore
 DBD.lua
\ No newline at end of file
--- D:/WowOld/DBD/DBD.lua	Sat Apr 04 19:03:13 2015
+++ D:/World of Warcraft/Interface/AddOns/DBD/DBD.lua	Mon Apr 13 13:51:11 2015
@@ -20,15 +20,28 @@
 				CompleteQuest()
 			end
 			if (event == "QUEST_DETAIL") then
-				quest_id = GetQuestID()
+				local quest_id = GetQuestID()
 				if (quest_id == 38175 or quest_id == 38188) then -- Insurance against future changes
 					AcceptQuest()
 				end
 			end
 			if (event == "QUEST_PROGRESS") then
-				quest_id = GetQuestID()
+				local quest_id = GetQuestID()
 				if (quest_id == 38175 or quest_id == 38188) then
 					CompleteQuest()
+					if DataStore then
+						local character = DataStore:GetCharacter()
+						local AiLvl = DataStore:GetAvgArmoriLevel(character) or 0
+						local WiLvl = DataStore:GetAvgWeaponiLevel(character) or 0
+						if ((AiLvl + WiLvl) ~= 0) then
+						        local pickA = " "
+						        local pickW = " "
+						        if (AiLvl < WiLvl) then
+							        pickA = "* "
+						        elseif (AiLvl > WiLvl) then
+							        pickW = "* "
+						        end
+						        print(format("Armor%s= %.1f, Weapon%s= %.1f",pickA,AiLvl,pickW,WiLvl))
+					        end
+					end
 				end
 			end
 		end
Last edited by bsmorgan : 04-14-15 at 10:24 AM.
Report comment to moderator  
Reply With Quote
Unread 04-05-15, 08:10 AM  
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view AddOns

Forum posts: 219
File comments: 158
Uploads: 3
Please consider including the version number in the filename, i.e. DBD-0.2.zip. I don't like to overwrite old versions until newer versions have "proven" themselves.
Report comment to moderator  
Reply With Quote
Unread 04-04-15, 07:09 PM  
evantaur
A Kobold Labourer
 
evantaur's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 31
Uploads: 2
replaced the code... will look into that recommendation thingy a bit later (it's actually 4 am )
__________________
Evantaur-Darkspear (Balance Druid)
Evanette-Darkspear (Arms Warrior)
Panzergnome-Darkspear (Fury Warrior)
Report comment to moderator  
Reply With Quote
Unread 04-04-15, 05:23 PM  
evantaur
A Kobold Labourer
 
evantaur's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 31
Uploads: 2
Originally Posted by bsmorgan
Now if you really want to get fancy, add code to parse the player's follower list and compute the average weapon iLvl and average armor iLvl of the active followers. display the results when you interact with these NPCs. This should help with the decision process on which quest reward should be chosen.
i'll look into it...
__________________
Evantaur-Darkspear (Balance Druid)
Evanette-Darkspear (Arms Warrior)
Panzergnome-Darkspear (Fury Warrior)
Report comment to moderator  
Reply With Quote
Unread 04-03-15, 10:46 AM  
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view AddOns

Forum posts: 219
File comments: 158
Uploads: 3
Now if you really want to get fancy, add code to parse the player's follower list and compute the average weapon iLvl and average armor iLvl of the active followers. display the results when you interact with these NPCs. This should help with the decision process on which quest reward should be chosen.

The addon OneChoice has code you could "borrow" to add a highlight around the quest reward.

Average iLvl may not be the best criteria for making this decision, but its the best one I've come up with so far.
Report comment to moderator  
Reply With Quote
Unread 04-03-15, 10:35 AM  
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view AddOns

Forum posts: 219
File comments: 158
Uploads: 3
I'd suggest that you use UnitGUID("target") instead of UnitName("target"). This should work in any locale.

From my client, http://www.wowhead.com/npc=77377/kristen-stoneforge has a GUID of "Creature-0-3019-1159-30357-77377-00001EBB12" which when properly parsed (see below), the 77377 should be a constant for her.

http://www.wowhead.com/npc=79815/grunlek should yield 79815 from the same parsing of his GUID.

Code:
DBD:SetScript("OnEvent",function(self,event,msg,...)
	local guid = UnitGUID("target")
	if guid then
		local gtype, zero, server_id, instance_id, zone_uid, npc_id, spawn_uid = strsplit("-",guid);
		if gtype == "Creature" and (npc_id == "77377" or npc_id == "79815") then
			if (event == "GOSSIP_SHOW") then
				GetGossipAvailableQuests()
				SelectGossipAvailableQuest(1)
				SelectGossipActiveQuest(1)
				CompleteQuest()
			end
			if (event == "QUEST_DETAIL") then
				quest_id = GetQuestID()
				if (quest_id == 38175 or quest_id == 38188) then -- Insurance against future changes
					AcceptQuest()
				end
			end
			if (event == "QUEST_PROGRESS") then
				CompleteQuest()
			end
		end
	end
end)
See http://wow.gamepedia.com/API_UnitGUID for more information.

Edit: replaced example code segment with something that actually works!
Edit: more better working code.
Last edited by bsmorgan : 04-03-15 at 03:35 PM.
Report comment to moderator  
Reply With Quote
Unread 04-02-15, 11:06 PM  
evantaur
A Kobold Labourer
 
evantaur's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 31
Uploads: 2
Originally Posted by da_bernie
Thanks for this little but great addon!

Quick fix for german users in german

Im deutschen clienten auf Seiten der Allianz muss der Name geändert werden.

Öffne die Datei ...World of Warcraft\Interface\AddOns\DBD\DBD.lua

In Zeile 8 ersetze "Kristen Stoneforge" durch "Kristen Steinschmiede".

Speichern nicht vergessen.
thank you!

added this to 0.1b version of the addon... keep them ideas/fixes coming
__________________
Evantaur-Darkspear (Balance Druid)
Evanette-Darkspear (Arms Warrior)
Panzergnome-Darkspear (Fury Warrior)
Report comment to moderator  
Reply With Quote
Unread 04-01-15, 11:07 PM  
da_bernie
A Kobold Labourer

Forum posts: 0
File comments: 5
Uploads: 0
Thanks for this little but great addon!

Quick fix for german users in german

Im deutschen clienten auf Seiten der Allianz muss der Name geändert werden.

Öffne die Datei ...World of Warcraft\Interface\AddOns\DBD\DBD.lua

In Zeile 8 ersetze "Kristen Stoneforge" durch "Kristen Steinschmiede".

Speichern nicht vergessen.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: