lunarush-bot icon indicating copy to clipboard operation
lunarush-bot copied to clipboard

Impossible to use the bot with Linux

Open fralk opened this issue 2 years ago • 12 comments

Hello, thanks for the bot. I was trying to use it in a Linux VPS. Unfortunatelly when run index.py it tells me that: PyGetWindow currently does not support Linux.

Is there any way to use it with Ubuntu 20.04?

fralk avatar Mar 13 '22 18:03 fralk

Hello, thanks for the bot. I was trying to use it in a Linux VPS. Unfortunatelly when run index.py it tells me that: PyGetWindow currently does not support Linux.

Is there any way to use it with Ubuntu 20.04?

It's because of the multi account (dont work on linux). I'll create a non multi account version to fix this.

Until then, you can try this verison: https://github.com/walterdis/lunarush-bot/archive/refs/tags/v1.1.0.zip

walterdis avatar Mar 13 '22 18:03 walterdis

Hello, thanks for the bot. I was trying to use it in a Linux VPS. Unfortunatelly when run index.py it tells me that: PyGetWindow currently does not support Linux. Is there any way to use it with Ubuntu 20.04?

Until then, you can try this verison: https://github.com/walterdis/lunarush-bot/archive/refs/tags/v1.1.0.zip

Thank you very much it worked! I've just modified in heroselect.py the sleep parameter from 7000 to 750. Is there any reason to check the energy once every 2 hours in the old version?

fralk avatar Mar 13 '22 19:03 fralk

Hello, thanks for the bot. I was trying to use it in a Linux VPS. Unfortunatelly when run index.py it tells me that: PyGetWindow currently does not support Linux. Is there any way to use it with Ubuntu 20.04?

Until then, you can try this verison: https://github.com/walterdis/lunarush-bot/archive/refs/tags/v1.1.0.zip

Thank you very much it worked! I've just modified in heroselect.py the sleep parameter from 7000 to 750. Is there any reason to check the energy once every 2 hours in the old version?

I check every 2 hours just to make sure there are heroes with energy ;)

This version 1.1.0 has some bugs. I'll try to send the non-multi account tomorrow ;)

walterdis avatar Mar 13 '22 19:03 walterdis

Encontrei seu bot por acaso e também estava tentando usar no Linux, mas sem sucesso, estava dando este mesmo erro. Cara não sei se você conhece esse bot do bomb, https://github.com/renatofmmaia/bomb-bot, ele é pra multi account tanto windows como linux e o que me chamou atenção é que no código deles tem o PyGetWindow e o bot tá funcionando show de bola.... Criei essa conta no Github somente pra tentar perguntar como o cara fez. Agora aproveito pra agradecer o trabalho que fez, porque não é todo mundo que está conseguindo fazer um bot funcional do Luna.

Monjollo avatar Mar 14 '22 00:03 Monjollo

Encontrei seu bot por acaso e também estava tentando usar no Linux, mas sem sucesso, estava dando este mesmo erro. Cara não sei se você conhece esse bot do bomb, https://github.com/renatofmmaia/bomb-bot, ele é pra multi account tanto windows como linux e o que me chamou atenção é que no código deles tem o PyGetWindow e o bot tá funcionando show de bola.... Criei essa conta no Github somente pra tentar perguntar como o cara fez. Agora aproveito pra agradecer o trabalho que fez, porque não é todo mundo que está conseguindo fazer um bot funcional do Luna.

Opa cara.

Então, primeiro quero ver se faço a versão sem multi account para poder ser usado normalmente no linux novamente. Depois vou dar uma olhada com mais calma no código desse repositório que você me enviou e ver se a solução dele é simples de implementar ;)

Enquanto isso, podes usar o link que mostrei acima com uma versão anterior a essa. Ela tem alguns pequenos bugs mas da para quebrar um galho até eu fazer o novo envio.

E agradeço o elogio. Eu meio que aprendi Python de última hora pq não conseguia achar nenhum bot funcional também :grin:

walterdis avatar Mar 14 '22 01:03 walterdis

@fralk I've sent a new update to prevent multi account in linux.

