My_master rescript for Mangos menu

User Tag List

Results 1 to 1 of 1
  1. #1
    DoxramosPS's Avatar Knight
    Reputation
    26
    Join Date
    Aug 2010
    Posts
    214
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    My_master rescript for Mangos

    My_master is an addon for the ascent core ticket system. I have rewritten it for use with Mangos Zero (1.12.1) and I have one problem left; in here I am going to post the LUA for the ticket system along with a photo that describes the error I am having. Thank you to any that can help.


    Code:
    ticket_name = {};
    ticket_level = {};
    ticket_type = {};
    ticket_zone = {};
    tickets = 0;
    Mytgt = "";
    
    
    Ticket_Category = {};
    Ticket_Category[1] = "Stuck";
    Ticket_Category[2] = "Harassment";
    Ticket_Category[3] = "Guild";
    Ticket_Category[4] = "Item";
    Ticket_Category[5] = "Environmental";
    Ticket_Category[6] = "Creep";
    Ticket_Category[7] = "Quest";
    Ticket_Category[8] = "Technical";
    Ticket_Category[9] = "Account";
    Ticket_Category[10] = "Character";
    
    
    function My_TicketFrame_OnLoad()    
        this:RegisterEvent("CHAT_MSG_CHANNEL");
        this:RegisterEvent("VARIABLES_LOADED");
        My_TicketFrame:RegisterForDrag("LeftButton");
       
        my_Commands_Init();
        My_Print("My_TicketFrame (Modified by Dalar; Email Bugs to [email protected]) loaded!", 0.1, 1.0, 0.1);
        if(not My_MasterOptions) then
             My_MasterOptions = {
      			My_MasterAlphaMaster = 1.0,
        		My_MasterAlphaInfo = 1.0,
        		My_MasterButtonPosition = 290,
        		My_MasterButtonPosition2 = 290,
        		My_MasterButtonShown = true,
        		My_MasterShowAll = false,
        		My_MasterPage = 0,
        		My_MasterGMMode = false,
        		My_MasterScale = 1,
        		My_MasterFly = false,
        		My_MasterSpeed = 8
        		};
    		end
    
        
        SendChatMessage(".ticket 1", "SAY");
    end
    
    function My_TicketFrame_OnEvent()
        local message = arg1;
        local data = {};
    
        if(event == "VARIABLES_LOADED") then
           My_MasterOptions.My_MasterButtonShown = true;
           My_MasterOptions.My_MasterShowAll = false;
           My_MasterOptions.My_MasterGMMode = false;
           My_MasterOptions.My_MasterPage = 0;
           My_MasterOptions.My_MasterScale = 1;
           My_MasterOptions.My_MasterFly = false;
           My_MasterOptions.My_MasterSpeed = 8;
           My_MasterOptions.My_MasterButtonPosition2 = 290;
           --SendChatMessage("/join gm_sync_channel", "SAY");
    
        end
        
        if(event == "CHAT_MSG_CHANNEL" and gm_sync_channel and arg9 and strlower(arg9) == strlower(SAY)) then
            data = My_Master_ParseMessage(message);
            if(data[0] == "0") then -- Event: Add Line
                My_TicketFrame_GenerateLine(data);
            end
            if(data[0] == "1") then -- Event: Rem Line
                My_TicketFrame_ClearLine(data[1]);
            end
            if(data[0] == "2") then -- Event: Rem all Lines
                My_TicketFrame_ClearFrame(1);
            end
            if(data[0] == "3") then -- Event: show Message Frame
                My_TicketFrame_ShowTicket(message);
            end
            if(data[0] == "4") then -- Event: append Message Frame's Message
                My_TicketFrame_AppendTicket(message)
            end
            if(data[0] == "5") then -- Event: new Message Frame's Message
                My_TicketFrame_NewTicket(message)
            end
        end
    end
    
    function My_TicketFrame_Update()
        My_TicketFrame_ClearFrame(0);
        if(tickets - My_MasterOptions.My_MasterPage*15 >= 15) then
        countto = 15;
        else
        countto = mod(tickets,15);
        end
            
        for i = 1, countto, 1 do
            getglobal("My_TicketFrameTicket"..i.."Name"):SetText(ticket_name[My_MasterOptions.My_MasterPage*15+i]);
            getglobal("My_TicketFrameTicket"..i.."Level"):SetText(ticket_level[My_MasterOptions.My_MasterPage*15+i]);
            getglobal("My_TicketFrameTicket"..i.."Type"):SetText(Ticket_Category[tonumber(ticket_type[My_MasterOptions.My_MasterPage*15+i])]);
            getglobal("My_TicketFrameTicket"..i.."Zone"):SetText(ticket_zone[My_MasterOptions.My_MasterPage*15+i]);
            getglobal("My_TicketFrameTicket"..i.."Message"):Show();
            getglobal("My_TicketFrameTicket"..i.."Delete"):Show();
        end
    end
    
    function My_TicketFrame_ToggleFrame()
        PlaySoundFile("Interface\\AddOns\\My_Master\\Sounds\\click.wav")
        if(My_TicketFrame:IsVisible()) then
            My_TicketFrame:Hide();
        else
            SendChatMessage(".ticket 1", "SAY");
            My_TicketFrame:Show();
        end
    end
    
    function My_TicketFrame_GetTickets()
        -- get Master Tickets
        JoinChannelByName("gm_sync_channel")
        PlaySoundFile("Interface\\AddOns\\My_Master\\Sounds\\click.wav")
        SendChatMessage(".ticket", "SAY", nil, GetChannelName(SAY));
    end
    
    function My_TicketFrame_GenerateLine(data)
        if(My_MasterOptions.My_MasterShowAll) then
         tickets = tickets + 1;
         ticket_name[tickets] = data[1];
         ticket_level[tickets] = data[2];
         ticket_type[tickets] = data[3];
         ticket_zone[tickets] = data[4];
        else
         if(data[4] ~= "0") then
          tickets = tickets + 1;
        
          ticket_name[tickets] = data[1];
          ticket_level[tickets] = data[2];
          ticket_type[tickets] = data[3];
          ticket_zone[tickets] = data[4];
         end
        end
       --My_TicketFrame_Update();
    end
    
    function My_TicketFrame_ClearLine(name)
        for i = 1, tickets, 1 do
            if(ticket_name[i] == name) then
                for j = i, tickets, 1 do
                    ticket_name[j] = ticket_name[j+1];
                    ticket_level[j] = ticket_level[j+1];
                    ticket_type[j] = ticket_type[j+1];
                    ticket_zone[j] = ticket_zone[j+1];
                end
            end
        end
        tickets = tickets - 1;
        
       SendChatMessage(".ticket", "SAY");--added
        My_TicketFrame_Update();
    end
    
    function My_TicketFrame_ClearFrame(del)
        if(del == 1) then
            tickets = 0;
        end
        for i = 1, 15, 1 do
            getglobal("My_TicketFrameTicket"..i.."Name"):SetText("");
            getglobal("My_TicketFrameTicket"..i.."Level"):SetText("");
            getglobal("My_TicketFrameTicket"..i.."Type"):SetText("");
            getglobal("My_TicketFrameTicket"..i.."Zone"):SetText("");
            getglobal("My_TicketFrameTicket"..i.."Message"):Hide();
            getglobal("My_TicketFrameTicket"..i.."Delete"):Hide();
        end
    end
    
    function My_TicketFrame_GetTicketByName(name)
        PlaySoundFile("Interface\\AddOns\\My_Master\\Sounds\\click.wav")
        SendChatMessage(".gmTicket getId "..name, "SAY", nil, GetChannelName(SAY));
    end
    
    function My_TicketFrame_DeleteTicketByName(name)
        PlaySoundFile("Interface\\AddOns\\My_Master\\Sounds\\trash.wav")
        SendChatMessage(".gmTicket delId "..name, "SAY", nil, GetChannelName(SAY));
    end
    
    function My_TicketFrame_GoTicketByName(name)
    	SendChatMessage(".namego "..name, "SAY");
    end
    
    function My_TicketFrame_SummonTicketByName(name)
    	SendChatMessage(".goname "..name, "SAY");
    end
    
    function My_TicketFrame_ReviveTicketByName(name)
       SendChatMessage(".reviveplr "..name, "SAY");
    end
    
    function My_TicketFrame_AllowTicketByName(name)
       SendChatMessage(".allowwhispers "..name, "SAY");
    end
    
    function My_TicketFrame_ShowTicket(message)
        -- show frame with information in it
        local data = {};
        data = My_Master_ParseMessage(message);
        
        Mytgt = data[1];
        My_TicketFrameTicketHead1:SetText("Detailed Ticket Information");
        My_TicketFrameTicketName:SetText("Ticket From: "..data[1]);
        message = strsub(message, string.len(data[0]) + string.len(data[1]) + 12, string.len(message));
        My_TicketFrameTicketMessage:SetText(message);
        My_TicketFrameInfoFrame:Show();
    end
    
    function My_TicketFrame_AppendTicket(message)
        local data = {};
        data = My_Master_ParseMessage(message);
        message = strsub(message, string.len(data[0])+1, string.len(message));
        My_TicketTicketMessage:SetText(My_TicketTicketMessage:GetText()..message);
    end
    
    function My_TicketFrame_NewTicket(message)
        local data = {};
        PlaySoundFile("Interface\\AddOns\\My_Master\\Sounds\\incomming.wav")
    end
    
    function My_TicketFrame_PrevPage()
    My_TicketFrame_ClearFrame(0);
    if(My_MasterOptions.My_MasterPage ~= 0) then
    My_MasterOptions.My_MasterPage = My_MasterOptions.My_MasterPage - 1;
    end
    My_TicketFrame_Update();
    end
    
    function My_TicketFrame_NextPage()
    My_TicketFrame_ClearFrame(0);
    if(tickets/15 > My_MasterOptions.My_MasterPage + 1) then
    My_MasterOptions.My_MasterPage = My_MasterOptions.My_MasterPage + 1;
    end
    My_TicketFrame_Update();
    end


    My_master rescript for Mangos

Similar Threads

  1. Ram Eating Fix For Mangos
    By ironman2173 in forum WoW EMU Guides & Tutorials
    Replies: 2
    Last Post: 12-19-2007, 10:18 PM
  2. [Share] Rulebook for Mangos (ingame item added when players start!)
    By latruwski in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 12-03-2007, 01:33 PM
  3. List of Repacks, Compiles and Databases for ManGOS, Ascent, Antrix.
    By faxmunky in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 11-04-2007, 04:02 AM
  4. .map files are only needed for ManGOS
    By faxmunky in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 11-04-2007, 03:35 AM
  5. Looking for T5-T7 vendors / cool custom items for MaNgOs server 2.1.3 (Help posts?)
    By phc_chaos in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 09-28-2007, 08:57 PM
All times are GMT -5. The time now is 06:53 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search