Atreus2005-09-16 01:55:44
I just logged onto Lusternia and found my settings file corrupted, so I lost everything in my settings file but I had just put these aliases in, and they messed up BAD. I don't understand what I'm doing wrong here, so please help me out.
Here's how it works. Or is supposed to work.
On AFFLICTION MSG
*Adds the affliction to the Afflictions List. (@Afflictions)
*Runs CheckAfflictions Alias - Adds the Herb for the respective affliction to HerbQueue.
On PROMPT...
*Runs HerbQueueCheck>If all goes well in HerbQueueCheck, then EatHerb is run.
On EATEN HERB
*Uses %delitem to remove the Herb from @HerbQueue
On CURED MSG
*Uses #delitem to remove affliction from @Afflictions
I am at a complete loss anymore. In the past three days I've spent about 25-30 hours putting together a system that utterly BOMBED on me. Even before the file got corrupted and it got entirely . I told you all somewhere that I get frustrated... ohhh I'm at my peak right now and about ready to throw my computer in the garbage.
Help the smiley on the right! Be the one on the left!
CODE
#CLASS HEALING ALIASES
#AL HerbQueueCheck {#IF {@HerbBalance = 0} {#ECHO HerbBalance GO!} {#IF {@Asleep = 0} {#ECHO Asleep GO!} {#IF {@Stunned = 0} {#ECHO Stunned GO!} {#IF {@Aeoned = 0} {#ECHO Aeoned GO!} {EatHerb} {#ECHO Aeoned FAILED!}} {#ECHO Stunned FAILED!}} {#ECHO Asleep FAILED!}} {#ECHO HerbBalance FAILED!}}
#AL EatHerb {#VAR HerbToEat %item(@HerbQueue, 1);#IF {%ismember("Stupidity",@Afflictions)} {Outr @HerbToEat;Outr @HerbToEat;Eat @HerbToEat;Eat @HerbToEat;#VAR HerbBalance "0.5";#ALARM +1.5 {#IF {@HerbBalance = "0.5"} {HerbBalance = 0;#ECHO HerbBalance NOT Regained! Resetting!}}} {Outr @HerbToEat;Eat @HerbToEat;#VAR HerbBalance "0.5";#ALARM +3 {#IF {@HerbBalance = "0.5"} {HerbBalance = 0;#ECHO HerbBalance NOT Regained! Resetting!}}}}
#AL CheckAfflictions {#IF {%ismember( "Stupidity", @Afflictions)} {#VAR HerbQueue %additem( "Pennyroyal", @HerbQueue)} {#IF {%ismember( "Oily", @Afflictions)} {#VAR HerbQueue %additem( "Calamus", @HerbQueue)} {#IF {%ismember( "SlicedForehead", @Afflictions)} {#VAR HerbQueue %additem( "Yarrow", @HerbQueue)} {#IF {%ismember( "SlicedGut", @Afflictions)} {#VAR HerbQueue %additem( "Yarrow", @HerbQueue)} {#IF {%ismember( "LeftArmArtery", @Afflictions)} {#VAR HerbQueue %additem( "Yarrow", @HerbQueue)} {#IF {%ismember( "RightArmArtery", @Afflictions)} {#VAR HerbQueue %additem( "Yarrow", @HerbQueue)} {#IF {%ismember( "LeftLegArtery", @Afflictions)} {#VAR HerbQueue %additem( "Yarrow", @HerbQueue)} {#IF {%ismember( "RightLegArtery", @Afflictions)} {#VAR HerbQueue %additem( "Yarrow", @HerbQueue)} {#IF {%ismember( "SlicedEar", @Afflictions)} {#VAR HerbQueue %additem( "Marjoram", @HerbQueue)} {#IF {%ismember( "Clumsy", @Afflictions)} {#VAR HerbQueue %additem( "Kombu", @HerbQueue)} {#IF {%ismember( "Confused", @Afflictions)} {#VAR HerbQueue %additem( "Pennyroyal", @HerbQueue)} {#IF {%ismember( "Hallucinating", @Afflictions)} {#VAR HerbQueue %additem( "Pennyroyal", @HerbQueue)} {#IF {%ismember( "Reckless", @Afflictions)} {#VAR HerbQueue %additem( "Horehound", @HerbQueue)} {#IF {%ismember( "Epileptic", @Afflictions)} {#VAR HerbQueue %additem( "Pennyroyal", @HerbQueue)} {#IF {%ismember( "Relapsing", @Afflictions)} {#VAR HerbQueue %additem( "Yarrow", @HerbQueue)} {#IF {%ismember( "Justice", @Afflictions)} {#VAR HerbQueue %additem( "Reishi", @HerbQueue)} {#IF {%ismember( "Paranoid", @Afflictions)} {#VAR HerbQueue %additem( "Kombu", @HerbQueue)} {#IF {%ismember( "Dizzy", @Afflictions)} {#VAR HerbQueue %additem( "Kombu", @HerbQueue)}}}}}}}}}}}}}}}}}}}
#AL HerbQueueCheck {#IF {@HerbBalance = 0} {#ECHO HerbBalance GO!} {#IF {@Asleep = 0} {#ECHO Asleep GO!} {#IF {@Stunned = 0} {#ECHO Stunned GO!} {#IF {@Aeoned = 0} {#ECHO Aeoned GO!} {EatHerb} {#ECHO Aeoned FAILED!}} {#ECHO Stunned FAILED!}} {#ECHO Asleep FAILED!}} {#ECHO HerbBalance FAILED!}}
#AL EatHerb {#VAR HerbToEat %item(@HerbQueue, 1);#IF {%ismember("Stupidity",@Afflictions)} {Outr @HerbToEat;Outr @HerbToEat;Eat @HerbToEat;Eat @HerbToEat;#VAR HerbBalance "0.5";#ALARM +1.5 {#IF {@HerbBalance = "0.5"} {HerbBalance = 0;#ECHO HerbBalance NOT Regained! Resetting!}}} {Outr @HerbToEat;Eat @HerbToEat;#VAR HerbBalance "0.5";#ALARM +3 {#IF {@HerbBalance = "0.5"} {HerbBalance = 0;#ECHO HerbBalance NOT Regained! Resetting!}}}}
#AL CheckAfflictions {#IF {%ismember( "Stupidity", @Afflictions)} {#VAR HerbQueue %additem( "Pennyroyal", @HerbQueue)} {#IF {%ismember( "Oily", @Afflictions)} {#VAR HerbQueue %additem( "Calamus", @HerbQueue)} {#IF {%ismember( "SlicedForehead", @Afflictions)} {#VAR HerbQueue %additem( "Yarrow", @HerbQueue)} {#IF {%ismember( "SlicedGut", @Afflictions)} {#VAR HerbQueue %additem( "Yarrow", @HerbQueue)} {#IF {%ismember( "LeftArmArtery", @Afflictions)} {#VAR HerbQueue %additem( "Yarrow", @HerbQueue)} {#IF {%ismember( "RightArmArtery", @Afflictions)} {#VAR HerbQueue %additem( "Yarrow", @HerbQueue)} {#IF {%ismember( "LeftLegArtery", @Afflictions)} {#VAR HerbQueue %additem( "Yarrow", @HerbQueue)} {#IF {%ismember( "RightLegArtery", @Afflictions)} {#VAR HerbQueue %additem( "Yarrow", @HerbQueue)} {#IF {%ismember( "SlicedEar", @Afflictions)} {#VAR HerbQueue %additem( "Marjoram", @HerbQueue)} {#IF {%ismember( "Clumsy", @Afflictions)} {#VAR HerbQueue %additem( "Kombu", @HerbQueue)} {#IF {%ismember( "Confused", @Afflictions)} {#VAR HerbQueue %additem( "Pennyroyal", @HerbQueue)} {#IF {%ismember( "Hallucinating", @Afflictions)} {#VAR HerbQueue %additem( "Pennyroyal", @HerbQueue)} {#IF {%ismember( "Reckless", @Afflictions)} {#VAR HerbQueue %additem( "Horehound", @HerbQueue)} {#IF {%ismember( "Epileptic", @Afflictions)} {#VAR HerbQueue %additem( "Pennyroyal", @HerbQueue)} {#IF {%ismember( "Relapsing", @Afflictions)} {#VAR HerbQueue %additem( "Yarrow", @HerbQueue)} {#IF {%ismember( "Justice", @Afflictions)} {#VAR HerbQueue %additem( "Reishi", @HerbQueue)} {#IF {%ismember( "Paranoid", @Afflictions)} {#VAR HerbQueue %additem( "Kombu", @HerbQueue)} {#IF {%ismember( "Dizzy", @Afflictions)} {#VAR HerbQueue %additem( "Kombu", @HerbQueue)}}}}}}}}}}}}}}}}}}}
Here's how it works. Or is supposed to work.
On AFFLICTION MSG
*Adds the affliction to the Afflictions List. (@Afflictions)
*Runs CheckAfflictions Alias - Adds the Herb for the respective affliction to HerbQueue.
On PROMPT...
*Runs HerbQueueCheck>If all goes well in HerbQueueCheck, then EatHerb is run.
On EATEN HERB
*Uses %delitem to remove the Herb from @HerbQueue
On CURED MSG
*Uses #delitem to remove affliction from @Afflictions
I am at a complete loss anymore. In the past three days I've spent about 25-30 hours putting together a system that utterly BOMBED on me. Even before the file got corrupted and it got entirely . I told you all somewhere that I get frustrated... ohhh I'm at my peak right now and about ready to throw my computer in the garbage.
Help the smiley on the right! Be the one on the left!
Atreus2005-09-17 08:47:16
Hey. I understand if no one wants to help me with this, but I'd appreciate it if some more experienced system makers would comment about the style of this or... something? I don't care if you help me with the actual code... is this a good idea and start for a system or should I rework my entire thinking about how to make a system?
Unknown2005-09-17 15:27:25
There are many ways to process afflictions and send the cures, as we all know. I've been experimenting a lot with code lately (mainly for Achaea), and here's something I've found that works fairly well (so far).
Please excuse the Achaean cures, and I hope you get the basic idea. Also, not all afflictions and cures are here, obviously. It's just a sample taken from my web journal to illustrate.
I've left out the code that sets the flags for eating an herb or the lost balance flag. The acp_eat alias does the outr/outb and eats the herb. I like this not only because it's fairly quick, but also because it's extremely flexible and easy to modify, even during combat, if you have macros and triggers setup to replace the order of afflictions.
Please excuse the Achaean cures, and I hope you get the basic idea. Also, not all afflictions and cures are here, obviously. It's just a sample taken from my web journal to illustrate.
CODE
#VAR HerbAfflictions {asthma|slickness|hypochondria|paralysis}
#VAR HerbCures {}
#ADDKEY HerbCures {asthma} Â Â Â {kelp}
#ADDKEY HerbCures {hypochondria} {kelp}
#ADDKEY HerbCures {paralysis} Â Â {bloodroot}
#ADDKEY HerbCures {slickness} Â Â {bloodroot}
#VAR HerbQueue {} {}
#ALIAS acp_herbcure {
 #if (%1) {
  acp_eat <%db(@HerbCures,<%-1>)>
 } {
  #if (!@Flags.paused and
    !@LostBalances.herb and
    !@Flags.eating_herb) {
   #var HerbQueue ""
   #loopdb @Afflictions {
    #additem HerbQueue %ismember(%key, @HerbAfflictions)
   }
   #delitem HerbQueue 0
   #var HerbQueue {%sort(@HerbQueue)}
   acp_herbcure %item(@HerbAfflictions, %item(@HerbQueue, 1))
  }
 }
}
#VAR HerbCures {}
#ADDKEY HerbCures {asthma} Â Â Â {kelp}
#ADDKEY HerbCures {hypochondria} {kelp}
#ADDKEY HerbCures {paralysis} Â Â {bloodroot}
#ADDKEY HerbCures {slickness} Â Â {bloodroot}
#VAR HerbQueue {} {}
#ALIAS acp_herbcure {
 #if (%1) {
  acp_eat <%db(@HerbCures,<%-1>)>
 } {
  #if (!@Flags.paused and
    !@LostBalances.herb and
    !@Flags.eating_herb) {
   #var HerbQueue ""
   #loopdb @Afflictions {
    #additem HerbQueue %ismember(%key, @HerbAfflictions)
   }
   #delitem HerbQueue 0
   #var HerbQueue {%sort(@HerbQueue)}
   acp_herbcure %item(@HerbAfflictions, %item(@HerbQueue, 1))
  }
 }
}
I've left out the code that sets the flags for eating an herb or the lost balance flag. The acp_eat alias does the outr/outb and eats the herb. I like this not only because it's fairly quick, but also because it's extremely flexible and easy to modify, even during combat, if you have macros and triggers setup to replace the order of afflictions.
Atreus2005-09-17 21:41:34
QUOTE(Zarquan @ Sep 17 2005, 10:27 AM)
There are many ways to process afflictions and send the cures, as we all know. I've been experimenting a lot with code lately (mainly for Achaea), and here's something I've found that works fairly well (so far).
Please excuse the Achaean cures, and I hope you get the basic idea. Also, not all afflictions and cures are here, obviously. It's just a sample taken from my web journal to illustrate.
I've left out the code that sets the flags for eating an herb or the lost balance flag. The acp_eat alias does the outr/outb and eats the herb. I like this not only because it's fairly quick, but also because it's extremely flexible and easy to modify, even during combat, if you have macros and triggers setup to replace the order of afflictions.
Please excuse the Achaean cures, and I hope you get the basic idea. Also, not all afflictions and cures are here, obviously. It's just a sample taken from my web journal to illustrate.
CODE
#VAR HerbAfflictions {asthma|slickness|hypochondria|paralysis}
#VAR HerbCures {}
#ADDKEY HerbCures {asthma} Â Â Â {kelp}
#ADDKEY HerbCures {hypochondria} {kelp}
#ADDKEY HerbCures {paralysis} Â Â {bloodroot}
#ADDKEY HerbCures {slickness} Â Â {bloodroot}
#VAR HerbQueue {} {}
#ALIAS acp_herbcure {
 #if (%1) {
  acp_eat <%db(@HerbCures,<%-1>)>
 } {
  #if (!@Flags.paused and
    !@LostBalances.herb and
    !@Flags.eating_herb) {
   #var HerbQueue ""
   #loopdb @Afflictions {
    #additem HerbQueue %ismember(%key, @HerbAfflictions)
   }
   #delitem HerbQueue 0
   #var HerbQueue {%sort(@HerbQueue)}
   acp_herbcure %item(@HerbAfflictions, %item(@HerbQueue, 1))
  }
 }
}
#VAR HerbCures {}
#ADDKEY HerbCures {asthma} Â Â Â {kelp}
#ADDKEY HerbCures {hypochondria} {kelp}
#ADDKEY HerbCures {paralysis} Â Â {bloodroot}
#ADDKEY HerbCures {slickness} Â Â {bloodroot}
#VAR HerbQueue {} {}
#ALIAS acp_herbcure {
 #if (%1) {
  acp_eat <%db(@HerbCures,<%-1>)>
 } {
  #if (!@Flags.paused and
    !@LostBalances.herb and
    !@Flags.eating_herb) {
   #var HerbQueue ""
   #loopdb @Afflictions {
    #additem HerbQueue %ismember(%key, @HerbAfflictions)
   }
   #delitem HerbQueue 0
   #var HerbQueue {%sort(@HerbQueue)}
   acp_herbcure %item(@HerbAfflictions, %item(@HerbQueue, 1))
  }
 }
}
I've left out the code that sets the flags for eating an herb or the lost balance flag. The acp_eat alias does the outr/outb and eats the herb. I like this not only because it's fairly quick, but also because it's extremely flexible and easy to modify, even during combat, if you have macros and triggers setup to replace the order of afflictions.
187771
Thanks for the input, it's really appreciated. I have a few questions though, about the coding involved with this... What is "#if (%1)"? What does it do, rather?
And "acp_eat <%db(@HerbCures,<%-1>)>" what does that do?
Everything else I pretty much understand.
Xavius2005-09-18 07:08:22
It's an example of cheating the system, really. #if is a command to check truth. If a statement is resolved as true, the system returns a non-zero (traditionally 1) response. If false, 0 is returned. You can use #if with a manually set variable to simply turn things off and on.
It's been a while since I looked at the ACP, but I think acp_eat is just outr, eat, and a variable adjustment.
It's been a while since I looked at the ACP, but I think acp_eat is just outr, eat, and a variable adjustment.
Unknown2005-09-18 14:00:04
I use #if (%1) to check for a parameter. If no parameter is passed, %1 is null and the test fails.
The acp_eat alias does just outr and eat an herb, so the <%db(@HerbCures,<%-1>)> part is just expanding the parameters and doing the lookup for which herb cures the affliction passed in. The acp_herbcure alias is recursive, calling itself automatically when no parameter is passed in. With a parameter, it could be used by a semi-manual healer to lookup the cure for paralysis, by doing "acp_herbcure paralysis" and not having to remember the herbs. Without the parameter, it searches all your afflictions, prioritizes them, and executes the cure for the first one.
The <> just forces expansion of any variables or function calls being passed in. Without them, it gives you garbage because it will use the value literally and that's not what I intended.
The acp_eat alias does just outr and eat an herb, so the <%db(@HerbCures,<%-1>)> part is just expanding the parameters and doing the lookup for which herb cures the affliction passed in. The acp_herbcure alias is recursive, calling itself automatically when no parameter is passed in. With a parameter, it could be used by a semi-manual healer to lookup the cure for paralysis, by doing "acp_herbcure paralysis" and not having to remember the herbs. Without the parameter, it searches all your afflictions, prioritizes them, and executes the cure for the first one.
The <> just forces expansion of any variables or function calls being passed in. Without them, it gives you garbage because it will use the value literally and that's not what I intended.