lotrointerface.com
Search Downloads

LoTROInterface SVN BusyBee1.3.9

[/] [trunk/] [BoskoPlugins/] [BusyBee/] [Main.lua] - Rev 49

Compare with Previous | Blame | View Log

--
-- Busy Bee Tasks plugin for Lord of The Rings Online
--
-- by Bosko
-- Patches:
-- Gardori
-- zonk
-- Elsinir
--
-- http://www.lotrointerface.com/downloads/fileinfo.php?id=733
--

import "Turbine"
import "Turbine.Gameplay"
import "BoskoPlugins.BusyBee.BusyBeeWindow";

BusyBeeWindow = BusyBeeWindow();

--==============================================================================
-- BusyBeeCommand
--==============================================================================
BusyBeeCommand = Turbine.ShellCommand();

--------------------------------------------------------------------------------
function BusyBeeCommand:GetHelp()
    return "Busy Bee Tasks by Bosko (patch by Elsinir). " .. 
                "Usage: \n" ..
                "  /bzb help: Show this help\n" ..
                "  /bzb show/hide/toggle: Change visibility\n" ..
                "  /bzb initialVisibility [true/false]: set initial visibility after load\n" ..
                "  /bzb opacity [number from 1-100] Set text opacity (100 = always visible)\n" ..
                "  /bzb sort: Move all the task items to the bottom of the bags\n" ..
                "  /bzb junk: List trophies with no tasks or no rep tasks\n" ..
                "  /bzb monster: List pvp items to turn in for pvp rep\n" ..
                "  /bzb options: show option settings";
end

--------------------------------------------------------------------------------
function BusyBeeCommand:GetShortHelp()
    return "Manage Busy Bee window. Commands: help, show, hide, toggle, refresh, opacity <number>, sort, junk, monster, options";
end

--------------------------------------------------------------------------------
function BusyBeeCommand:Execute(command, arguments)
    if (command == "bzb" or command == "busybee") then
        if (arguments == nil or arguments == "") then
            Turbine.Shell.WriteLine("Missing bzb command\n");
            Turbine.Shell.WriteLine(BusyBeeCommand:GetHelp());
        elseif (arguments == "help") then
            -- Help
            Turbine.Shell.WriteLine(BusyBeeCommand:GetHelp());
        elseif (arguments == "toggle") then
            -- Toggle
            BusyBeeWindow:SetVisible(not BusyBeeWindow:IsVisible());
        elseif (arguments == "hide") then       
            -- Hide
            BusyBeeWindow:SetVisible(false);
        elseif (arguments == "show") then
            -- Toggle visibility
            BusyBeeWindow:SetVisible(true);
        elseif (arguments == "refresh") then
            -- Refresh
            BusyBeeWindow:Refresh();
        elseif (arguments == "sort") then
            BusyBeeWindow:Sort();
        elseif (arguments == "junk") then
            BusyBeeWindow:PrintJunkItems();
        elseif (arguments == "monster") then
            BusyBeeWindow:PrintMonsterItems();
        elseif (arguments == "options") then
                        -- show option settings
                        Turbine.Shell.WriteLine(BusyBeeWindow:GetSettings());
        elseif (string.match(arguments,"^initialVisibility") ) then
                        local param = string.match(arguments,"^initialVisibility (%w+)");
                        if( param == "true") then
                                BusyBeeWindow:SetInitialVisibility(true);
                BusyBeeWindow:SaveSettings();
                        elseif( param == "false") then
                                BusyBeeWindow:SetInitialVisibility(false);
                BusyBeeWindow:SaveSettings();
                        else
                                Turbine.Shell.WriteLine("initialVisability must be 'true' or 'false'\n");
                        end
        elseif (string.match(arguments,"^debug") ) then
                        local param = string.match(arguments,"^debug (%w+)");
                        if( param == "true") then
                                BusyBeeWindow:SetDebug(true);
                BusyBeeWindow:SaveSettings();
                        elseif( param == "false") then
                                BusyBeeWindow:SetDebug(false);
                BusyBeeWindow:SaveSettings();
                        else
                                Turbine.Shell.WriteLine("debug must be 'true' or 'false'\n");
                        end
        elseif (string.match(arguments,"^opacity") ) then
            -- Set opacity if number
                        local opacity = string.match(arguments,"^opacity (%d+)");
            opacity = tonumber(opacity);
            if ( (opacity ~= nil) and (opacity > 0) and (opacity <= 100)) then
                BusyBeeWindow:SetPassiveOpacity(opacity/100);
                BusyBeeWindow:SaveSettings();
                        else
                                Turbine.Shell.WriteLine("opacity must be a valid number from 0 to 100\n");
            end
                else
            Turbine.Shell.WriteLine("Unsupported bzb command\n");
            Turbine.Shell.WriteLine(BusyBeeCommand:GetHelp());
        end
    end
end

--------------------------------------------------------------------------------
-- Add the command
Turbine.Shell.AddCommand("bzb;busybee", BusyBeeCommand);

Compare with Previous | Blame


All times are GMT -5. The time now is 11:41 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui