import json
import sys
from pathlib import Path

repo = Path.home() / 'TibiaPilotNG'
sys.path.insert(0, str(repo))

from src.utils.mouse import attackClick


result = {'ok': False}
try:
    attackClick((720, 370))
    result = {'ok': True, 'coordinate': [720, 370]}
finally:
    (repo / '.attack-nearby-result.json').write_text(
        json.dumps(result), encoding='utf-8',
    )
