D
Deleted member
I remember a few months ago I used a method to read html from a site, and set it to a variable in game. But I can't remember what it is, can anyone help?
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!
You can always check out skUnity Downloads for downloads and any other information about Skript!
That's not what I used to use, but I will try it. Thank you.
Could you maybe explain, how to copy the text from https://api.namemc.com/server/mc.duffcraft.net/likes?profile=19e8913f-e6db-430d-9c92-d86c3ec0a68d to a variable? If not, that's fine. If you do, thanks !
send request to "https://api.namemc.com/server/mc.duffcraft.net/likes?profile=%UUID OF PLAYER%"
set {_body} to the last received http web response's body
wait 1 tick
map the json of {_body} to variable {_isittrueorfalse::*}
loop {_isittrueorfalse::*}:
if loop-value = true:
set {_itstrue} to true
if {_itstrue} is set:
#dostuff (you checked and it's true, now implement what you want to do with it.)
you don't have to map it on a variable such as it is a plain text response, not a JSON one. so, from the start to the {_body} variable it is fine.code_language.skript:send request to "https://api.namemc.com/server/mc.duffcraft.net/likes?profile=%UUID OF PLAYER%" set {_body} to the last received http web response's body wait 1 tick map the json of {_body} to variable {_isittrueorfalse::*} loop {_isittrueorfalse::*}: if loop-value = true: set {_itstrue} to true if {_itstrue} is set: #dostuff (you checked and it's true, now implement what you want to do with it.)
Well, in this case, yes, but I'm explaining to him how to use both reqn and skript-json.you don't have to map it on a variable such as it is a plain text response, not a JSON one. so, from the start to the {_body} variable it is fine.
I've tested it, it doesn't seem to work. I added an "else if" and it says no every time.code_language.skript:send request to "https://api.namemc.com/server/mc.duffcraft.net/likes?profile=%UUID OF PLAYER%" set {_body} to the last received http web response's body wait 1 tick map the json of {_body} to variable {_isittrueorfalse::*} loop {_isittrueorfalse::*}: if loop-value = true: set {_itstrue} to true if {_itstrue} is set: #dostuff (you checked and it's true, now implement what you want to do with it.)
command /test:
trigger:
send request to "https://api.namemc.com/server/mc.duffcraft.net/likes?profile=%player's uuid%"
set {_body} to the last received http web response's body
wait 1 tick
map the json of {_body} to variable {_isittrueorfalse::*}
broadcast "&e%{_isittrueorfalse::*}%"
loop {_isittrueorfalse::*}:
if loop-value is "true":
set {_itstrue} to true
if {_itstrue} is set:
broadcast "Yes"
stop
broadcast "no"
Well, in this case, yes, but I'm explaining to him how to use both reqn and skript-json.
Thank you both for your help. Looks like the _body variable is all I need.you don't have to map it on a variable such as it is a plain text response, not a JSON one. so, from the start to the {_body} variable it is fine.
command /test:
trigger:
send request to "https://api.namemc.com/server/mc.duffcraft.net/likes?profile=%player's uuid%"
set {_body} to the last received http web response's body
broadcast "%{_body}%"
Okay so {_body} works, but after that it does nothing. So after the broadcast it does nothing.code_language.skript:command /test: trigger: send request to "https://api.namemc.com/server/mc.duffcraft.net/likes?profile=%player's uuid%" set {_body} to the last received http web response's body broadcast "%{_body}%"
Do this first.
I've done some testing, it doesn't loop like its supposed tocode_language.skript:command /test: trigger: send request to "https://api.namemc.com/server/mc.duffcraft.net/likes?profile=%player's uuid%" set {_body} to the last received http web response's body broadcast "%{_body}%"
Do this first.