Giter VIP home page Giter VIP logo

mypetbattle's People

Contributors

firazoid avatar joevt avatar pgnomeian avatar simonbogh avatar tropicdome avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mypetbattle's Issues

Automatically release duplicate low quality pet

There's an option for this already but it's not implemented yet. When it does get implemented, I think it should apply only when 3 of the pet is owned and the pet source is from pet battle. You don't want to delete pets that are obtained from drops or from professions or whatever.

enhancement: don't auto-dismiss pet if the summoned pet is not the same as the slot 1 pet

Allow the player to show off their pets by not auto dismissing the pet when the summoned pet is not the same as the slot 1 pet.

        -- Dismiss pet so we do not have it running around
        local petGUID = C_PetJournal.GetSummonedPetGUID()
        if petGUID and petGUID == C_PetJournal.GetPetLoadOutInfo(1) then -- Check if we have a pet summoned already, or we will get an error
            C_PetJournal.SummonPetByGUID(petGUID) -- Dismiss pet
        end

Save the hidden/shown state of the UI

There's a minimap button now to show and hide the UI. The current hidden/shown state should be part of the saved addon globals so that when the frame is created, it can be created with the last shown/hidden state. This global should be save per character instead of per account. This is useful when logging into alts that you don't intend to do pet battles with.

Join PvP

It still does not join pvp after the first battle for me (test with win trade on) not sure what im doing wrong, do i need to bind a key or something?

bug: Frame1_OnLoad doesn't exist

I get the error below. It appears to be a problem with Frame1.xml. Commenting out the call to Frame1_OnLoad seems to fix it.

Date: 2013-07-06 18:11:53
ID: 1
Error occured in: Global
Count: 1
Message: [string "Frame1:OnLoad"] line 5:
   attempt to call global 'Frame1_OnLoad' (a nil value)
Debug:
   [string "*:OnLoad"]:5:
      [string "*:OnLoad"]:1
Locals:
self = Frame1 {
 0 = <userdata>
 cancel = <function> defined @Interface\FrameXML\InterfaceOptionsFrame.lua:613
 name = "MPB Options Panel"
 refresh = <function> defined @Interface\FrameXML\InterfaceOptionsFrame.lua:615
 okay = <function> defined @Interface\AddOns\MyPetBattle\Frame1.lua:10
 default = <function> defined @Interface\FrameXML\InterfaceOptionsFrame.lua:614
}
(*temporary) = nil
(*temporary) = "attempt to call global 'Frame1_OnLoad' (a nil value)"

Make random teams more random

Currently, MyPetBattle creates teams by choosing pets alphabetically. I think the pets should be chosen randomly so that you get a new time every time you click the "Make random team" button.

Win trading sync

Sync is still a bit buggy. If you do not team up with the other toon, the sync will be ignored and accept the queue anyways, so you could potentially end up in a battle with someone else.

Keep pets dismissed

Whenever the first pet changes, it is summoned. I would rather not have any pets summoned while patrolling, etc. So when MyPetBattle creates a new team, it should also dismiss the first pet.

Don't summon pet if pet team is unchanged

Whenever I log in, a pet is summoned and then immediately dismissed. This can be cleaned up a bit. I think the same thing happens if you just click the "Make random team" button (since the team doesn't change randomly yet).

Before setting a pet, check if it's a different pet first:

    local petGUID = C_PetJournal.GetPetLoadOutInfo(1)
    if petID ~= petGUID then
        C_PetJournal.SetPetLoadOutInfo(1, petID) -- Pet slot 1
    end

However, this doesn't work since petGUID is nil at login for some reason. Maybe there's an event that will signal when the information is available? The simplest alternative is to not do anything if it's nil:

    print("|cFF4169E1 Setting team...!")

    local petGUID = C_PetJournal.GetPetLoadOutInfo(1)
    if not petGUID then
        print("|cFFADFF2F Not ready to set team!")
        return
    end

Then have the 1 second timer do the initial setteam call:

MPB_didsetteam = false

local function MPB_onUpdate(self,elapsed)
...
    if MPB_timerOneSec >= 1 then

        if not MPB_didsetteam then
            local desiredPetLevel = EditBox_PetLevel:GetText()  -- Get user input for desired pet level
            MyPetBattle.setTeam(desiredPetLevel)                -- Setup our team
            local petGUID = C_PetJournal.GetPetLoadOutInfo(1)
            if petGUID then
                MPB_didsetteam = true
            end
        end

Add support for leveling pets while win trading

If you want to level pets while win trading there are a couple problems.

i) If one player is set to win all the matches, then that player will eventually run out of pets that match the level selected in the UI.

