|
Post by spohnz on Jun 7, 2017 8:24:58 GMT -6
So with the new server. I now have it on amazon aws. It was difficult to figure out but I got it in the end. We cancelled that stupid company we worked with. I wanted a way to constantly check the status of the server and found this mod mcstatus written in Python. Just FYI if you wanted to keep an eye on it in case we are out teaching or something. It does hang once in a while and will need to be keeping an eye on it.
|
|
|
Post by spohnz on Jun 8, 2017 9:11:35 GMT -6
from mcstatus import MinecraftServer
import winsound
import time
pingTime=[]
#f=open('pyCraftLogging.txt','a')
while True:
try:
f=open('pyCraftLogging.txt','a')
server = MinecraftServer.lookup('1.1.1.1')
ping=server.ping()
status=server.status()
print("The server has {0} players and replied in {1} ms".format(status.players.online, status.latency))
for x in status.raw.items():
if x[0] == 'players':
t=time.ctime()
l=t[0:16]
print(l,x)
f.write(time.ctime()+str(x)+'\n')
f.close()
time.sleep(60)
except:
winsound.Beep(3700,4200)
winsound.Beep(370,4200)
This script is for heimerdawg at his request: Also I changed the server IP to 1.1.1.1 obviously. Put in the PyCraft server or any minecraft server you want.
|
|
|
Post by prettylilpsycho7 on Jun 22, 2017 14:41:34 GMT -6
it's giving me a "no module" error for the 1st list where it says "from mcstatus import MinecraftServer". how can i fix it?
|
|
|
Post by spohnz on Jun 22, 2017 17:10:04 GMT -6
open a CMD terminal and do a 'pip install mcstatus' To do a 3rd party install of most python packages.
|
|
|
Post by prettylilpsycho7 on Jun 22, 2017 19:55:56 GMT -6
CMD terminal?... sorry i probably know what that is in the back of my head but i'm too tired to recall info XD
|
|
|
Post by spohnz on Jun 22, 2017 20:13:40 GMT -6
It is the black terminal you get in windows.
|
|
|
Post by prettylilpsycho7 on Jun 22, 2017 21:27:45 GMT -6
ok... what do i do on it?
|
|
|
Post by spohnz on Jun 23, 2017 9:18:57 GMT -6
'pip install mcstatus' without the quotes
|
|
|
Post by prettylilpsycho7 on Jun 23, 2017 15:30:03 GMT -6
Its not working... Attachments:
|
|
|
Post by spohnz on Jun 23, 2017 16:44:01 GMT -6
This is simple enough to remedy. You can: 1. If you are using latest version of Python.
In computer properties, Go to Advanced System Settings -> Advanced tab -> Environmental Variables
In System variables section, there is variable called PATH. Append c:\Python37\Scripts (Note append, not replace)
Then open a new command prompt, try "pip" Make sure you have the right scripts folder for your version of python
2. open the CMD again and lets say your python folder is at the root like mine. Go to the scripts folder. like so. cd C:\\Python34 #Changes to the python folder with the command cd 'change drives' C:\Python34>cd Scripts C:\Python34\Scripts>pip install mcstatus
But make sure that your Python is installed on C root. Sometimes I have seen it in AppData. Either way the scripts folder with pip in there is under Python.
|
|
|
Post by prettylilpsycho7 on Jun 23, 2017 16:57:12 GMT -6
C root?
|
|
|
Post by prettylilpsycho7 on Jun 23, 2017 19:16:19 GMT -6
nvm dawg helped me figure it out
|
|
thepifanatic
New Member
pi is awsome people have calculated it past 1 million digits
Posts: 41
|
Post by thepifanatic on Jul 20, 2017 9:25:34 GMT -6
Learned this after i reinstalled python to have variables in cmd Make sure you run it as administrator.then it works
|
|
|
Post by heimerdawg on Jul 20, 2017 10:37:48 GMT -6
Yes.
|
|