Mushclient help massivly needed

by Phoebe

Back to Mechanic's Corner.

Phoebe2006-05-15 02:39:36
Hello everybody i currently realy need help with setting up a system to auto deff up that will work with ethelons system and me having no coding knowledge dont know how to do it i currently have 7 ring defs rituals up to carcer master knigthhood legs stance for combat deathsense in discernment and insomnia in discipline i have frost vial fire vial protection scroll kafe and sixth sense it ends up being 25 deffs if anybody is willing to help me please post?
Tervic2006-05-15 18:09:52
I don't know quite how to set up timed deffing, but I did put all of my defs that don't require eq or balance into a single alias, and it cuts my deffing time by about half, since I don't need to type all this stuff in every time. Just be sure deathsense is the last one since it requires a short amount of equilibrium.

So it goes something like this:

=====
ALIAS: nobal (harhar, no balance, whee how original, but then you can also add other non-balbance requiring defs to it later.)

SEND TO: world

SEND:
stance legs
nightsight
weathering
resistance
adrenaline
combatstyle lightning
outr kafe
eat kafe
outr faeleaf
eat faeleaf
deathsense
=====

Then, since I don't always want to but up my ring defs:

=====
ALIAS: rays

SEND TO: Script

SEND:
call ringrays (a, b, c)
=====

the code for ringrays (you should just be able to copy and paste this into the bottom of the script when you edit it)

=====
Sub ringrays (a, b, c)
send "rub " & getvariable("kingdomring")
send "rub " & getvariable("mercyring")
send "rub " & getvariable("perfectionring")
end sub
=====

then also set aliases like this:
=====
ALIAS: kingdomring *

SEND TO: Script

SEND:
world.setvariable "kingdomring", %1

lather rinse repeat for the rest of the rings.
=====

lather rinse repeat for the other rays that you have, and then I set up some ingame aliases for waterwalk and waterbreathe for convenience since I'm too lazy to do those in MUSH. just SETALIAS WATERWALK .

EDIT: may as well also add in an alias for that protection scroll... I'd say make it separate unless you plan to be constantly running into enemy demesnes. SETALIAS PROTECT READ SCROLL <#>.
Phoebe2006-05-15 18:18:50
I was looking for a timed one tongue.gif
Unknown2006-05-15 18:51:26
I find that it's easier to setup a trigger system that will works off of regaining balance and/or equilibrium instead of a timer. Otherwise you need more fail safes to guard against lag.
Mine works something like this
CODE

TRIGGER: (?:^You have recovered balance on all limbs\\.$|^You have recovered equilibrium\\.$)

SEND:
   SELECT CASE @def_count
      CASE "0":
         SEND "abjure deathsight"
      CASE "1":
          SEND "evoke malkuth"
      CASE  ELSE:
          EnableTrigger "defup", FALSE
   END SELECT
   SetVariable "def_count", GetVariable("def_count") + 1

SEND TO: Script

OPTIONS:
RegEx on (possibly, regular expression, I can't remember)
Keep Evaluating on (in case you have anything else triggered to this)
Expand Variables on

Give it the name "defup" and have the EnableTrigger line be the last case it comes to. Then setup an alias like this

CODE
ALIAS: defup

SEND:
   EnableTrigger "defup", TRUE
   SetVariable "def_count", 0
   Send "def"

SEND TO: Script

I use "def" because it has a fast equilibrium recovery, and it allows me to keep all of my defences in the actual script designed for them.

Finally, if you're interrupted or need to stop before you're finished it's nice to have a way to stop, so set up an alias like this.

CODE
ALIAS: sd (name it whatever you want)
SEND: EnableTrigger "defup", FALSE
SEND TO: Script


There might be code somewhere that doesn't work, since I don't have MUSHclient with me at the moment. If you get an error, just post it and I'll try to fix it for you.
You can add as many defences as you want, just make sure the last line turns off the trigger.

Edit: Note that this will only work if you use VBscript for your scripting language (which most people do). Otherwise you can still use the basic concept, you just need to modify it to fit your specific coding syntax. You can also use IF/ELSE statements if you need to, it's just more combursome.
Tervic2006-05-15 18:58:35
Ooooh a switch statement, didn't know MUSH could do those.... Well, now I'm off to re-edit my system again that I already broke twice and still haven't fixed all the way.... something to do with sequencing, so I suspect I need to put "keep evaluating" on some random things....
Tervic2006-05-15 19:15:34
sorry for the doublepost, but something rather important: the numbers in the case statements need to be quoted, and the first one should be case "0", otherwise it works beautifully, thank you immensely!

TRIGGER: (?:^You have recovered balance on all limbs\\.$|^You have recovered equilibrium\\.$)

SEND:
SELECT CASE @def_count
CASE "0":
send "abjure diminish me"
CASE "1":
SEND "abjure deathsight"
CASE "2":
SEND "evoke malkuth"
CASE "3":
EnableTrigger "defup", FALSE
END SELECT
SetVariable "def_count", GetVariable "def_count" + 1

SEND TO: Script

OPTIONS:
RegEx on (possibly, regular expression, I can't remember)
Keep Evaluating on (in case you have anything else triggered to this)
Expand Variables on
Phoebe2006-05-16 13:53:55
Syntax error
Line in error:
SetVariable "def_count",


no clue what to do tried everything i can think of but im no genious
Tervic2006-05-16 19:52:48
QUOTE(phoebe @ May 16 2006, 06:53 AM) 288605

Syntax error
Line in error:
SetVariable "def_count",
no clue what to do tried everything i can think of but im no genious


I think I've more or less squashed the buggies here... be sure you actually have the variable def_count created, too, but I'm not 100% sure that's critical. Also, the trigger's a regular expression so make sure that the box is checked. Anyhow, these are the exact triggers and aliases that I'm using and they seem to be working properly.


CODE

TRIGGER: (^You have recovered balance on all limbs\\.$|^You have recovered equilibrium\\.$|^You have recovered balance\\.$)

Checkboxes:
-regular expression
-keep evaluating
-expand variables
-ignore case

Sequence 5

SEND: TO SCRIPT
select case @def_count
case "0"
send "grip"
case "1":
send "vitality"
case "2":
send "breathe deep"
case "3":
send "constitution"

<>

case "10":
EnableTrigger "DefUp", FALSE
END SELECT
SetVariable "def_count", GetVariable ("def_count") + 1


CODE

ALIAS: defup

Checkboxes:
-regular expression
-keep evaluating

Sequence 100

SEND: TO SCRIPT
EnableTrigger "DefUp", TRUE
SetVariable "def_count", "0"  <=== Probably just forgot the set it to zero bit....
send "def"