Jump to content
  • 0

How to save TABLE?


hoangninyb

Question

5 answers to this question

Recommended Posts

1 hour ago, AKidWithMidgetFriend said:

Có thể thử ghi vào bảng trong tập lệnh thay vì để nó phụ thuộc vào việc thực thi theo cách đó bạn có thể lưu nó bằng gg .saveVariable ()

(cách sử dụng có thể được tìm thấy tại đây  https://gameguardian.net/help/classgg.html#a204f5dea60cac80c39521ceb4936a83b )

Nếu thực sự cần thiết phải đợi cho đến khi bảng được ghi vào thì bạn có thể có tập lệnh của mình

 kiểm tra chức năng cục bộ ()

 if table [1] == nil then gg .sleep (1000)

trả lại séc ()

kết thúc

khác làm

gg .saveVariable (var trong bảng của bạn)

kết thúc

kết thúc

(Kiểm tra xem có gì được ghi vào bảng hay không nếu chưa thì hãy đợi 1 giây trước khi kiểm tra lại)

Mặc dù vậy, mã này không kiểm tra xem nó đã được lưu hay chưa, vì vậy cần kiểm tra xem tệp mà nó lưu vào có hiện diện trên thiết bị hay không

I mean how to save the file containing the table with the items added!

Link to comment
Share on other sites

10 hours ago, hoangninyb said:

hiện tại khi tôi chạy script, các mục sẽ được thêm vào bảng và sẽ được hiển thị trong menu, tôi không muốn lần sau khi mở script lại phải thêm các mục nữa!

I mean even after exiting GG, then restarting!

Could try writing into the table in the script instead of having it depend on execution that way you can just save it with gg.saveVariable()

(usage can be found here https://gameguardian.net/help/classgg.html#a204f5dea60cac80c39521ceb4936a83b)

If it's absolutely necessary to wait until after the table is written into then you could have your script do

 local function checks()

 if table[1] == nil then gg.sleep(1000)

return checks()

end

else do

gg.saveVariable(your table's var)

end

end

(A check to see if anything is written into the table if not then wait 1 second before checking again)

This code doesn't check if it's already saved though so there should be a check for if the file it saves to is present on the device

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.