Olyno/skent

Cannot append because of async.

Misio12320 opened this issue · 2 comments

Describe your problem

The problem is I would like to right click a sign to append the text of lines with data into txt file.

Versions

Skript: [19:02:41 INFO]: Skript version 2.5.3
Server: [19:03:52 INFO]: This server is running Purpur version git-Purpur-1001 (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)
Skent: [19:03:01 INFO]: Skent version 2.1.0

Code

on rightclick on any sign:
	if file path "Gracze/Folder Gracza: %player%/Tabliczki gracza/Stare tabliczki.txt" is missing:
		create file path "Gracze/Folder Gracza: %player%/Tabliczki gracza/Stare tabliczki.txt"
	else:
		set {_now} to now formatted as "[dd.MM.yyyy HH:mm:ss]"
		wait 3 tick
		set {_loc} to "<x: %x-loc of event-block%; y: %y-loc of event-block%; z: %z-loc of event-block%; świat: %event-block's world%>"
		wait 3 ticks
		append "%{_now}%" to file path "Gracze/Folder Gracza: %player%/Tabliczki gracza/Stare tabliczki.txt"
		wait 3 ticks
		append "%{_loc}%" to file path "Gracze/Folder Gracza: %player%/Tabliczki gracza/Stare tabliczki.txt"
		wait 3 ticks
		set {_1} to line 1 of clicked block
		wait 3 ticks
		append "- %{_1}%" to file path "Gracze/Folder Gracza: %player%/Tabliczki gracza/Stare tabliczki.txt":
			wait 3 ticks
			set {_2} to line 2 of clicked block
			wait 3 ticks
			append "- %{_2}%" to file path "Gracze/Folder Gracza: %player%/Tabliczki gracza/Stare tabliczki.txt":
				wait 3 ticks
				set {_3} to line 3 of clicked block
				wait 3 ticks
				append "- %{_3}%" to file path "Gracze/Folder Gracza: %player%/Tabliczki gracza/Stare tabliczki.txt":
					wait 3 ticks
					set {_4} to line 4 of clicked block
					wait 3 ticks
					append "- %{_4}%" to file path "Gracze/Folder Gracza: %player%/Tabliczki gracza/Stare tabliczki.txt"

Error

None. Reported also to Skript's Github -> SkriptLang/Skript#3808
Result:
`

`

Olyno commented

Thanks you for the report. Please stop being lazy and put versions when I'm asking them in the template, it able me to debug it easily.
As I said in the other issue, this is not a Skent related issue. Skript is really bad with async stuff, and local variables are deleted due to that. Please wait a fix from Skript.

Sorry I do not understand the format from docs too. Weird because I have wrote the versions and somehow it replaced into link. Updated
Alright! Let's wait.