Or, u can just select the item whenever ge is open, assuming its note/stacked, it would automatically set the amount in ge to full.
if(item != null){
//checks and etc.
if(item.interact()){
//conditionalsleep
}
}
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?
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)