Ameroth said:
1. I essentially want to update a variable from my prompt that will say whether I have balance or not. (This cannot be found in GMCP)
You will want to make a regex to match your prompt and wrap what you want to capture in ( and ) to have it show as a backreference, which you can access in your trigger from %<br number>. There are several tutorials on PCRE on the internet, but from the prompt you offered below, ^\d+h, \d+e, \d+g (\w+) A\:50\% \-$ should work for you. I know there are several topics about regular expressions for prompt regexes on the Midkemia forums as well. Just make sure you have Regular Expression checked in the trigger. Also, as it is an IRE game, you might find "Convert IAC EOR/GA to Newline" under the output (Alt+5) menu useful, as your prompt will likely not match until the line after otherwise.
Ameroth said:
2.My second question concerns how I wish to go about defending in Midkemia.
3. As there is stupidity in MKO, that can cause commands to fail without loss of balance, I would like to know what is the easiest way to resend the last line (or possible two lines) of text sent as output.
Question two, I'm having a bit of issue reading your specifications, so I'll answer that later if I can manage it.
Question three, I have the same issue in Lusternia as well. The way I overcame it is marking that I tried a balance without losing it that prevents that balance from being used, and having a timer reset that tried-state after 1-1.5 seconds if it fails so the action can be retried. There are many ways of doing this other than a tried-state, but you will find that that is one of the more common ways of overcoming that issue.
Ameroth said:
4
This is a common issue for most Iron Realms games, including Midkemia. Assuming you're using Lua (though this can easily be changed to fit other languages), have a table of afflictions set to (true/false, 1/0, et cetera). On prompt, you can run a function that checks if you have certain afflictions, and if you don't, cycles through the table of afflictions and cures them in a certain order if you have them.
for example (in Lua. I do not recommend using this code in your system, but the concept may help you):
affTable = {stupidity = false, concussion = false}
function cureFocus()
if affTable["concussion"] and balTable["focus"] == 1 then
return
end
if affTable["stupidity"] == true then
Send("focus mind")
end
end
If I may make a recommendation: These questions have been asked dozens of times before, both on this forum and on the forums of games made by the company who makes Midkemia (and including the forums of Midkemia). The search function on all of these will likely lead you to threads that ask and have answered the same questions, and likely to code of other people's systems and scripts that you can go through and study to understand the basic methods many, if not all, of these systems and scripts use to solve these problems. |