poryaei / notcoin-clicker Goto Github PK
View Code? Open in Web Editor NEWA Python bot and automated clicker for accumulating NotCoins on Telegram.
Home Page: https://t.me/notcoin_bot
License: MIT License
A Python bot and automated clicker for accumulating NotCoins on Telegram.
Home Page: https://t.me/notcoin_bot
License: MIT License
Hello!
I have two suggestions that could improve the program.
First:
I suggest replacing
match current_buff['taskId']:
case 2:
# Full Energy!
max_full_energy_times: int = current_buff['task']['max']
if current_buff['task']['status'] == 'active':
full_energy_times_count += 1
case 3:
max_turbo_times: int = current_buff['task']['max']
if current_buff['task']['status'] == 'active':
turbo_times_count += 1
to
#match current_buff['taskId']: #change 1
if current_buff['taskId'] == 2: #change 2
# Full Energy!
max_full_energy_times: int = current_buff['task']['max']
if current_buff['task']['status'] == 'active':
full_energy_times_count += 1
elif current_buff['taskId'] == 3: #change 3
max_turbo_times: int = current_buff['task']['max']
if current_buff['task']['status'] == 'active':
turbo_times_count += 1
so that the program works on all versions of Python, and not just on new ones.
Second:
Commands for this bot work in all dialogs, not just in the Favorite dialog.
Maybe there is an opportunity to allow users to create a bot in telegram, insert its Token into the program, and then communicate with your program through a dialogue with the created bot?
Thank you very much for the work done!
Mining Error: Expecting value: line 1 column 1 (char 0)
The program returns an error some time after start.
[~] Generating New Auth
[+] Lets mine ...
Mining Error: shutdown() got an unexpected keyword argument 'cancel_futures'
False
[!] Mining 20 coins field!
[~] Generating New Auth
[+] Lets mine ...
Mining Error: shutdown() got an unexpected keyword argument 'cancel_futures'
False
[!] Mining 20 coins field!
[~] Generating New Auth
[+] Lets mine ...
Mining Error: shutdown() got an unexpected keyword argument 'cancel_futures'
False
[!] Mining 20 coins field!
[~] Generating New Auth
[+] Lets mine ...
Mining Error: shutdown() got an unexpected keyword argument 'cancel_futures'
False
/
File "clicker.py", line 264
match current_buff['taskId']:
^
hi
i set the api_id and api_hash and i ran the code, after entering my number and the auth code, it asked for a password but it doesn't allow me to enter anything
how should i fix this problem?
I have completed all the steps and I have also run the project. However, I couldn't figure out how to use the WebViewResultUrl in the output, and also, what is the ID of its bot?
The method you tried to invoke cannot be executed as a bot (caused by RequestWebViewRequest)
telethon.errors.rpcerrorlist.BotMethodInvalidError: The API access for bot users is restricted. The method you tried to invoke cannot be executed as a bot (caused by RequestWebViewRequest)
[1] 80861 segmentation fault python clicker.py
Whenever I try to deploy, I'm getting this error. Please let me know the fix.
File "clicker.py", line 230
match current_buff['taskId']:
^
SyntaxError: invalid syntax
Activing F Energy!
Mining Error: unhashable type: 'list'
Sleeping For 10MIN
it activates the energy but doesnt mine and sleeps
edit:
guys i solved the problem in line 266 change this
return ['ok'] in r.json()
to this
return 'ok' in r.json()
After a few hours of program execution, there are issues with proxy detection. The following log is outputted when running the program:
INFO:root:[+] Lets mine ...
INFO:root:[-] Updating webview URL ...
INFO:root:[+] WebView URL UPDATED!
INFO:root:[-] Updating webview URL ...
INFO:root:[+] WebView URL UPDATED!
WARNING:root:[!] No valid proxy!
WARNING:root:[-] Try again ...
INFO:root:[-] Updating webview URL ...
INFO:root:[+] WebView URL UPDATED!
WARNING:root:[!] No valid proxy!
WARNING:root:[-] Try again ...
INFO:root:[-] Updating webview URL ...
INFO:root:[+] WebView URL UPDATED!
WARNING:root:[!] No valid proxy!
WARNING:root:[-] Try again ...
OS: Ubuntu 22
Server location: USA
Python: 3.10 in docker
After 1 minute of activating this bot, my Telegram account was banned! You didn't write any warning about this!?
PS E:\Programs\GIT\NotCoin-Clicker> python clicker.py
Traceback (most recent call last):
File "E:\Programs\GIT\NotCoin-Clicker\clicker.py", line 2, in
import js2py
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python312\Lib\site-packages\js2py_init_.py", line 72, in
from .base import PyJsException
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python312\Lib\site-packages\js2py\base.py", line 2965, in
@js
^^
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python312\Lib\site-packages\js2py\base.py", line 165, in Js
return PyJsFunction(val, FunctionPrototype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python312\Lib\site-packages\js2py\base.py", line 1377, in init
cand = fix_js_args(func)
^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python312\Lib\site-packages\js2py\utils\injector.py", line 27, in fix_js_args
code = append_arguments(six.get_function_code(func), ('this', 'arguments'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python312\Lib\site-packages\js2py\utils\injector.py", line 121, in append_arguments
arg = name_translations[inst.arg]
~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 3
Do I need some app installed on my Windows machine or what?
Hi Thank You For Your Hard Work
Scripts Doesn't Check If There Is Full Energy Available Just Activates It Even There Is Not Any Full Energy Boost And Starts Mining And Doesn't Wait For 10 Min To Regain Energy.
It would be nice to add multithreading. Yes, unfortunately, you will have to give up managing via Telegram for each account, but purely in theory, you can manage all accounts through linking to one Telegram bot.
Regarding multithreading. This will be a very convenient feature because now there are few places like this
any way to solve this and get api hash?
Hi!
I have another proposal to improve the project. I studied the JS scripts from their application and got the formula by which the maximum number of coins that the server accepts (/clicker/core/click) during the request is calculated.
I suggest calculating this value in startMin:
getData = self.sendCoins(_sc, _sh)
data = getData["data"][0]
...
_sc = int(159 * data["multipleClicks"] * random.uniform(0.8, 1.0))
I use random so that the number of coins varies slightly with each request.
I've been running the bot for 9 hours, but it's always stuck at the updating WebView Url every 30 minutes or so, and it needed to be restarted once in a while. Is there a way to bypass this?
File "D:\NotCoin-Clicker-main\NotCoin-Clicker-main\clicker.py", line 127
match current_buff['taskId']:
^
SyntaxError: invalid syntax
Hello, when I run it, it gives this error.
File "clicker.py", line 295
match current_buff['taskId']:
^
SyntaxError: invalid syntax
False [!] Mining 8 coins field! [~] Generating New Auth [+] Lets mine ... False [!] Mining 8 coins field! [~] Generating New Auth [+] Lets mine ... False [!] Mining 8 coins field! [~] Generating New Auth [+] Lets mine ... False [!] Mining 8 coins field! [~] Generating New Auth [+] Lets mine ... False
After turning it on it keeps spamming this
it worked for a moment but it stopped working after a wile
after a few minute work proxy not update and bot just trying to get new proxy
my server is in germany
Could you add support for auto-executing daily boosts like "Turbo" and "Full Energy", and add in a configuration option that starts automatically clicking (/click on) when the bot start/restarted?
Hello!
I decided to share my thoughts about your project. First of all, thank you for your hard work - it's cool that you share this publicly, I respect it.
Your project has a waiting time of 10 minutes, the code:
if getData["data"][0]["availableCoins"] < _sc:
if not self.readyToClick():
print('[~] Sleeping For 10MIN')
self.mining_stats = self._mining_stats[0]
time.sleep(600)
Many people buy various boosts, including to speed up the recovery time. And stitching for 10 minutes is not the optimal solution... The server returns information about how much "energy" the user currently has, as well as how much "energy" is being restored per second. My suggestion is to use this data. We can wait for the energy to fill up, and then continue clicking.
The proposed method for improving the process:
def fillEnergy(self, lastAvailableCoins, limitCoins, miningPerTime):
coinsToRecieve = limitCoins - lastAvailableCoins
waitTime = coinsToRecieve / miningPerTime
print(f'Filling energy: {waitTime} sec...')
time.sleep(waitTime)
Thus, each user individually waits for his "energy" to be filled, and then the operations continue.
It is proposed to make edits to the startMin method. All data is available in the getData["data"][0]:
data = getData["data"][0]
if data["availableCoins"] < _sc:
lastAvailableCoins = data['lastAvailableCoins']
limitCoins = data['limitCoins']
miningPerTime = data['miningPerTime']
self.fillEnergy(lastAvailableCoins, limitCoins, miningPerTime)
/help to view help
/click to enable/disable collection
/balance to check NotCoin balance
/speed 1-10 to set collection speed (1-10)
/stop to Stop bot
and where, to which bot should you give these commands?
after a few days working bot not respon to command
nothing change every thing stable but bot dont get command in telegram
btw colleting is ok
Hi again!
I can't speak for everyone, but I would be interested if the bot could automatically buy boosts - this makes mining easier. It would be possible to hide this functionality behind the settings.
My code:
def getShop(self):
try:
data = {
'webAppData': self.webAppData
}
r = self.session.options('https://clicker-api.joincommunity.xyz/clicker/store/merged', json=data)
r = self.session.get('https://clicker-api.joincommunity.xyz/clicker/store/merged', json=data)
return r.json()
except:
return None
def buyBoost(self, id):
try:
data = {
'webAppData': self.webAppData
}
self.session.options(f'https://clicker-api.joincommunity.xyz/clicker/store/buy/{id}', json=data)
self.session.post(f'https://clicker-api.joincommunity.xyz/clicker/store/buy/{id}', json=data)
self.getShop()
self.combineCompleted()
return True
except:
return False
def combineCompleted(self):
try:
data = {
'webAppData': self.webAppData
}
self.session.get('https://clicker-api.joincommunity.xyz/clicker/task/combine-completed', json=data)
return True
except:
return False
When the required balance accumulates, the bot automatically purchases the necessary boost.
Which version of Python I need to use, cause on default Ubuntu 20.04 python3.8 script doesn't work, with error in code
if can add sleep status in telegram panel
When faced with the error "No valid proxy!" I am forced to stop the program once and then run it again from the beginning.
In this situation, naturally, mining does not take place. Is it possible to include a command similar to /restart in the bot commands so that after stopping the program, it can be restarted from the beginning? At least, let's not go manually into the server to do this task.
root@DanyaJsov:~/NotCoin-Clicker# python3 clicker.py
Request caused struct.error: 'i' format requires -2147483648 <= number <= 2147483647: InvokeWithLayerRequest(layer=167, query=InitConnectionRequest(api_id=6837111937, device_model='PC 64bit', system_version='5.4.0', app_version='1.33.1', system_lang_code='en', lang_pack='', lang_code='en', query=GetConfigRequest(), proxy=None, params=None))
Traceback (most recent call last):
File "clicker.py", line 24, in <module>
client.start()
File "/usr/local/lib/python3.8/dist-packages/telethon/client/auth.py", line 128, in start
else self.loop.run_until_complete(coro)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/usr/local/lib/python3.8/dist-packages/telethon/client/auth.py", line 135, in _start
await self.connect()
File "/usr/local/lib/python3.8/dist-packages/telethon/client/telegrambaseclient.py", line 593, in connect
await self._sender.send(functions.InvokeWithLayerRequest(LAYER, req))
File "/usr/local/lib/python3.8/dist-packages/telethon/network/mtprotosender.py", line 183, in send
state = RequestState(request)
File "/usr/local/lib/python3.8/dist-packages/telethon/network/requeststate.py", line 17, in __init__
self.data = bytes(request)
File "/usr/local/lib/python3.8/dist-packages/telethon/tl/tlobject.py", line 194, in __bytes__
return self._bytes()
File "/usr/local/lib/python3.8/dist-packages/telethon/tl/functions/__init__.py", line 253, in _bytes
self.query._bytes(),
File "/usr/local/lib/python3.8/dist-packages/telethon/tl/functions/__init__.py", line 127, in _bytes
struct.pack('<i', self.api_id),
struct.error: 'i' format requires -2147483648 <= number <= 2147483647
Task was destroyed but it is pending!
task: <Task pending name='Task-5' coro=<MTProtoSender._send_loop() running at /usr/local/lib/python3.8/dist-packages/telethon/network/mtprotosender.py:464> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7ff07aeae370>()]>>
Task was destroyed but it is pending!
task: <Task pending name='Task-6' coro=<MTProtoSender._recv_loop() running at /usr/local/lib/python3.8/dist-packages/telethon/network/mtprotosender.py:507> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7ff07aeae070>()]>>
Task was destroyed but it is pending!
task: <Task pending name='Task-3' coro=<Connection._send_loop() running at /usr/local/lib/python3.8/dist-packages/telethon/network/connection/connection.py:316> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7ff07aeae250>()]>>
Task was destroyed but it is pending!
task: <Task pending name='Task-4' coro=<Connection._recv_loop() running at /usr/local/lib/python3.8/dist-packages/telethon/network/connection/connection.py:335> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7ff07aeae2e0>()]>>
Exception ignored in: <coroutine object Connection._recv_loop at 0x7ff07aef6ec0>
RuntimeError: coroutine ignored GeneratorExit
OS: Raspbian os
Device: Rasberry pi 3b+
PY version: Python 3.9.2
When i starting the script i will get this error:
File "/home/Fess/notcoin-clicker/NotCoin-Clicker/clicker.py", line 297 match current_buff['taskId']: ^ SyntaxError: invalid syntax
The program returns an error some time after use. Restarting the program corrects the error.
`[+] Mining 20 coins Done! New Balance: 63946
[!] Mining 20 coins field!
[~] Generating New Auth
Exception in thread Thread-1 (startMin):
Traceback (most recent call last):
File "C:\Users\armbe\PycharmProjects\notcoin_test.venv\Lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\armbe\AppData\Local\Programs\Python\Python311\Lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\armbe\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\armbe\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\armbe\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1045, in _bootstrap_inner
self.run()
File "C:\Users\armbe\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 982, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\armbe\PycharmProjects\notcoin_test\clicker.py", line 214, in startMin
self.webAppData = self.generateAuthToken()
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\armbe\PycharmProjects\notcoin_test\clicker.py", line 76, in generateAuthToken
).json()['data']['accessToken']
^^^^^^
File "C:\Users\armbe\PycharmProjects\notcoin_test.venv\Lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)`
PS C:\Users\intel\Desktop\NotCoin-Clicker-main> python clicker.py
Attempt 1 at connecting failed: TimeoutError:
Attempt 2 at connecting failed: TimeoutError:
Attempt 3 at connecting failed: TimeoutError:
Attempt 4 at connecting failed: TimeoutError:
Attempt 5 at connecting failed: TimeoutError:
Attempt 6 at connecting failed: TimeoutError:
Traceback (most recent call last):
File "C:\Users\intel\Desktop\NotCoin-Clicker-main\clicker.py", line 23, in
client.start()
File "C:\Users\intel\AppData\Roaming\Python\Python310\site-packages\telethon\client\auth.py", line 128, in start
else self.loop.run_until_complete(coro)
File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "C:\Users\intel\AppData\Roaming\Python\Python310\site-packages\telethon\client\auth.py", line 135, in _start
await self.connect()
File "C:\Users\intel\AppData\Roaming\Python\Python310\site-packages\telethon\client\telegrambaseclient.py", line 544, in connect
if not await self._sender.connect(self._connection(
File "C:\Users\intel\AppData\Roaming\Python\Python310\site-packages\telethon\network\mtprotosender.py", line 134, in connect
await self._connect()
File "C:\Users\intel\AppData\Roaming\Python\Python310\site-packages\telethon\network\mtprotosender.py", line 260, in _connect
raise ConnectionError('Connection to Telegram failed {} time(s)'.format(self._retries))
ConnectionError: Connection to Telegram failed 5 time(s)
I dreamed of becoming a millionaire, but it didn't work out. And on the first of April, mining ends.
I removed random, entered the number 10, removed sleep, created several threads, but it was still very slow. Oh, it's a pity.
buteError: module 'telethon.tl.functions.messages' has no attribute 'RequestWebViewRequest'. Did you mean: 'RequestUrlAuthRequest'?
There is an issue that in the course of time the script is not able to find any available proxies
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.