my code stock.com

Andreas Spegel

Dump InGame Infos via LUA
by Andreas Spegel

In WoW-Lua kopieren und einmalig ausführen.
Anschließend kann per "/run DumpQuestPickup();" Macro z.b. die PickUp Informationen abgerufen werden.

Snippet options

Download: Download snippet as dump-ingame-infos-via-lua.cpp.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

function DumpQuestPickup()
   for q=1,GetNumQuestLogEntries()
   do questTitle,level,questTag,suggestedGroup,isHeader,isCollapsed,isComplete,questID = GetQuestLogTitle(q)
      if (UnitName("target") == nil) then
         unitName = "EMPTY";
         unitID = "EMPTY";
      else
         unitName = UnitName("target");
         unitID = select(6,strsplit("-",UnitGUID("target")));
      end
      
      if (not isHeader and questID ~= 0) then
         print("<PickUp QuestName=\"" .. questTitle .. "\" QuestId=\"" .. questID .. "\" GiverName=\"" .. unitName .. "\" GiverId=\"" .. unitID .. "\" X=\"XXX\" Y=\"YYY\" Z=\"ZZZ\" />");
      end
   end
end

function DumpQuestTurnin()
   for q=1,GetNumQuestLogEntries()
   do questTitle,level,questTag,suggestedGroup,isHeader,isCollapsed,isComplete,questID = GetQuestLogTitle(q)
      if (UnitName("target") == nil) then
         unitName = "EMPTY";
         unitID = "EMPTY";
      else
         unitName = UnitName("target");
         unitID = select(6,strsplit("-",UnitGUID("target")));
      end
      
      if (not isHeader and questID ~= 0) then
         print("<TurnIn QuestName=\"" .. questTitle .. "\" QuestId=\"" .. questID .. "\" TurnInName=\"" .. unitName .. "\" TurnInId=\"" .. unitID .. "\" X=\"XXX\" Y=\"YYY\" Z=\"ZZZ\" />");
      end
   end
end

function DumpMapInfos()
   MapId = GetCurrentMapAreaID()
   MapName = GetMapNameByID(MapId);
   ZoneText = GetZoneText();
   SubZoneText = GetSubZoneText();
   
   print("Me.MapName == "..MapName); 
   print("Me.MapId == "..MapId);   
   print("Me.ZoneText == "..ZoneText);
   print("Me.SubZoneText == "..SubZoneText);  
end

function DumpVehicleTaxiInfos()
   if UnitInVehicle("player") then
      print("Me.InVehicle == true"); 
   else
      print("Me.InVehicle == false"); 
   end
   if UnitOnTaxi("player") then
      print("Me.OnTaxi == true"); 
   else
      print("Me.OnTaxi == false"); 
   end
end

function DumpScenarioInfos()
   --print(C_Scenario.GetInfo())
   --print(C_Scenario.GetStepInfo())
   
   local isInScenario = C_Scenario.IsInScenario()
   local scenarioName, currentStage, numStages, flags, _, _, completed, xp, money, scenarioType = C_Scenario.GetInfo()
   local stageName, stageDescription, numCriteria, stageCompleted, _, _, numSpells, spellInfo, weightedProgress = C_Scenario.GetStepInfo()
   
   if isInScenario then
      print("IsInScenario             == true");
      
      print("Scenario Name            == \"" ..scenarioName); 
      print("Scenario Stage Number    == "..currentStage); 
      print("Scenario Total Num Stages== "..numStages); 
      print("Scenario Flags           == "..flags); 
      print("Scenario Completed       == "..tostring(completed));
      print(xp);
      print(money);
      print(scenarioType);
      
      print("Scenario Stage Number    == "..numCriteria); 
      print("Scenario Stage Name      == \""..stageName.."\""); 
      print("Scenario Stage Completed == "..tostring(stageCompleted));    
   else
      print("IsInScenario == false"); 
   end
end

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.