Autosipper

by Thorgal

Back to Mechanic's Corner.

Thorgal2004-10-31 17:47:53
This simple autosipper will sip if your mana or health drops below the @siphealth or @sipmana variables, just type sipmana=blah and siphealth=blah to set them to your liking, it'll even fix itself when something interrupted the sipping, like amnesia.

#CLASS {autosipper}
#ALIAS dh {drink health;healbalance=drinking;#alarm +2 {#if @healbalance="drinking" {healbalance=yes}}}
#ALIAS dm {drink mana;healbalance=drinking;#alarm +2 {#if @healbalance="drinking" {healbalance=yes}}}
#ALIAS healing {#if (@healbalance="yes") {#if (@currenthealth<@siphealth) {dh} {#if (@currentmana<@sipmana) {dm}}}}
#VAR currenthealth {2483}
#VAR currentmana {2428}
#VAR maxhealth {2483 }
#VAR maxmana {2837 }
#VAR siphealth {1800}
#VAR sipmana {500}
#VAR healbalance {yes} {yes}
#TRIGGER {Health : (*)/(*) * Endurance : (*)/(*)} {maxhealth=%2}
#TRIGGER {Mana : (*)/(*) * Willpower : (*)/(*)} {maxmana=%2}
#TRIGGER {The potion heals and soothes you.} {healbalance=no}
#TRIGGER {You may drink another health, mana, or bromide potion.} {healbalance=yes;#gag}
#TRIGGER {Your mind feels stronger and more alert.} {healbalance=no}
#TRIGGER {(*)h, (*)m, (*)e, (*)p (*)} {currenthealth=%1;currentmana=%2;healing} "" {nocr|prompt}
#CLASS 0
Rauros2004-11-02 19:25:45
Question: Is there any chance we can gag the prompt? I have tried, but if I understand ZMUD, it needs a carriage return, which Lusternia lacks after prompts.
Daganev2004-11-02 19:29:21
You can gag any line that contains a certain word.

For example, if you gag the word "you" on accident like I once did, you'll have most of the screen gagged.
Rauros2004-11-02 19:33:02
Ok then tell me what I am doing wrong:

#TRIGGER {(*)h, (*)m, (*)e, (*)p (*)} {#gag}
Unknown2004-11-02 20:02:15
Prompt triggers require a special flag to tell zMUD not to wait for the carriage return before processing.

CODE
#TRIGGER {^%dh, %dm, %de, %dp %w} {#gag} "" {nocr|prompt}
Rauros2004-11-02 21:18:55
Post deleted because I'm an idiot, like it wasn't obvious.
Zolas2004-11-03 05:51:12
I really need to study TinyFugue's scripting system beyond being able to do: /def -t'*which quickly entangles your limbs.' writhe1 = writhe