GeoIP Time & Day

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

BrettPlayMC

Supporter
Jan 26, 2017
715
53
28
SkUnity Street
Note: I previously requested Snow-Pyon to do this but they were unable to due to the complexity and their limited schedule.
Category: Time

Suggested name: PlayerTime

What I want:
I know there is a Skript variable called %now% that gets the server's real time and day. Though, this is what I want, I want to do this for the player. Basically what Hypixel has on their SkyWars scoreboard. Example:
7/12/17.

Ideas for commands:
None needed
Ideas for permissions:
None needed
When I'd like it by: 1 week
 
code_language.skript:
function geoIp(p: player) :: texts:
  set {_url} to "http://freegeoip.net/json/%{_p}'s ip%"
  set {_ut::*} to content of json value's "country_code", "region_code", "country_name", "region_name", "city" and "time_zone" from text "%line 1 from url {_url}%"
  return {_ut::*}

command /geoip <player = %player%>:
  permission: geoip.admin
  trigger:
    set {_ut::*} to geoIp(player)
    send "Country Code: %{_ut::1}%"
    send "Region Code: %{_ut::2}%"
    send "Country Name: %{_ut::3}%"
    send "Region Name: %{_ut::4}%"
    send "City: %{_ut::5}%"
    send "TimeZone: %{_ut::6}%"
 
  • Like
Reactions: FistoF
code_language.skript:
function geoIp(p: player) :: texts:
  set {_url} to "http://freegeoip.net/json/%{_p}'s ip%"
  set {_ut::*} to content of json value's "country_code", "region_code", "country_name", "region_name", "city" and "time_zone" from text "%line 1 from url {_url}%"
  return {_ut::*}

command /geoip <player = %player%>:
  permission: geoip.admin
  trigger:
    set {_ut::*} to geoIp(player)
    send "Country Code: %{_ut::1}%"
    send "Region Code: %{_ut::2}%"
    send "Country Name: %{_ut::3}%"
    send "Region Name: %{_ut::4}%"
    send "City: %{_ut::5}%"
    send "TimeZone: %{_ut::6}%"
So, how will I get the player's current date?
 
Just use the command and you will see.
Timezone is the last value.
ok...
[doublepost=1499913676,1499909843][/doublepost]
Just use the command and you will see.
Timezone is the last value.
I don't need the timezone. I need the players date based on the timezone.
[doublepost=1500001882][/doublepost]bump
[doublepost=1500336675][/doublepost]bump.
 
ok...
[doublepost=1499913676,1499909843][/doublepost]
I don't need the timezone. I need the players date based on the timezone.
[doublepost=1500001882][/doublepost]bump
[doublepost=1500336675][/doublepost]bump.
What in gods christ all mighty mother of jesus on a slice of toast marinated in nandos medium sauce on the fucking floor are you on about, the players date based on the timezone? he just gave you the fucking timezone. work it out.
 
You can always get the player's timezone, get the server time, then do the math to get the player's time. (Assuming you know the server's time zone)