Skip to content

Commit

Permalink
1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
naiximcn authored May 20, 2022
1 parent 30e8997 commit 8026944
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
26 changes: 26 additions & 0 deletions mcping.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import requests,os,time,base64,easygui
#mcip=input('请输入IP:> ')
mcip=easygui.enterbox(msg='请输入服务器IP\n如 mc.hypixel.net',title='NaixiMCServerPing-输入IP',default='')
requestse=requests.get('https://list.fansmc.com/api/'+mcip)
mcrequestse=requestse.json()
strmcrequestse=str(mcrequestse)
print('解析完毕')
print('返回信息:'+strmcrequestse)
#print('服务器logo: '+str(base64.b64decode(mcrequestse['logo'])))
print('服务器IP: '+mcip)
print('在线玩家数: '+str(mcrequestse['p'])+'/'+str(mcrequestse['mp']))
print('服务器motd: '+mcrequestse['motd'])
print('服务器mod数量: '+mcrequestse['mod'])
easygui.msgbox(msg='解析完毕\n解析数据:\n服务器IP:'+
mcip+'\n在线玩家数: '+
str(mcrequestse['p'])+
'/'+str(mcrequestse['mp'])+
'\n服务器motd: '+
mcrequestse['motd']+
'\n服务器mod数量: '+
mcrequestse['mod'],
title='NaixiMcServerPing-解析结果',
ok_button='关闭')
os.system('pause')
time.sleep(3)
exit
35 changes: 35 additions & 0 deletions mcping.pyproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>4a263462-3009-448b-b72f-7249da02ff45</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>mcping.py</StartupFile>
<SearchPath>
</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<Name>mcping</Name>
<RootNamespace>mcping</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<ItemGroup>
<Compile Include="mcping.py" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
<!-- Uncomment the CoreCompile target to enable the Build command in
Visual Studio and specify your pre- and post-build commands in
the BeforeBuild and AfterBuild targets below. -->
<!--<Target Name="CoreCompile" />-->
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
</Project>

0 comments on commit 8026944

Please sign in to comment.