Weeviling / Sipping

by Kharaen

Back to Mechanic's Corner.

Kharaen2006-09-27 23:26:57
This is my Weeviling and Sipping systems. I wonder if they're as good as they can be? Any suggestions for improvement is definately welcome.


This is my sipping...
CODE

#CLASS {Autosipping}
#VAR HEALBAL {1}
#VAR END {18080}
#VAR SIPHP {700}
#VAR SIPMP {650}
#VAR HP {3836}
#VAR MAXHP {3836}
#VAR MP {3020}
#VAR MAXMP {3020}
#VAR WLL {14000}
#VAR MAXWLL {8560}
#VAR EGO {2816}
#VAR MAXEGO {2816}
#VAR POW {10}
#VAR MAXEND {18080}
#VAR sipego {600}
#VAR standing {1} {1}
#VAR blind {1} {1}
#TRIGGER {^You may drink another health, mana, or bromide potion.$} {healbal=1}
#TRIGGER {^The potion flows down your throat without effect.$} {healbal=0}
#TRIGGER {^  Health : (%d)/(%d) } {HP=%1;MAXHP=%2}
#TRIGGER {^(%d)h, (%d)m, (%d)e, (%d)p, (%d)en, (%d)w (*)~-$} {HP=%1;MP=%2;EGO=%3;POW=%4;END=%5;WLL=%6;#if (@MAXHP - @HP > @SIPHP and @HEALBAL=1) {dh} {#if (@MAXMP - @MP > @SIPMP and @HEALBAL=1) {dm} {#if (@maxego - @ego > @sipego and @healbal=1) {db}}};#if (%7=exkp & @standing=1) {stand} {#if (%7=exkbp) {stand} {#if (%7=exkdp) {stand} {#if (%7=exdp) {stand} {#if (%7=exp) {stand} {#IF (%7=exkdbp) {stand} {#if (%7=exkdbp & @standing=1) {stand}}}}}}};#if (%7=exkb) {blind=0} {#if (%7=exb) {blind=0} {#IF (%7=exkbp) {blind=0}}}} "" {nocr|prompt}
#TRIGGER {^The potion heals and soothes you.$} {healbal=0}
#TRIGGER {^  Mana   : (%d)/(%d)} {MP=%1;MAXMP=%2}
#TRIGGER {^  Ego    : (%d)/(%d)} {EGO=%1;MAXEGO=%2}
#TRIGGER {       Willpower : (%d)/(%d)$} {WLL=%1;MAXWLL=%2}
#TRIGGER {Reserves  : (%d)~%$} {POW=%1}
#TRIGGER {Endurance : (%d)/(%d)$} {END=%1;MAXEND=%2}
#TRIGGER {^Your mind feels stronger and more alert.$} {healbal=0}
#TRIGGER {^You may use another health, mana, or bromide potion, or medicine bag.$} {healbal=1}
#TRIGGER {^Ah, the soothing bromides help strengthen your ego.$} {healbal=0}
#TRIGGER {^You stand up and stretch your arms out wide.$} {standing=0;#alarm +1 {standing=1}}
#ALIAS ahh {apply healing to head;healbal=0.5;#alarm +1 {#IF (@healbal=0.5) {healbal=1}}}
#ALIAS dm {drink mana;healbal=0.5;#alarm +1 {#IF (@healbal=0.5) {healbal=1}}}
#ALIAS dh {drink health;healbal=0.5;#alarm +1 {#IF (@healbal=0.5) {healbal=1}}}
#ALIAS db {drink bromide;healbal=0.5;#ALARM +1 {#IF (@healbal=0.5) {healbal=1}}}
#CLASS {0}


This is my weeviling/ratting...
CODE

