auto-maple
auto-maple copied to clipboard
An exception when starting
I am trying to write command_books for new character, but I encounter the following exception I doubt there is sth wrong with layout file, since my command_books has no related layout file, as a result, value "config.layout" is None So how to generate layout file or another way to avoid this ?
Exception in thread Thread-5 (_main): Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\threading.py", line 1016, in _bootstrap_inner self.run() File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "E:\auto-maple-2.3.4\src\modules\bot.py", line 100, in _main element.execute() File "E:\auto-maple-2.3.4\src\common\utils.py", line 21, in helper return function(*args, **kwargs) File "E:\auto-maple-2.3.4\src\routine\components.py", line 32, in execute self.main() File "E:\auto-maple-2.3.4\src\routine\components.py", line 82, in main move(*self.location).execute() File "E:\auto-maple-2.3.4\src\common\utils.py", line 21, in helper return function(*args, **kwargs) File "E:\auto-maple-2.3.4\src\routine\components.py", line 32, in execute self.main() File "E:\auto-maple-2.3.4\src\routine\components.py", line 246, in main path = config.layout.shortest_path(config.player_pos, self.target) AttributeError: 'NoneType' object has no attribute 'shortest_path'
I encountered that too so this may help someone else. What I did was save the routine to a file and then loaded that routine again before starting the bot.
That makes the bot to get to this lines of code:
Which initializing config.layout.