DC23 / scriptabit

Python scripting for Habitica
Apache License 2.0
8 stars 4 forks source link

Spell Ethereal Surge doesn't work for mages #45

Closed therealmaxmoon closed 6 years ago

therealmaxmoon commented 7 years ago

Regarding to the Habitica API the parameter name of Ethereal Surge is mpHeal: https://habitica.com/apidoc/#api-User-UserCast

But this command don't trigger anything and there is no error message: scriptabit -r spellcast --cast mpHeal

I've tested Earthquake and it works: scriptabit -r spellcast --cast earth

DC23 commented 7 years ago

Hmm. In the scriptabit source, I have the code for that spell as mpHeal: https://github.com/DC23/scriptabit/blob/master/scriptabit/habitica_service.py#L56

I will need to make a mage test character to sort this out.

Do you have the logging level set to DEBUG? Check in .config/scriptabit/scriptabit_logging.cfg Although errors should be logged to a higher level.

therealmaxmoon commented 7 years ago

The logging level was set to DEBUG. But how to log errors on a higher level? The file scriptabit.log, which will be every time created I use scriptabit, is always empty.

therealmaxmoon commented 7 years ago

I found a solution!

It is not mpHeal, it's mpheal.

I'll report it to the "report a bug" guild.

DC23 commented 6 years ago

Doing a bit of coding on this project at last. This does not appear to be an issue anymore. The API accepts both mpHeal and mpheal.

therealmaxmoon commented 6 years ago

I am a Mage again and I've updated scriptabit to 2.1.1 and I can't cast Etherial Surge with mpheal or with mpHeal.

scriptabit -r spellcast --cast mpheal
scriptabit version 2.1.1
verbose mode: False
Loading credentials from /home/maxmoon/.auth.cfg
Habitica API at 'https://habitica.com/api/v3/' is up
** spellcast running

usage: scriptabit [-sud] [--verbose] [-hp SET_HP] [--inc-hp INC_HP]
                  [--scale-hp SCALE_HP] [-mp SET_MP] [--inc-mp INC_MP]
                  [--scale-mp SCALE_MP] [-xp SET_XP] [--inc-xp INC_XP]
                  [--scale-xp SCALE_XP] [-gp SET_GP] [--inc-gp INC_GP]
                  [--scale-gp SCALE_GP] [-level SET_LEVEL]
                  [--inc-level INC_LEVEL] [--scale-level SCALE_LEVEL]
                  [--buy-armoire] [-t]
                  [--use-notification-panel {yes,no,true,false,1,0}]
                  [--tags TAGS] [--target TARGET]
                  [--cast-skill {fireball,mpHeal,earth,frost,smash,defensiveStance,valorousPresence,intimidate,pickPocket,backStab,toolsOfTrade,stealth,heal,protectAura,brightness,healAll}]
                  [--preserve-user-hp] [-lc FILE] [-as AUTH_SECTION]
                  [-url HABITICA_API_URL] [-r RUN] [-ls] [-v] [-dr]
                  [-n MAX_UPDATES] [-uf UPDATE_FREQUENCY] [-h]
scriptabit: error: argument --cast-skill: invalid choice: 'mpheal' (choose from 'fireball', 'mpHeal', 'earth', 'frost', 'smash', 'defensiveStance', 'valorousPresence', 'intimidate', 'pickPocket', 'backStab', 'toolsOfTrade', 'stealth', 'heal', 'protectAura', 'brightness', 'healAll')
scriptabit -r spellcast --cast mpHeal                                                                                                                                 2 ↵
scriptabit version 2.1.1
verbose mode: False
Loading credentials from /home/maxmoon/.auth.cfg
Habitica API at 'https://habitica.com/api/v3/' is up
** spellcast running

spellcast update 0 @ Wed Jun  6 09:29:25 2018
Casting up to 1 of mpHeal

** spellcast done
Exiting

If I write a small 'h' in mpheal, it gives me an error and it says I should use a capital 'H'. If I write a capital 'H' it just don't give me an error. It looks normal, but there is no message in the party chat and the Mana stays the same.

therealmaxmoon commented 6 years ago

I've created a pull request, which I've tested and works: https://github.com/DC23/scriptabit/pull/49

DC23 commented 6 years ago

Thanks. You are correct. The current API docs show that mpheal is all lower case. I am sure it was camel-case when I first implemented this. I will bump the patch version and do a new release today.