ii) The players may have different levels of pets, different numbers of pets, different quality of pets.

Here are some features that might help with the above:

  1. Have an option to allow teams with non-rare pets. This will increase the selection of pets. Also, those non-rare pets will be upgradeable eventually by all the stones that will be won. The pet choices should prioritize rare pets over non-rare pets since a pet will loose a level when upgraded if it is higher than level 15. This option should probably only apply to win trading.

  2. Add an option to create matching teams between win trading players based on matching levels. The addon of each player communicates to the other player the quantity of each pet level. If the player is set to use non-rare pets then it should also communicate the same for each quality so that pet selection can be prioritized by quality. Quantity only needs to be a number between 0 and 4 - where 4 means they have more than 3 pets of that level). The addon for each player then takes that list, and selects the 3 lowest level pets that will match the list. Then the addon joins the queue. This option overrides the team level option or else the team level option can be used as a minimum level. The addon should also communicate if the player is set to forfeit. The forfeiting player can select non-rares since they will loose and not gain a level. The forfeiting player will select the lowest level team of any quality that matches the winning player's list of lowest level rare quality pets.

2b) Add an option that prioritizes creating matching teams starting from the highest level instead of the lowest level. Do higher level teams give more player XP?

2c) If you add 2b, then you need an option to start at level 24 if you're purpose is to level pets.

  1. Add an option to preserve a quantity (a number between 0 and 3 or maybe even higher) of pets for each level. This means the team level matching will not choose a pet of a level if the player does not have that number of pets at that level. This way, the player will retain a set of different level pets that can be used to level the pets of another player.

Ignore Pet's

function MyPetBattle.setTeam(avgLevel)

should ignore specific Pet ID's...I had a bug where I couln't call bought pets after a transfer...even worst, my wife has the moonkin - if you have it you'll get two pets, one per faction - if you're on the wrong faction MPB will get stuck

Maybe somthing like:

function MyPetBattle.isSpeciesIgnored(speciesID)
    ignoredSpeciesIDs = {}
    ignoredSpeciesIDs[296] = UnitFactionGroup("player") ~= "Alliance" -- Alliance Moonkin
    ignoredSpeciesIDs[298] = UnitFactionGroup("player") ~= "Horde" -- Horde Moonkin
    --ignoredSpeciesIDs[256] = true -- Blizzard Bug, can't call Lil' XT

    return ignoredSpeciesIDs[speciesID]
end

capture and swap pet

I noticed that when trying to capture a pet if the current pet is low health it doesn't swap it just keeps trying to capture that can cause the low pet to die trying to capture.

bug: C_PetJournal.GetPetLoadOutInfo returns nil at startup

I get the error below when I first login to WoW. It doesn't appear to happen when I do /reloadui.

The fix is to check petGUID for nil value after the call to C_PetJournal.GetPetLoadOutInfo in events:PET_JOURNAL_LIST_UPDATE.

Another issue is that events:PET_JOURNAL_LIST_UPDATE seems to be called once per second. That's not a big problem since once per second is not very frequent. If it can't be fixed and SetTexture or SetText takes any amount of time, then maybe cache petGUID for each slot and don't call SetTexture and SetText unless the petGUID changed.

local nilguidcount = 0
local petguids = {0,0,0}

function events:PET_JOURNAL_LIST_UPDATE(...)
    -- Set UI textures for current pet team when the UI is loaded -- IS NOT NEEDED ANYMORE SINCE setTeam() IS CALLED ABOVE, AND THAT FUNCTION SETS THE TEXTURES
    -- MIGHT BE NEEDED ANYWAY, IF AUTO NEW TEAM IS ACTIVE, THEN THE TEXTURE WILL NOT BE LOADED ON LOGIN
    for i_ = 1, 3 do
        local petGUID = C_PetJournal.GetPetLoadOutInfo(i_)
        if not petGUID then
            nilguidcount = nilguidcount + 1
            print("nilguidcount", nilguidcount)
        else
            if petguids[i_] ~= petGUID then
                print("petGUID", petGUID)
                petguids[i_] = petGUID
                local speciesID, customName, level, xp, maxXp, displayID, isFavorite, name, icon, petType, creatureID, sourceText, description, isWild, canBattle, tradable, unique, obtainable = C_PetJournal.GetPetInfoByPetID(petGUID) 

                -- Set pet 1 UI texture
                if i_ == 1 then 
                    Pet1_texture:SetTexture(icon) 
                    Pet1_level_string:SetText(level)
                end
                -- Set pet 2 UI texture
                if i_ == 2 then 
                    Pet2_texture:SetTexture(icon) 
                    Pet2_level_string:SetText(level)
                end
                -- Set pet 3 UI texture
                if i_ == 3 then 
                    Pet3_texture:SetTexture(icon) 
                    Pet3_level_string:SetText(level)
                end
            end
        end
    end
