Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable not working in or after #18

Open
DEPSTRCZ opened this issue Mar 31, 2022 · 13 comments
Open

Variable not working in or after #18

DEPSTRCZ opened this issue Mar 31, 2022 · 13 comments

Comments

@DEPSTRCZ
Copy link

on death:
   victim is player:
        set {_Location} to location of victim
        broadcast "%{_Location}% 3"
        send a "post" request to ..............
        broadcast "%{_Location}% 4"```

"Broadcast 3" works but "Broadcast 4" doesnt and the variable inside the reqn also doesnt work just reports <none> when reqg commented it works.
@kulkalkul
Copy link

This is a known bug: #11
I have a fix on that that still isn't merged, which you can use: #14
You can build it by your own or use prebuilt one from releases.

@DEPSTRCZ
Copy link
Author

DEPSTRCZ commented Apr 1, 2022

This is a known bug: #11 I have a fix on that that still isn't merged, which you can use: #14 You can build it by your own or use prebuilt one from releases.

I tried using yours wich was 1.2.4 if i remember but it didnt worked for me so i tried searching for an conatact on you. But didnt find. You mean from your releases?

@kulkalkul
Copy link

Yeah, this one: https://github.com/yokunjon/reqn/releases/tag/v1.2.4
Though, I don't suggest downloading stuff from untrusting sources, so I'd be reading changes to source code and building it by myself if I were you instead of blindly downloading. 😄

If that doesn't work, I don't know anything else, I don't work with Skript anymore so no idea on that. I hope you can find a solution.

@DEPSTRCZ
Copy link
Author

DEPSTRCZ commented Apr 2, 2022

Yeah, this one: https://github.com/yokunjon/reqn/releases/tag/v1.2.4
Though, I don't suggest downloading stuff from untrusting sources, so I'd be reading changes to source code and building it by myself if I were you instead of blindly downloading. 😄

If that doesn't work, I don't know anything else, I don't work with Skript anymore so no idea on that. I hope you can find a solution.

If i just want to try i should first download release and then build right?

@kulkalkul
Copy link

If you download from the releases, that's already built by me, so you don't have to.

What I'm trying to tell is, just don't run/use code you don't understand or trust the source of. I might've provided that solution, but theorically speaking, I might be someone with malicous intent. I just wanted to give a general warning about downloading stuff from releases or building random code.

Other than that, you can simply download it from releases and use it as plugin without any further steps. 😄

@DEPSTRCZ
Copy link
Author

DEPSTRCZ commented Apr 2, 2022

If you download from the releases, that's already built by me, so you don't have to.

What I'm trying to tell is, just don't run/use code you don't understand or trust the source of. I might've provided that solution, but theorically speaking, I might be someone with malicous intent. I just wanted to give a general warning about downloading stuff from releases or building random code.

Other than that, you can simply download it from releases and use it as plugin without any further steps. 😄

Yeah i know that... I was kinda skeptical putting trust in you but i look into what u changed.. But i got some long error. Im gonna try and im gonna send it to you.

@DEPSTRCZ
Copy link
Author

DEPSTRCZ commented Apr 2, 2022

here it is om your fork... https://pastebin.com/YaTWSyHe

@kulkalkul
Copy link

here it is om your fork... https://pastebin.com/YaTWSyHe

Hmm, for no apparent reason it tries to convert HashMap into ConcurrentHashMap. My bet is async runtime that the Bukkit task uses does it to guarantee safety. This wasn't the case when I first wrote it, probably related to updates on Java or Bukkit/Spigot/Paper. I'll try if simply changing HashMap into ConcurrentHashMap see if works and commit & build it if that's the case.

@kulkalkul
Copy link

kulkalkul commented Apr 3, 2022

@ItzDepstRT Alright, it is indeed about wrong cast but I was a little blind there due to reflection I made, so what I said above is incorrect if anyone is wondering (and it is vice-versa, ConcurrentHashMap into HashMap). Looks like Skript changed localVariables that I reflect into ConcurrentHashMap in newer versions. I updated the cast, it should work now. 🥳

@DEPSTRCZ
Copy link
Author

DEPSTRCZ commented Apr 3, 2022

@ItzDepstRT Alright, it is indeed about wrong cast but I was a little blind there due to reflection I made, so what I said above is incorrect if anyone is wondering (and it is vice-versa, ConcurrentHashMap into HashMap). Looks like Skript changed localVariables that I reflect into ConcurrentHashMap in newer versions. I updated the cast, it should work now. 🥳

Tysm so much... I will try it so happy for it

@DEPSTRCZ
Copy link
Author

DEPSTRCZ commented Apr 4, 2022

@ItzDepstRT Alright, it is indeed about wrong cast but I was a little blind there due to reflection I made, so what I said above is incorrect if anyone is wondering (and it is vice-versa, ConcurrentHashMap into HashMap). Looks like Skript changed localVariables that I reflect into ConcurrentHashMap in newer versions. I updated the cast, it should work now. 🥳

Tysm so much... I will try it so happy for it

Daum bro.,... It works im so happy for it tysm

@kulkalkul
Copy link

@ItzDepstRT Alright, it is indeed about wrong cast but I was a little blind there due to reflection I made, so what I said above is incorrect if anyone is wondering (and it is vice-versa, ConcurrentHashMap into HashMap). Looks like Skript changed localVariables that I reflect into ConcurrentHashMap in newer versions. I updated the cast, it should work now. 🥳

Tysm so much... I will try it so happy for it

Daum bro.,... It works im so happy for it tysm

Haha, you're welcome. Happy to hear that! 😄

@Peezzied
Copy link

Peezzied commented May 23, 2022

@ItzDepstRT Alright, it is indeed about wrong cast but I was a little blind there due to reflection I made, so what I said above is incorrect if anyone is wondering (and it is vice-versa, ConcurrentHashMap into HashMap). Looks like Skript changed localVariables that I reflect into ConcurrentHashMap in newer versions. I updated the cast, it should work now. 🥳

This is the link to @yokunjon 's fork of Reqn (1.2.5)
https://github.com/yokunjon/reqn

The problem was fixed. All thanks to him!
However, if the content type is x-www-form-urlencoded, the problem will still occur. So change it to JSON or whatever (I haven't tried XML, HTML. JS, or Python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants