541 posts
Location
Melbourne, Australia
Posted 29 June 2014 - 11:35 AM
Greetings everyone :D/>,I have created a way to check if a specific player has been banned on a server, this is possible using the
Fishbans API and a
JSON API by
ElvishJerricco.
Installpastebin get 4nRg9CHU json
pastebin get 4R0GXpqr bancheck
Images (Running in the epic LyqydOS :D/>)
Edited on 17 July 2014 - 07:18 AM
541 posts
Location
Melbourne, Australia
Posted 17 July 2014 - 09:17 AM
updated screenshots :D/>
7508 posts
Location
Australia
Posted 17 July 2014 - 09:23 AM
This seems like a nice little utility for server owners, though I don't see any use for general users.
You might want to add a condition to make sure data was returned. When I tried this I typed in 'theoriginalbit' and it errored with bancheck:13: attempt to index ? (a nil value) as my username for Minecraft is TheOriginalBIT. You also may want to see if you can expand to using more ban checking services too for more reliable information.
541 posts
Location
Melbourne, Australia
Posted 17 July 2014 - 09:28 AM
This seems like a nice little utility for server owners, though I don't see any use for general users.
You might want to add a condition to make sure data was returned. When I tried this I typed in 'theoriginalbit' and it errored with bancheck:13: attempt to index ? (a nil value) as my username for Minecraft is TheOriginalBIT. You also may want to see if you can expand to using more ban checking services too for more reliable information.
Okay, thanks for the suggestion. Much appreciated :D/>
541 posts
Location
Melbourne, Australia
Posted 17 July 2014 - 10:02 AM
update: added arguments and username checking
756 posts
Posted 17 July 2014 - 03:42 PM
Little bug, your "totalBans" will always stay at zero since it get reset every time the for loop iterate.
else
local totalBans = 0 //-- Added declaration here
for service, info in pairs(data.bans.service) do
print("[INFO] Service: "..service.." Bans: "..info.bans)
totalBans = totalBans + info.bans //-- Removed localization here
end
print("[INFO] Total Bans: "..totalBans)
end
end
Edited on 17 July 2014 - 01:46 PM
541 posts
Location
Melbourne, Australia
Posted 18 July 2014 - 09:38 AM
Little bug, your "totalBans" will always stay at zero since it get reset every time the for loop iterate.
else
local totalBans = 0 //-- Added declaration here
for service, info in pairs(data.bans.service) do
print("[INFO] Service: "..service.." Bans: "..info.bans)
totalBans = totalBans + info.bans //-- Removed localization here
end
print("[INFO] Total Bans: "..totalBans)
end
end
thanks, I have updated the code :D/>
19 posts
Location
Netherlands
Posted 15 November 2014 - 02:24 PM
i cant download it pastebin link doesnt work
1220 posts
Location
Earth orbit
Posted 15 November 2014 - 05:26 PM
According to Pastebin the paste has been removed.