#CLASS {Vermin}
#STAT {||}
#STW {+---------------------+%{cr}| TIME : @time .....| %{cr}+---------------------+---------------------+%{cr}| Weevils!............| Rats!...............|%{cr}+---------------------+---------------------+%{cr}| Large Woods...: @lwoods | Baby Rats ....: @brats |%{cr}| Lumbering Reds: @lreds | Young Rats ...: @yrats |%{cr}| Giant Reds ...: @greds | Rats .........: @rats |%{cr}| Fat Greens....: @fgreens | Old Rats .....: @orats |%{cr}| Hulking Greens: @hgreens | Black Rats ...: @blrats |%{cr}+---------------------+---------------------+%{cr}| Total Weevil : @totweevils | Total Rats...: @totalrats |%{cr}| Total Value .: @totvalue | Total Value..: @ratvalue |%{cr}+-------------------------------------------+%{cr}| Current Target: @tg |%{cr}+-------------------------------------------+}
#CLASS 0
#CLASS {Vermin|Weevils}
#ALIAS sa {sell weevils to abeytu;#var fgreens 0;#var greds 0;#var hgreens 0;#var lreds 0;#var lwoods 0;#var totvalue 0;#var totweevils 0;pg}
#VAR lreds {000} {000}
#VAR greds {000} {000}
#VAR lwoods {000} {000}
#VAR fgreens {000} {000}
#VAR totweevils {0000} {0000}
#VAR totvalue {0000} {0000}
#VAR hgreens {000} {000}
#TRIGGER {^A (%w) (%w) weevil skitters in from the shadows of the forest.$} {@attack @tg}
#TRIGGER {^Covered in wood pulp, a (%w) (%w) weevil scuttles in, its long proboscis} {@attack @tg}
#TRIGGER {^A hole opens up in a nearby tree as a (%w) (%w) weevil burrows out} {@attack @tg}
#TRIGGER {^You pick up the corpse of a (%w) (%w) weevil.} {#IF (%1=lumbering & %2=red) {#add lreds 1;#add totvalue 14};#IF (%1=giant & %2=red) {#add greds 1;#add totvalue 21};#IF (%1=large & %2=wood) {#add lwoods 1;#add totvalue 7};#IF (%1=fat & %2=green) {#add fgreens 1;#add totvalue 28};#IF (%1=hulking & %2=green) {#add hgreens 1;#add totvalue 35};#add totweevils 1}
#TRIGGER {^Searching for wood, a (%w) (%w) weevil wanders into view.$} {@attack @tg}
#CLASS 0
#CLASS {Vermin|Rats}
#VAR brats {000} {000}
#VAR yrats {000} {000}
#VAR rats {000} {000}
#VAR orats {000} {000}
#VAR blrats {000} {000}
#VAR totalrats {0000} {0000}
#VAR ratvalue {0000} {0000}
#TRIGGER {^You pick up the corpse of (a|an) (%w) rat.$} {#IF (%2=baby) {#add brats 1;#add ratvalue 7};#IF (%2=young) {#add yrats 1;#add ratvalue 14};#IF (%2=old) {#add orats 1;#add ratvalue 28};#IF (%2=black) {#add blrats 1;#add ratvalue 35};#ADD totalrats 1}
#TRIGGER {^You pick up the corpse of a rat.$} {#add rats 1;#add totalrats 1;#add ratvalue 21}
#CLASS 0
Unknown2006-09-28 02:38:23
The most obvious thing: your tracking of the prompt flags for things like equilibrium, balance, blindness, deafness, etc won't always work. You need to look for each letter in the string individually. For example, if you're blind and have no equilibrium, you won't see "exb"...

Replace things like #if (%7 = exb) with #if (%pos(b, %7)).

Also, the p appears on the prompt flags in many instances when you're not prone. You could be paralyzed, stunned, entangled, etc.
Kharaen2006-09-28 02:40:31
What does the %pos mean?
Shorlen2006-09-28 03:09:14
QUOTE(Kharaen d'Attai @ Sep 27 2006, 10:40 PM) 336268
What does the %pos mean?

It returns the position of a substring in a string, and 0 if the element isn't in the substring. #if (statement) is true if the statement is anything but 0.

So #if (%pos(b, %7)) would be true if b appeared anywhere in %7, but false if b wasn't in %7 at all.
Kharaen2006-09-28 05:19:11
How do you make it false if there's a d? Since having b and d would most likely mean that I have sixth sense...

That'd be pretty useful for p as well, except how do you make it false if it doesn't have e?

Coding still kind of new to me, I try to emulate what I see...
dayan2006-09-28 09:12:28
It is simple. Use negation, for example:
#if (not %pos(d, %7))
or
#if (!%pos(d, %7))
or
#if (%pos(d, %7)=0)

all work the same.

Kharaen2006-09-28 14:13:11
But then where's the b?

Edit: Nevermind, I'm stupid. I forgot about the and commands >.>