@Monjollo Acabei de enviar uma atualização para fazer rodar sem multi account caso o sistema operacional seja linux. Consegue testar se possível? (estou sem VM de linux aqui no momento)

walterdis avatar Mar 14 '22 11:03 walterdis

@fralk I've sent a new update to prevent multi account in linux.

@Monjollo Acabei de enviar uma atualização para fazer rodar sem multi account caso o sistema operacional seja linux. Consegue testar se possível? (estou sem VM de linux aqui no momento)

Hi, unfortunatelly it raise a NotImplementedError about PyGetWindow so the bot don't even start on Ubuntu

$ python3 index.py
Traceback (most recent call last):
  File "index.py", line 10, in <module>
    import pygetwindow
  File "/home/ubuntu/.local/lib/python3.8/site-packages/pygetwindow/__init__.py", line 347, in <module>
    raise NotImplementedError(
NotImplementedError: PyGetWindow currently does not support Linux. If you have Xlib knowledge, please contribute! https://github.com/asweigart/pygetwindow

about pygetwindow error according to this https://github.com/mpcabete/bombcrypto-bot/issues/656 it could be replaced by xdotool Obrigado pela ajuda

fralk avatar Mar 14 '22 13:03 fralk

ar

@fralk I've sent a new update to prevent multi account in linux. @Monjollo Acabei de enviar uma atualização para fazer rodar sem multi account caso o sistema operacional seja linux. Consegue testar se possível? (estou sem VM de linux aqui no momento)

Hi, unfortunatelly it raise a NotImplementedError about PyGetWindow so the bot don't even start on Ubuntu

$ python3 index.py
Traceback (most recent call last):
  File "index.py", line 10, in <module>
    import pygetwindow
  File "/home/ubuntu/.local/lib/python3.8/site-packages/pygetwindow/__init__.py", line 347, in <module>
    raise NotImplementedError(
NotImplementedError: PyGetWindow currently does not support Linux. If you have Xlib knowledge, please contribute! https://github.com/asweigart/pygetwindow

about pygetwindow error according to this mpcabete/bombcrypto-bot#656 it could be replaced by xdotool Obrigado pela ajuda

In the index.py file, as a workaround on line number 9 or 10, try to replace import pygetwindow with:

try:
    import pygetwindow
except ImportError or ModuleNotFoundError:
    print('pygetwindow not suported')  

walterdis avatar Mar 14 '22 14:03 walterdis

try: import pygetwindow except ImportError or ModuleNotFoundError: print('pygetwindow not suported')

Hi, replacing line 10 with the code above didn't work at first so I tweaked your fix a little bit this way. All seems fine now ^^

try:
    import pygetwindow
except NotImplementedError or ModuleNotFoundError:
    print('pygetwindow not suported') 

fralk avatar Mar 14 '22 14:03 fralk

try: import pygetwindow except ImportError or ModuleNotFoundError: print('pygetwindow not suported')

Hi, replacing line 10 with the code above didn't work at first so I tweaked your fix a little bit this way. All seems fine now ^^

try:
    import pygetwindow
except NotImplementedError or ModuleNotFoundError:
    print('pygetwindow not suported') 

Nice 😁

If anything happens, let me know

walterdis avatar Mar 14 '22 14:03 walterdis

Desculpa a demora em responder, mas eu fiz uma cagada e perdi a VPS que eu tinha, consegui uma nova só agora.. então, instalei aqui e tá rodando, tô tentando copiar a função de enviar mensagem pro telegram daquele bot que te passei o link.

Monjollo avatar Mar 16 '22 00:03 Monjollo

Desculpa a demora em responder, mas eu fiz uma cagada e perdi a VPS que eu tinha, consegui uma nova só agora.. então, instalei aqui e tá rodando, tô tentando copiar a função de enviar mensagem pro telegram daquele bot que te passei o link.

Qualquer coisa, da uma olhada no bot do pessoal da cryptowin, eu fiz uma call com eles e usaram meu código pra criar. O bot deles é multi também, envia pelo telegram e mistura outros jogos junto

https://www.youtube.com/watch?v=M-THAGYd4VQ

walterdis avatar Mar 16 '22 01:03 walterdis