Jump to content

TheSmokie

Banned
  • Posts

    1215
  • Joined

Posts posted by TheSmokie

  1. Hey @pudge, i did something like this a long time ago, I've found it to be be to long, and it would slow down quester because loading all the vectors then move too. idk could be because i had it very long or somewhat. but you wanna make the MovementManager.go into a while loop. so it keeps moving.

  2. @ScripterQQ i found this, might help ya ! 

    		-- Tabled Cast Time Checking for When you Last Cast Something.
    	CheckCastTime = {}
    	Nova_CheckLastCast = nil
    	function Nova_CheckLastCast(spellid, ytime) -- SpellID of Spell To Check, How long of a gap are you looking for?
    		if ytime > 0 then
    			if #CheckCastTime > 0 then
    				for i=1, #CheckCastTime do
    					if CheckCastTime[i].SpellID == spellid then
    						if GetTime() - CheckCastTime[i].CastTime > ytime then
    							CheckCastTime[i].CastTime = GetTime()
    							return true
    						else
    							return false
    						end
    					end
    				end
    			end
    			table.insert(CheckCastTime, { SpellID = spellid, CastTime = GetTime() } )
    			return true
    		elseif ytime <= 0 then
    			return true
    		end
    		return false
    	end

     

  3. @Andoido You can just use a simple Logging.OnChangedStatus  attachment, please note this is @Matenia free source code, i didnt make nor have anything to do with making this code. all i done was made it to work inside a quester custom script.

    All you have to do is edit CreateFrameIfNecessary() to your interface code and edit the WhatsGoingOnFrame.SetText(""{0}"") to your SetText Frame.

    This saves you so many lines of code, you profile has over 1000 lines of frame editing code.

     

    public static class QuesterFrame
    {
        public static readonly List<string> _invalidStatus = new List<string>
        {
            "Quester"
        };
    
        public static void Starter()
        {
            Logging.OnChangedStatus += LoggingOnOnChangedStatus;
        }
    
        private static void LoggingOnOnChangedStatus(object sender, Logging.StatusChangeEventArgs statusChangeEventArgs)
        {
            string status = Logging.Status;
            if (!_invalidStatus.Contains(status))
            {
                Lua.LuaDoString(FormatLua(@"WhatsGoingOnFrame.text:SetText(""{0}"")", status));
            }
        }
    
    
        public static void CreateFrameIfNecessary()
        {
            Lua.LuaDoString(@"
            if not WhatsGoingOnFrame then
                WhatsGoingOnFrame = CreateFrame(""Frame"")
                WhatsGoingOnFrame:ClearAllPoints()
                WhatsGoingOnFrame:SetBackdrop(StaticPopup1:GetBackdrop())
                WhatsGoingOnFrame:SetHeight(100)
                WhatsGoingOnFrame:SetWidth(250)
         
                WhatsGoingOnFrame.text = WhatsGoingOnFrame:CreateFontString(nil, ""BACKGROUND"", ""GameFontNormal"")
                WhatsGoingOnFrame.text:SetAllPoints()
                WhatsGoingOnFrame.text:SetText(""Initializing..."")
                WhatsGoingOnFrame.text:SetTextColor(1, 1, 0, 1)
                WhatsGoingOnFrame:SetPoint(""CENTER"", 0, 200)
                WhatsGoingOnFrame:SetBackdropBorderColor(1, 0, 0, 0.8)
    
                WhatsGoingOnFrame:SetMovable(true)
                WhatsGoingOnFrame:EnableMouse(true)
                WhatsGoingOnFrame:SetScript(""OnMouseDown"",function() WhatsGoingOnFrame:StartMoving() end)
                WhatsGoingOnFrame:SetScript(""OnMouseUp"",function() WhatsGoingOnFrame:StopMovingOrSizing() end)
                
                WhatsGoingOnFrame.Close = CreateFrame(""BUTTON"", nil, WhatsGoingOnFrame, ""UIPanelCloseButton"")
                WhatsGoingOnFrame.Close:SetWidth(20)
                WhatsGoingOnFrame.Close:SetHeight(20)
                WhatsGoingOnFrame.Close:SetPoint(""TOPRIGHT"", WhatsGoingOnFrame, 3, 3)
                WhatsGoingOnFrame.Close:SetScript(""OnClick"", function()
                    WhatsGoingOnFrame:Hide()
                    DEFAULT_CHAT_FRAME:AddMessage(""WhatsGoingOn |cffC41F3Bclosed |cffFFFFFFWrite /WhatsGoingOn to enable again."") 	
                end)
                
                SLASH_WHATEVERYOURFRAMESARECALLED1=""/WhatsGoingOn""
    			SlashCmdList.WHATEVERYOURFRAMESARECALLED = function()
                    if WhatsGoingOnFrame:IsShown() then
                        WhatsGoingOnFrame:Hide()
                    else
                        WhatsGoingOnFrame:Show()
                    end
                end
            end");
        }
    
        public static string FormatLua(string str, params object[] names)
        {
            return string.Format(str, names.Select(s => s.ToString().Replace("'", "\\'").Replace("\"", "\\\"")).ToArray());
        }
    }

     

  4. This is what i used to handle taking proposal, 

      public static void AcceptProposalHandler(LuaEventsId id, List<string> args)
        {
            if (id == LuaEventsId.LFG_PROPOSAL_SHOW)
            {
                Lua.LuaDoString("AcceptProposal();");
            }
        }

    You are going to need a way to check if you are in the que or not.

    public static bool Qued(string GetLFGType)
        {
            return Lua.LuaDoString<bool>("local mode, submode = GetLFGMode(LE_LFG_CATEGORY_LFD); if mode == '" + GetLFGType + "' then return true; end");
        }

    we are both working on the same project, wanna work together on this? two brains better then one LOL Message me if your up for it.

×
×
  • Create New...