Aetolia curing system types and multi send issue.

Post Reply
Epitagh
Posts: 18
Joined: Sun Sep 19, 2010 1:26 am

Aetolia curing system types and multi send issue.

Post by Epitagh »

Okay, I am working on a system for Aetolia and I started on a theory that looks like its not going to work very well.

I was setting the system up to respond everytime the command prompt showed up and operate on diagnosing what I have every time it sees the prompt.

the problem with that is that everytime I try to cure something oftentimes it sees the prompt several more times before the cure goes through and thus tries to cure it several more times. I thought about setting it so that the moment he sends the series to cure paralyse for instance, it automatically marks the variable as cured. But then if I got stupidity or amnesia or concussion that wouldn't be the case. And I dont know how to set it so that, "paralysis == 0 unless stupid == 1".

Is there a better way to set it up or prevent the multisend?

Parnakra
Posts: 35
Joined: Tue Apr 21, 2009 10:48 am

Re: Aetolia curing system types and multi send issue.

Post by Parnakra »

The common solution to this (afaik) is sending the cure, then setting your affliction variable to a third value (so instead of 0 or 1 you'd set it to 0.5) and start a timer. If you don't get the cured message for the affliction before the timer runs out, you set the affliction variable back to 1.

Of course, as long as the variable is 0 or 0.5, you shouldn't try curing it.
Last edited by Parnakra on Mon Feb 07, 2011 12:18 pm, edited 1 time in total.

Iocun
Posts: 174
Joined: Wed Dec 02, 2009 1:45 am

Re: Aetolia curing system types and multi send issue.

Post by Iocun »

Basically, the idea is the following:
- Upon sending the cure, you'd set a first variable, e.g.: trying_to_eat = true
- Once you get confirmation from the Mud that the command has gone through (i.e. you receive the line "You eat ...") you set trying_to_eat = false again, and also set your herbbalance variable to false.
- Getting herb balance back would set your herbbalance variable to true again.

- Your curing function that is called on the prompt would first check the status of trying_to_eat and herbbalance and ONLY send a cure if trying_to_eat is false and herbbalance is true. That way, you won't ever send a cure twice before it has gone through the first time.

Additionally to this, you'd use timers to automatically set trying_to_eat to false again after a short while if you didn't get the "You eat" line for whatever reason (stupidity, amnesia, etc.), and likewise, you'd have a timer to set your herb balance to true again after a while if you don't receive the "You may eat another..." line in due time.

That's the basic principle. In practice, there are of course some different ways of achieving the same thing. Some people, for instance, do it all with a single herb balance variable that they set to 0.5 if they tried to eat the herb, but haven't got confirmation for it yet, then to 1 once they got confirmation, and to 0 once they gain herb balance back. Personally I prefer using booleans, which is why I tend to use two variables instead of a single number-based one.

EDIT: Sorry, didn't see Parnakra's reply there.

Epitagh
Posts: 18
Joined: Sun Sep 19, 2010 1:26 am

Re: Aetolia curing system types and multi send issue.

Post by Epitagh »

That makes sense, but forgive me for my ignorance but is there a tutorial for setting up such a timer? I understand the concept but doing it is another story, my knowledge of mudlet and lua is limited at best.

Parnakra
Posts: 35
Joined: Tue Apr 21, 2009 10:48 am

Re: Aetolia curing system types and multi send issue.

Post by Parnakra »

You could take a look at the manual.

Basically (barring any checks to see if the timer's already running) you'd do something like this:

Code: Select all

tempTimer(2, [[checkTimeOut()]])

Code: Select all

function checkTimeOut()
   if affliction == 0.5 then
      echo("2 seconds have passed and haven't gotten the cured line yet")
      affliction = 1
   end
end

Epitagh
Posts: 18
Joined: Sun Sep 19, 2010 1:26 am

Re: Aetolia curing system types and multi send issue.

Post by Epitagh »

I will admit I am slow. Programming languages and this sort of thing frustrate me. I have checked the manual but I wasn't sure what kind of timer you meant, tea or the actual timer tab.

I had to modify it to work with my system, but your suggestion worked great.

Instead of making a new thread I am just going to ask all my questions here.

I was told it was easier to work with tables with mudlet then five million true false conditions. I was reading a thread on how to set up the tables, but not how to use them. And after running through the manual five times I still can't find the commands I need. Mind you, I might have just missed them in which case I apologize.

But from my understanding I want to make several tables, one for the afflictions I have.

so something like HaveAffils ={}

one for the true false variables affil = {stupid = nil}

one for priority valueaffil = {stupid = 9}

one for cures cureaffil = {stupid = {"goldenseal", "tree"} }

and one for Balances = {eat = {balance = true, eating = false}}

With enough browsing the forums I think I could get the correct format of the tables down, but I dont know how to piece them together. The thread I was looking at never said how to use them just how to set them up.

Anyone able to give me a little advice where to learn about this?

User avatar
Omni
Posts: 131
Joined: Fri Feb 12, 2010 10:26 am

Re: Aetolia curing system types and multi send issue.

Post by Omni »

I recommend looking over the code of kaues' Earthshaker and Jules Mantis systems to see how they did things. Earthshaker is for Aetolia and Mantis for Lusternia.

Post Reply