end
Date: 2013-07-06 21:53:08
ID: 2
Error occured in: Global
Count: 1
Message: ..\AddOns\MyPetBattle\MyPetBattle.lua line 380:
   Usage: GetPetInfoByID(ID)
Debug:
   [C]: GetPetInfoByPetID()
   MyPetBattle\MyPetBattle.lua:380: ?()
   MyPetBattle\MyPetBattle.lua:578:
      MyPetBattle\MyPetBattle.lua:577
Locals:
(*temporary) = nil

Add basic statistics

Add basic statistics (daily or per session)

  • Pets caught: common, uncommon, rare, type etc.
  • Pets fought
  • Loot received
  • PvP win/loose, streak
  • XP from WT and other battles

Don't set pet to unknown pet type

During combat, I get a message "Unknown critter pet" and nothing happens.

Either the pet should not have been chosen, or attempt to create a spell table programmatically that the unknown pet can use.

Maybe add a checkbox for each case:

  1. "Don't choose unknown pet types"
  2. "Create spell table for unknown pet types" or "Automate unknown pet types" or "Battle using unknown pet types".

If creating the spell table programmatically, maybe try parsing the spell text and use the cool-down information for ordering the spells. Maybe there's a way to tell if the spell is a buff.

Add a minimap button to show/hide the ui

Currently, there is a slash command to show/hide the UI.
/mypetbattle ui

This really isn't much better than
/run MyPetBattleForm:Hide()

(except for being slightly easier to type).

Instead there should be a MiniMap button you can just click on to show/hide/edit config. The UI should also have a close box. The config can have an option to show/hide the MiniMap button.

Automatically capture new pet

There's an option to automatically capture rare pets. I think there should be an option to automatically capture a pet that is not owned yet.

global variables initialized to nil

If the user is using MyPetBattle for the first time, and doesn't change the settings, then the following account variables are stored:

MPB_CONFIG_TEAMSETUP_RANDOM_TEAM_PET_HEALTH_THRESHOLD = nil
MPB_CONFIG_TEAMSETUP_PET1_LEVEL_ADJUSTMENT = nil
MPB_CONFIG_TEAMSETUP_PET2_LEVEL_ADJUSTMENT = nil
MPB_CONFIG_TEAMSETUP_PET3_LEVEL_ADJUSTMENT = nil
MPB_CONFIG_PRE_COMBAT_ATTEMPT_STRONGEST_RANDOM_TEAM = nil
MPB_CONFIG_COMBAT_SWAP_PET_HEALTH_THRESHOLD = nil
MPB_CONFIG_POST_COMBAT_USE_REVIVE_BATTLE_PETS_AFTER_COMBAT = nil
MPB_CONFIG_POST_COMBAT_USE_BATTLE_PET_BANDAGE_AFTER_COMBAT = nil
MPB_CONFIG_POST_COMBAT_AUTOMATIC_NEW_RANDOM_TEAM_AFTER_COMBAT = nil
MPB_CONFIG_MISC_AUTOMATIC_RELEASE_NON_RARES = nil
MPB_EDITBOX_DESIRED_PET_LEVEL = nil
MPB_LOCK_PET1 = nil
MPB_LOCK_PET2 = nil
MPB_LOCK_PET3 = nil
MPB_MMBUTTONPOSITION = nil

These will cause nil errors in some parts of the code since all the values are nil.

Message: ..\AddOns\MyPetBattle\MyPetBattle_data.lua line 272:
   attempt to compare nil with number
Debug:
   MyPetBattle\MyPetBattle_data.lua:272: setTeam()
   MyPetBattle\Frame.lua:24: Button_MakeRandomTeam_OnClick()
   [string "*:OnClick"]:1:
      [string "*:OnClick"]:1

Also, these values cause the UI to appear at login, even if the MPB_SHOW_UI variable is false. In fact, the MyPetBattle mini-map button needs to be clicked twice in this case to hide the UI.

You can test this by deleting the /World of Warcraft/WTF/Account/ACCOUNTNAME/SavedVariables/MyPetBattle.lua file before running WoW. Then immediately log out after logging into a character.

The workaround is to view the MyPetBattle settings in Interface -> Addons -> MPB Options Panel (please remove the word "Panel" from the name) or by clicking the cog icon in the MyPetBattle UI twice.

Note: the cog icon in the MyPetBattle UI is invisible when the variables are first initialized. It remains invisible until the variables are set properly and the user relogs.

The code should probably check the variables at login and set them to default values if they are currently nil.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.