Jump to content

Script cached files , variables?


Pegasus

Recommended Posts

does script cached files , variables?

my private script made by myself read and write text file and bot according to the file, without gui.

sometimes my private script is seem to cache files/variable and cannot run properly.

I need to refresh script selector everytime? or what can I do?

Edited by Pegasus
Link to comment
Share on other sites

21 minutes ago, Pegasus said:

does script cached files , variables?

my private script made by myself read and write text file and bot according to the file, without gui.

sometimes my private script is seem to cache files/variable and cannot run properly.

I need to refresh script selector everytime? or what can I do?

Depends on who made u the script, ask him, usually if it loads from textfile doesn't need, not sure, but its better always to refresh(personal preference)

Link to comment
Share on other sites

14 minutes ago, progamerz said:

Depends on who made u the script, ask him, usually if it loads from textfile doesn't need, not sure, but its better always to refresh(personal preference)

my private script made by myself

yes , it load from text file.

There are some static variable in my script, is it the reason?

Troublesome to refresh every times.

it takes a few seconds to finishing refresh.

Edited by Pegasus
Link to comment
Share on other sites

1 minute ago, Pegasus said:

my private script made by myself

yes , it load from text file.

There are some static variable in my script, is it the reason?

Usually i don't think that can be the cause, but maybe on the "onExit()" reset the values of the variables, even tho if u always reload settings from .txt this shouldn't be the problem, not sure what u can do other than that, if u refresh in the script selector does the script work?

Link to comment
Share on other sites

Just now, progamerz said:

Usually i don't think that can be the cause, but maybe on the "onExit()" reset the values of the variables, even tho if u always reload settings from .txt this shouldn't be the problem, not sure what u can do other than that, if u refresh in the script selector does the script work?

yes , it works after refresh the script.

Link to comment
Share on other sites

14 hours ago, Pegasus said:

Thanks Chris

Should I make all variables be non-static or just the one which affect the script?

Make them all non-static, except for constants, which you can leave as static, but you should also make them final.

There's very rarely a good reason to be using static, and it just causes a lot of pain.

Edited by Explv
Link to comment
Share on other sites

3 hours ago, Explv said:

:???:

Wat?

public class Vars {

    private Vars() {}
    private static final Vars VARS = new Vars();
    public static Vars get() { return VARS; }
	
	public String status;
	
	public int boneCount, deathCount;

}

Can then just call Vars.get().status and the instance is individual, while still having all my Variables are stored in one location. Constants are kept static like you said though.

Edited by HeyImJamie
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...