aquietone / aqobot

EverQuest class automation Lua scripts for MacroQuest.
https://aquietone.github.io/docs/aqobot/
MIT License
13 stars 6 forks source link

Bug: Mag slash command pettype returns [AQOBot] Unsupported command line option: PETTYPE earth #3

Closed towbes closed 8 months ago

towbes commented 8 months ago

Using /aqo pettype earth (or any element) gives error:

[AQOBot] Unsupported command line option: PETTYPE earth

Tried using the pettypes listed in

Magician.PetTypes = {Water='waterpet',Earth='earthpet',Air='airpet',Fire='firepet',Monster='monsterpet'}

The ini file sets the value as string:

    ['PETTYPE'] = 'Earth',

It looks like the error message is hitting the final else statement in:

function commands.classSettingsHandler(opt, new_value)
    if new_value then
        else
            logger.info('Unsupported command line option: %s %s', opt, new_value)
        end

Is there supposed to be a string handler in there? Looks like there might just be boolean and number at the moment:


            if constants.booleans[new_value] == nil then return end
            class:set(opt, constants.booleans[new_value])
            logger.info('Setting %s to: %s', opt, constants.booleans[new_value])
        elseif type(class:get(opt)) == 'number' then
            if tonumber(new_value) then
                logger.info('Setting %s to: %s', opt, tonumber(new_value))
                class:set(opt, tonumber(new_value))
            end
        else```
towbes commented 8 months ago

Confirmed the slash command works. Just document that any chars which had a profile already saved with upper case (Earth, Water, Fire, Air) , they need to set the pet to the new values to function correctly. So just issue the /aqo pettype command using the desired value and works as expected!