gxc
New member
I apologize for my lack of knowledge. This is an accumulation of questions.
I'd like to create a script that allows random adventuring in certain places until certain conditions are met, but I have no idea how to loop it. The loop would need to run at least once, and check the conditions (in this case a certain level) after each adventure.
Also, several questions about strings. My questions, numbered:
1. How do I create a loop that would check conditions generated through CLI (as in not add_item_condition(), more like level or meat)? And would the loop similarly the same if I used add_item_condition()? I was thinking something along the lines of "conditions list" or something, but I have no clue.
--Answered, normal programming loops appear to be easier to use than CLI conditions.
2. Are strings dynamic? That is, can I change a string after it has been defined (as I do in the script above)? In Java there's some extra work that goes into changing a string that has already been defined.
--Answered - I think, just use the individual datatype constants, which appear to be dynamic.
3. How easy is string concatenation? Would it be this easy?
--Answered - lol yes
4. Suppose that the user is running this to gain quite a few items or levels or meat or whatever, something that will take at least two days, but the user wants to run this in conjunction with several other cooking, cocktailing, whatever scripts. Can a script like this be reused without redoing initial conditions?
After the first run, the user has the meat and and some of the items. If the user runs again later with more adventures without losing the meat or the items, are those conditions already filled?
5. In this random loop, if I'd like to check HP/MP/Effect and included it at the end of every loop, would that ping the server each time I requested those values or does it check it with a value already stored from the end of combat? The next question might nullify this one, if there are autorecover functions that don't require constant monitoring.
6. (Not a random adventure question) If I'm adventuring using "adventure(my_adventures(), $location[loc])", how do I monitor HP/MP/Effects? Is that programmed into KoL Mafia? Would I set some autorecover values earlier that would be monitored while autoadventuring?
More questions at bottom.
I'd like to create a script that allows random adventuring in certain places until certain conditions are met, but I have no idea how to loop it. The loop would need to run at least once, and check the conditions (in this case a certain level) after each adventure.
Code:
cli_execute("conditions clear");
cli_execute("conditions level x");
int ranNum;
string loc;
## Place loop here.
ranNum = random();
if(ranNum<=(1/3)){
loc = "place 1";
} else if (ranNum<=(2/3)){
loc = "place 2";
} else if(ranNum<=1){
loc = "place 3";
}
adventure(1, $location[loc]);
## loop ends here
Also, several questions about strings. My questions, numbered:
--Answered, normal programming loops appear to be easier to use than CLI conditions.
--Answered - I think, just use the individual datatype constants, which appear to be dynamic.
Code:
int intLevel = 5;
string condition = "conditions level " + intLevel;
cli_execute(conditions)
Code:
cli_execute("conditions clear");
cli_execute("conditions level x");
cli_execute("conditions add x meat");
add_item_condition(x, $item[some item]);
More questions at bottom.