Skip to content

Comments

fix for #2104#2136

Closed
bigkraig wants to merge 1 commit intoPokemonGoF:devfrom
bigkraig:dev
Closed

fix for #2104#2136
bigkraig wants to merge 1 commit intoPokemonGoF:devfrom
bigkraig:dev

Conversation

@bigkraig
Copy link
Contributor

Short Description:
Fix TypeError

Traceback (most recent call last):
File "pokecli.py", line 494, in 
main()
File "pokecli.py", line 70, in main
bot.tick()
File "/Users/toremielck/Desktop/PokemonGo-Bot-kajoschooPTC/pokemongo_bot/init.py", line 85, in tick
if worker.work() == WorkerResult.RUNNING:
File "/Users/toremielck/Desktop/PokemonGo-Bot-kajoschooPTC/pokemongo_bot/cell_workers/handle_soft_ban.py", line 31, in work
MoveToFort(self.bot).work()
TypeError: init() takes exactly 3 arguments (2 given)

Fixes:

  • Worker needs the config param


if fort_distance > Constants.MAX_DISTANCE_FORT_IS_REACHABLE:
MoveToFort(self.bot).work()
MoveToFort(self.bot, self.config).work()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If MoveToFort takes configuration, this will cause problems since it won't be getting the correct config values. self.config is specific to the task. This is why tasks shouldn't be calling other tasks.

@douglascamata Any ideas on a fix?

Copy link
Member

@douglascamata douglascamata Jul 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the config here needs to have the same structure of the config hash in JSON and SoftBan.config clearly won't have this structure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I'm not sure how we fix this though. HandleSoftBan doesn't (and shouldn't) know what the config is for MoveToFort. Is there any way we can refactor HandleSoftBan to not require anything about MoveToFort? Or do we just say screw it create the config that MoveToFort wants (ignoring however the user might have configured that task) and use it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HandleSoftBan will decide how it wants to move to the fort.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See Issue: #1522

I just replaced (self.bot, self.config) with (self, self.bot).

@elicwhite
Copy link
Contributor

This has been fixed via another PR.

@elicwhite elicwhite closed this Aug 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants