Jump to content




BanCheck


  • You cannot reply to this topic
8 replies to this topic

#1 cdel

  • Banned
  • 496 posts
  • LocationMelbourne, Australia

Posted 29 June 2014 - 10: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.

Install

pastebin get 4nRg9CHU json

pastebin get 4R0GXpqr bancheck

Images (Running in the epic LyqydOS :D)

Posted Image

Edited by connordelaneyy, 17 July 2014 - 08:18 AM.


#2 cdel

  • Banned
  • 496 posts
  • LocationMelbourne, Australia

Posted 17 July 2014 - 08:17 AM

updated screenshots :D

#3 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 17 July 2014 - 08: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.

#4 cdel

  • Banned
  • 496 posts
  • LocationMelbourne, Australia

Posted 17 July 2014 - 08:28 AM

View Posttheoriginalbit, on 17 July 2014 - 08:23 AM, said:

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

#5 cdel

  • Banned
  • 496 posts
  • LocationMelbourne, Australia

Posted 17 July 2014 - 09:02 AM

update: added arguments and username checking

#6 Anavrins

  • Members
  • 775 posts

Posted 17 July 2014 - 02: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 by Anavrins, 17 July 2014 - 02:46 PM.


#7 cdel

  • Banned
  • 496 posts
  • LocationMelbourne, Australia

Posted 18 July 2014 - 08:38 AM

View PostAnavrins, on 17 July 2014 - 02:42 PM, said:

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

#8 jordyvl

  • Members
  • 19 posts
  • LocationNetherlands

Posted 15 November 2014 - 02:24 PM

i cant download it pastebin link doesnt work

#9 Dog

  • Members
  • 1,179 posts
  • LocationEarth orbit

Posted 15 November 2014 - 05:26 PM

According to Pastebin the paste has been removed.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users