Comments (8)
Create a file called run.sh (or something else) with this in it
#!/bin/sh
while true
do python3 ./main.py
done
then to run it, sh ./run.sh
from capsulefarmerevolved.
Please we need this Poro. I also missed drops because of it. I'd suggest doing it like this:
If the program recovery fails, wait 10 minutes to try again. That would be a nice solution!
from capsulefarmerevolved.
It does automatically restart three times. However, after three unsuccessful recovery attempts it shuts itself off to prevent account/IP blocking.
from capsulefarmerevolved.
I'm using this script to check whether CapsuleFarmer is running or not. I run it on Windows, but this could be modified to work on other systems too. Feel free to use it:
import os
import win32gui
import time
class Restart:
def check_program_running(program_name):
def callback(hwnd, hwnds):
if win32gui.IsWindowVisible(hwnd) and win32gui.GetWindowText(hwnd) != '':
hwnds.append(hwnd)
return True
hwnds = []
win32gui.EnumWindows(callback, hwnds)
for hwnd in hwnds:
if program_name in win32gui.GetWindowText(hwnd):
return True
return False
def start_program(program_path, start_dir):
try:
os.chdir(start_dir)
os.startfile(program_path)
print(f"{time.ctime()} Started program: {program_path}")
except:
print(f"{time.ctime()} Could not start program: " + program_path)
program_name = "CapsuleFarmerEvolved.exe"
start_dir = os.path.dirname(os.path.abspath(__file__))
program_path = start_dir + "\\" + program_name
check_interval = 600 # in seconds
while True:
if not check_program_running(program_name):
print(f"{time.ctime()} Program not running. Starting now...")
start_program(program_path, start_dir)
else:
print(f"{time.ctime()} Program running.")
time.sleep(check_interval)
Has to be in the same folder as the CapsuleFarmer, or change the start_dir variable to wherever the .exe or the main.py is.
In case you are not using the exe you also have to change the program_name variable to main.py
from capsulefarmerevolved.
Temporary workaround is:
create a textfile in the directory with the CapsuleFarmer.exe
open the textfile and write in it:
:1
CapsuleFarmerEvolved.exe
goto 1
save and rename the file ending to .bat instead of .txt
if you run the file now, it should restart itself after crashing
from capsulefarmerevolved.
Thank you for the answer. Enquiry about this.
You always talk about an .exe. My bot is running on my RPI 4 and strong the bot via the python main.py. Would that also work with it?
from capsulefarmerevolved.
Sorry, thought u were using the EXE on Windows
Im running it on my Raspberry Pi 3 too, but on Docker which with the commands in the Readme already auto restarts it
from capsulefarmerevolved.
I'm using this script to check whether CapsuleFarmer is running or not. I run it on Windows, but this could be modified to work on other systems too. Feel free to use it:
import os import win32gui import time class Restart: def check_program_running(program_name): def callback(hwnd, hwnds): if win32gui.IsWindowVisible(hwnd) and win32gui.GetWindowText(hwnd) != '': hwnds.append(hwnd) return True hwnds = [] win32gui.EnumWindows(callback, hwnds) for hwnd in hwnds: if program_name in win32gui.GetWindowText(hwnd): return True return False def start_program(program_path, start_dir): try: os.chdir(start_dir) os.startfile(program_path) print(f"{time.ctime()} Started program: {program_path}") except: print(f"{time.ctime()} Could not start program: " + program_path) program_name = "CapsuleFarmerEvolved.exe" start_dir = os.path.dirname(os.path.abspath(__file__)) program_path = start_dir + "\\" + program_name check_interval = 600 # in seconds while True: if not check_program_running(program_name): print(f"{time.ctime()} Program not running. Starting now...") start_program(program_path, start_dir) else: print(f"{time.ctime()} Program running.") time.sleep(check_interval)
Has to be in the same folder as the CapsuleFarmer, or change the start_dir variable to wherever the .exe or the main.py is.
In case you are not using the exe you also have to change the program_name variable to main.py
For All Who want to use this:
It's required Python and pywin32 Library (pip install pywin32) installed on your computer.
from capsulefarmerevolved.
Related Issues (20)
- [Bug]: Session drop counter not working correctly HOT 1
- [Bug]: v1.4 Error HOT 2
- [Bug]: Error status. HOT 1
- [Bug]: program not working HOT 1
- [Suggestion]: Remove logging for synology NAS install
- [Wiki]: Imporve Advanced-Installation-for-Macos.md HOT 1
- [Bug]:
- [Suggestion]: Improved UI Layout HOT 1
- [Bug]: The Linux installation script under Ubuntu reports an error cloudscraper? HOT 3
- [Bug]: Program shows multiple session drops, but it doesn't match with Loot tab in LoL HOT 6
- [Bug]: Docker logs can not be shown comletely, which only shows the former 11 accounts
- [Bug]:
- [Bug]: ERROR - restart at 22:06:52, failed logins: 0 HOT 6
- [Bug]: linux/amd64
- [Suggestion]: Other ways of using Capsule Farmer Evolved HOT 3
- [Bug]: Is the recent drop rate a bit too low, even ancient dragons are not dropping HOT 8
- [Bug]: No drops for over a few weeks HOT 8
- [Bug]: only the first account drops HOT 4
- [Suggestion]: Ability to configure which regions to watch HOT 3
- [Bug]: error module not found on termux android
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capsulefarmerevolved.