Help With A Curing System Problem

Post Reply
User avatar
Jules
Posts: 118
Joined: Sun Oct 11, 2009 5:41 pm
Location: Plymouth State University - Sophomore

Help With A Curing System Problem

Post by Jules »

I know that it's a vague title, but it's the best I could come up with... Feel free, admins, to change it to something more appropriate.

Anyhow, my question. Within Lusternia, there's an affliction called "Confusion", which sometimes prevents commands that you send from being done, because, well, you're too confused to do it. This is easily cured by eating Pennyroyal. Now, because of the nature of "Confusion", sometimes when I go to remove the Pennyroyal from my Rift, or when I go to eat it, the command doesn't fire because, again, I'm "too confused" to do it.

I've been looking through the Official Lusternia forums, and I came across http://forums.lusternia.com/index.php?showtopic=1445, which is a sort of guide on how to build a curing system. The language is written in ZScript, but it's fairly easy to follow regardless.

Now, scrolling down, we see an alias that this person made regarding eating Pennyroyal. It basically states:
  1. Take the herb from your rift and eat it.
  • Set the herbbalance variable to 0.5
  • Fire off a timer, that after 1 second, if herbbalance == 0.5 then set herbbalance =1
However, if it didn't go off, and you're still stupid, it loops the alias "herbqueue" again to cure stupidity.

How do I go about setting up a script to do exactly that?

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Help With A Curing System Problem

Post by Vadi »

Code: Select all

--Take the herb from your rift and eat it.
send ("outr herb")
send("eat herb")

-- Set the herbbalance variable to 0.5
herbbalance = 0.5

-- Fire off a timer, that after 1 second, if herbbalance == 0.5 then set herbbalance =1
tempTimer(1, [[if herbbalance == 0.5 then herbbalance = 1 else expandAlias("herbqueue") end]])

Of course, herbqueue should not be an alias but a function, so you'd just do herbqueue() ;)

User avatar
Jules
Posts: 118
Joined: Sun Oct 11, 2009 5:41 pm
Location: Plymouth State University - Sophomore

Re: Help With A Curing System Problem

Post by Jules »

Oh, well, that wasn't as painful as I though! Thank you, Vadi!

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Help With A Curing System Problem

Post by Vadi »

No problem. It'll get easier as you go on and will be able to translate other concepts into code.

Post Reply