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 <#>.
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
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
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
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.
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.
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
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
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
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
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"
Tervic2006-05-16 21:10:41
Oh, sue me for the double post, but I just noticed: If you want to add herbs and potions to the autodeffing, they have their own rebalancing messages that you'll need to add to the trigger, since those things don't require equilibrium and thus won't activate the trigger.
("You may drink another purgative or curing potion." and "You may eat or smoke another herb.")
("You may drink another purgative or curing potion." and "You may eat or smoke another herb.")
Phoebe2006-05-16 22:35:45
i already ahve a defcount variable so it goes for that so i changed it to def_count1 i think it should work but i get these 2 errors now
Type mismatch: ''
Line in error:
and
Syntax error
Line in error:
SetVariable "def_count", (remember im looking for def_count1)
Type mismatch: ''
Line in error:
and
Syntax error
Line in error:
SetVariable "def_count", (remember im looking for def_count1)
Tervic2006-05-16 23:28:47
QUOTE(phoebe @ May 16 2006, 03:35 PM) 288820
i already ahve a defcount variable so it goes for that so i changed it to def_count1 i think it should work but i get these 2 errors now
Type mismatch: ''
Line in error:
and
Syntax error
Line in error:
SetVariable "def_count", (remember im looking for def_count1)
did you remember to update all references in the triggers and aliases to look for def_count1? and type mismatch would probably mean something that should be in quotes isn't. not 100% on that, but it'd be worth a shot to make sure. Or you could just copy/paste my trigger and alias that I have set up
Unknown2006-05-17 00:00:16
It sounds like you might not have VBscript set as your scripting language. If you pull up the script menu with CTRL+SHFT+6, I think, or through the configuration menu (where you add aliases and triggers, there's one that says Script) is the language set to VBscript? If not then you'll get a syntax error.
The Type mismatch error means that you're comparing a string to a null value. In normal people terms, that means that you're variable doesn't exist. Make sure you change the @def_count to @def_count1. You'll also have to change the name any time it says something about def_count.
If you have a defcount variabel already there's no reason you can't change def_count, but you don't have to. The underscore "_" character makes it completely different to your computer.
Also as a side note, SetVariable will automatically create a variable if it doesn't already exist.
Edit: Try replacing the SetVariable line in the trigger with
SetVariable "def_count1", GetVariable ("def_count1") + 1
MUSHclient usually yells at me for using parenthesis, but I think you might need to in this case. Plus, that's what Tervic posted. Try this first.
The Type mismatch error means that you're comparing a string to a null value. In normal people terms, that means that you're variable doesn't exist. Make sure you change the @def_count to @def_count1. You'll also have to change the name any time it says something about def_count.
If you have a defcount variabel already there's no reason you can't change def_count, but you don't have to. The underscore "_" character makes it completely different to your computer.
Also as a side note, SetVariable will automatically create a variable if it doesn't already exist.
Edit: Try replacing the SetVariable line in the trigger with
SetVariable "def_count1", GetVariable ("def_count1") + 1
MUSHclient usually yells at me for using parenthesis, but I think you might need to in this case. Plus, that's what Tervic posted. Try this first.
Suhnaye2006-05-21 21:08:39
Requiem, you rock. I've been trying to figure out how Mush does Case statements for a while now!
Unknown2006-05-21 21:45:46
If you want to learn how to script in MUSHclient, you should find a good tutorial for the scripting language itself. MUSHclient is only a host to the languages. Many of the things you do in MUSHclient, you actually do in a third party language that is allowed to manipulate things inside MUSHclient.
Unknown2006-07-21 13:00:08
i got this error
Error number: -2146827839
Event: Execution of line 1 column 1
Description: Argument not optional: 'SEND'
Line in error:
Called by: Immediate execution
i wonder what i did wrong?
is there a way to trigger on def? ie You are protected by 0 defences.
Error number: -2146827839
Event: Execution of line 1 column 1
Description: Argument not optional: 'SEND'
Line in error:
Called by: Immediate execution
i wonder what i did wrong?
is there a way to trigger on def? ie You are protected by 0 defences.