A Few Random Questions.

finaltidus

New member
So I recently started to do some scripting and I have a few random questions from things I have run into:


How do I actually make and use a daily variable? Right now I am just using static {stuff} but that resets on a new session.

Is it more or less efficient to use a script to upkeep buffs (like, if have effect < 1, use x item) or a mood, or does it not matter at all? I am just using a pre adv. script at the moment.

When storing an array with multiple bits of data I am using this: itemList[$item[Knob Goblin nasal spray]][10][30.0] = 0; Is this fine to do or are their more effective ways to do this? I have just been using it this way because it was the first thing I found out about.

When I am using cli_execute("synthesize greed"); in a script is their anyway that I can make it prefer specific items? I want to use all my sugar breakables (other than sugar shield) from my robortender first.

Thanks for any help you have. (Also I had no idea I made an acct here before until I just tried to make one today, neat.)
 

theo1001

Member
So I recently started to do some scripting and I have a few random questions from things I have run into:


How do I actually make and use a daily variable? Right now I am just using static {stuff} but that resets on a new session.

You can use get_property and set_property to get/set properties that persist through sessions. Having the property name start with "_" (e.g _coldOne) will turn it into a daily property.

Is it more or less efficient to use a script to upkeep buffs (like, if have effect < 1, use x item) or a mood, or does it not matter at all? I am just using a pre adv. script at the moment.

No idea.

When storing an array with multiple bits of data I am using this: itemList[$item[Knob Goblin nasal spray]][10][30.0] = 0; Is this fine to do or are their more effective ways to do this? I have just been using it this way because it was the first thing I found out about.

I guess you could also use a record.

A hastily made example:
PHP:
record item_info {
    item it;
    int duration;
    float something;
};

item_info[int] itemList;
item_info temp;
temp.it = $item[Knob Goblin nasal spray];
temp.duration = 10;
temp.something = 30.0;
itemList[0] = temp;

When I am using cli_execute("synthesize greed"); in a script is their anyway that I can make it prefer specific items? I want to use all my sugar breakables (other than sugar shield) from my robortender first.

Thanks for any help you have. (Also I had no idea I made an acct here before until I just tried to make one today, neat.)

You could check if you have the candies you want to use and then use sweet_synthesis( item, item) to have it synthesize using those specific candies.

sweet_synthesis_pairing( effect, item ) (e.g "sweet_synthesis_pairing( $effect[Synthesis: Greed], $item[sugar shield])") will return a list of all candies that result in Synthesis: Greed when paired with sugar shield.
 
Top