Skip to content
This repository was archived by the owner on May 2, 2023. It is now read-only.

Commit d077edc

Browse files
committed
edit : Added the amount of missions/vehicles it's checking
The bot now displays the vehicles / missions checked, so for huge accounts the user will know what's going on. Also added discord to prevent email spam.
1 parent 7fdb405 commit d077edc

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,21 @@ Download the code, install Python then open up a cmd and type in the following:
1010

1111
`pip install -r requirements.txt`-
1212

13-
Once done open the account.txt and replace corresponding lines with your account information, and url.txt and enter the domain your account is registered such as `https://www.missionchief.co.uk/`
13+
Once done open the `account.txt` and replace corresponding lines with your account information, and `url.txt` and enter the domain your account is registered such as `https://www.missionchief.co.uk/`
1414

1515
Once you're done, do the following in a cmd - it will run the bot for you.
1616
`run missionchief_bot.py`
1717

1818

1919
## Issues / Bugs / Errors
2020

21+
If you have any issues and would like to let us know directly, please join our discord.
22+
<p align="center">
23+
<a href="https://discord.gg/DshUEeg">
24+
<img src="https://discordapp.com/api/guilds/676191159638425620/widget.png?style=banner2" />
25+
</a>
26+
</p>
27+
2128
If you have any issues please create an issue [here](https://github.com/codesidian/Python-MissionChiefBot/issues)
2229

2330

missionchief_bot.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def buildMissions(self):
6666
hrefs = []
6767
browser.visit(url)
6868
links = browser.links.find_by_partial_href('/missions/')
69+
checked = 0;
6970
for link in links:
7071
hrefs.append(link['href'])
7172
print(f"{str(len(links))} mission/s found")
@@ -82,7 +83,9 @@ def buildMissions(self):
8283
requirements = getRequirements(missionId)
8384
currMission = Mission(missionId,missionName,requirements)
8485
self.missionList.append(currMission)
85-
86+
# Show user how many missions it's checked compared to how many it needs to.
87+
checked+=1
88+
print(Fore.GREEN + f"{checked}/{len(hrefs)} missions checked!" + Fore.RESET)
8689
except AlreadyExistsException:
8790
continue
8891
#time.sleep(5)
@@ -96,6 +99,7 @@ def buildVehicles(self):
9699
for link in links:
97100
hrefs.append(link['href'])
98101
print(f"{str(len(links))} vehicles/s found")
102+
checked = 0;
99103
for href in hrefs:
100104
vehicleId = href.split("/")[4]
101105
try:
@@ -109,6 +113,8 @@ def buildVehicles(self):
109113
vehicleStatus = browser.find_by_xpath('//span[contains(@class, "building_list_fms")]').text
110114
currVehicle = Vehicle(vehicleId,vehicleName,vehicleType,vehicleStatus)
111115
self.vehicleList.append(currVehicle)
116+
checked+=1
117+
print(Fore.GREEN + f"{checked}/{len(hrefs)} vehicles checked!" + Fore.RESET)
112118
except AlreadyExistsException:
113119
continue
114120
#time.sleep(5)
@@ -130,7 +136,6 @@ def doMissions(self):
130136
if(mission not in self.despatches):
131137
self.despatchVehicles(mission)
132138
else:
133-
print('we here')
134139
#We need to make sure that there's no missions with half dispatches (if there weren't enough vehicles to begin with)
135140
for despatch in self.despatches:
136141
if despatch == mission:

0 commit comments

Comments
 (0)