reqn icon indicating copy to clipboard operation
reqn copied to clipboard

Variable not working in or after

Open DEPSTRCZ opened this issue 2 years ago • 13 comments

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.

DEPSTRCZ avatar Mar 31 '22 12:03 DEPSTRCZ

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.

kulkalkul avatar Apr 01 '22 22:04 kulkalkul

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?

DEPSTRCZ avatar Apr 01 '22 22:04 DEPSTRCZ

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.

kulkalkul avatar Apr 01 '22 22:04 kulkalkul

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?

DEPSTRCZ avatar Apr 02 '22 07:04 DEPSTRCZ

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. 😄

kulkalkul avatar Apr 02 '22 10:04 kulkalkul

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 avatar Apr 02 '22 15:04 DEPSTRCZ

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

DEPSTRCZ avatar Apr 02 '22 15:04 DEPSTRCZ

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 avatar Apr 02 '22 23:04 kulkalkul

@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. 🥳

kulkalkul avatar Apr 03 '22 00:04 kulkalkul

@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 avatar Apr 03 '22 19:04 DEPSTRCZ

@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

DEPSTRCZ avatar Apr 04 '22 13:04 DEPSTRCZ

@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! 😄

kulkalkul avatar Apr 06 '22 07:04 kulkalkul

@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

Peezzied avatar May 23 '22 07:05 Peezzied