peter-hunt/skyblock

Error with any gathering functions

Closed this issue · 3 comments

This error appears with any successfull gather resource functions, including get, gather, and mine!

get wheat 1 1

  • Wheat
    COLLECTION UNLOCKED Wheat
  • 4 Farming (4/50)
    Traceback (most recent call last):
    File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
    File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
    File "/home/wendellmeset/skyblock/skyblock/main.py", line 18, in
    skyblock_main()
    File "/home/wendellmeset/skyblock/skyblock/main.py", line 14, in skyblock_main
    main()
    File "/home/wendellmeset/skyblock/skyblock/function/util.py", line 35, in result
    return func(*args, **kwargs)
    File "/home/wendellmeset/skyblock/skyblock/menu.py", line 64, in main
    lastest_profile.mainloop()
    File "/home/wendellmeset/skyblock/skyblock/function/util.py", line 35, in result
    return func(*args, **kwargs)
    File "/home/wendellmeset/skyblock/skyblock/profile/function/main.py", line 467, in mainloop
    self.gather(name, tool_index, amount)
    File "/home/wendellmeset/skyblock/skyblock/function/util.py", line 35, in result
    return func(*args, **kwargs)
    File "/home/wendellmeset/skyblock/skyblock/profile/function/grind.py", line 279, in gather
    if random_bool((0.000_000_125) * (1 + magic_find / 100)):
    UnboundLocalError: local variable 'magic_find' referenced before assignment

Same
I may have found the problem i just have to fix it and then i will make a pull request

Sorry for the late reply, guys! I just fixed it by assigning the magic_find and magic_find_str variables at the beginning of the gather function so that they will work for all the gathering types! Please pull again soon and have fun! :)