Demense

by Dysolis

Back to Mechanic's Corner.

Dysolis2008-07-17 15:28:53
I am looking for an auto meld code to set up my demesne automaticly like i had for zmud. I also don't know how to import it from Cmud as a TXT file otherwise id do that.
Unknown2008-07-17 18:38:32
Mechanicsforumplz?
Celina2008-07-17 18:45:34
aquacast blah blah blah
#alarm +10 {aquacast blah blah}
#alarm +20 {aquacast blah blah blah}
#alarm +30 {aquacast yadda yadda}


That's what I used.
Furien2008-07-17 18:50:10
^That's basically it, just hope you don't get ganked in the middle of it or anything.
Desitrus2008-07-17 18:58:07
Except pros do:

#ALIAS kdem {#VAR autodemesne 0}
#ALIAS adem {#VAR autodemesne 1;DEMESNE EFFECT 1;#ALARM +9.75 {
#IF (@autodemesne=1) {DEMESNE EFFECT 2;#ALARM +9.75
#IF (@autodemesne=1) {DEMESNE EFFECT 3;#ALARM +9.75
#IF (@autodemesne=1) {DEMESNE EFFECT ETCUNTILLASTONE;#Var autodemesne 0}}}}

However many open { you have, you need a } to close. CMUD color coding will highlight what {} you are closing as you add them, so just match up.

I even formatted it. Use KDEM if you get interrupted and the next alarm will fail, as you set all alarms within alarms, none of the others will be called.

G'day mate!
Eamon2008-07-17 20:20:48
Desitrus' way is nicer if you tend to get interrupted a lot. You can also set variables to keep track of which effects have already been cast, so that when you resume, you're not recasting ALL the effects, just the ones that haven't already been.
Catarin2008-07-17 20:36:56
Those nested ifs burns us. Switch statements are beautiful things...
Desitrus2008-07-17 20:49:55
QUOTE(Catarin @ Jul 17 2008, 03:36 PM) 534623
Those nested ifs burns us. Switch statements are beautiful things...


I don't swing that way.
Unknown2008-07-17 20:58:25
I don't see how a switch statement would much help simple boolean checks over time...
Catarin2008-07-17 21:01:34
QUOTE(Eldritch Ex Machina @ Jul 17 2008, 02:58 PM) 534638
I don't see how a switch statement would much help simple boolean checks over time...


It doesn't "help" in terms of changing how the script functions. It helps in readability and debugging if problems arise. Nested ifs are ugly and the ability of cmud to do switch statements to avoid them is one of my personal favorite features.
Unknown2008-07-17 21:07:31
wtf.gif
I meant how would you incorporate a switch statement into that? The nested "ifs" are only recursing boolean checks, not checking for different values.
Catarin2008-07-17 21:23:00
QUOTE(Eldritch Ex Machina @ Jul 17 2008, 03:07 PM) 534645
wtf.gif
I meant how would you incorporate a switch statement into that? The nested "ifs" are only recursing boolean checks, not checking for different values.


You wouldn't for that code. Didn't look at it closely enough. I was thinking it was more like this:

#ALIAS startdem {autodemesne = 0;autodem}
#ALIAS autodem {#SWITCH (@autodemesne == 0) {DEM EFFECT 1;#ALARM "DemTiming" +9.75 {autodem}} (@autodemesne == 1) {DEM EFFECT 2} (@autodemesne == 2) {DEM EFFECT 3} etc}

With triggers to indicate which effects you've already set (or when you want to advance autodemesne and run autodem) so you could do specific timing on the effects. Like for example I know aquamancers will tick quite a few of the effects off of the splashing from the heal spring.
Unknown2008-07-18 01:14:19
Isn't it better to use some kind of DO AFTER kind of command?
Esano2008-07-18 01:20:20
Alarm = do after. If you get interrupted, though, it keeps on going.
Dysolis2008-07-18 02:30:17
QUOTE(Desitrus @ Jul 17 2008, 02:58 PM) 534583
Except pros do:

#ALIAS kdem {#VAR autodemesne 0}
#ALIAS adem {#VAR autodemesne 1;DEMESNE EFFECT 1;#ALARM +9.75 {
#IF (@autodemesne=1) {DEMESNE EFFECT 2;#ALARM +9.75
#IF (@autodemesne=1) {DEMESNE EFFECT 3;#ALARM +9.75
#IF (@autodemesne=1) {DEMESNE EFFECT ETCUNTILLASTONE;#Var autodemesne 0}}}}

However many open { you have, you need a } to close. CMUD color coding will highlight what {} you are closing as you add them, so just match up.

I even formatted it. Use KDEM if you get interrupted and the next alarm will fail, as you set all alarms within alarms, none of the others will be called.

G'day mate!


thanks a bunch.
Dysolis2008-07-18 02:33:38
QUOTE(Catarin @ Jul 17 2008, 05:23 PM) 534647
You wouldn't for that code. Didn't look at it closely enough. I was thinking it was more like this:

#ALIAS startdem {autodemesne = 0;autodem}
#ALIAS autodem {#SWITCH (@autodemesne == 0) {DEM EFFECT 1;#ALARM "DemTiming" +9.75 {autodem}} (@autodemesne == 1) {DEM EFFECT 2} (@autodemesne == 2) {DEM EFFECT 3} etc}

With triggers to indicate which effects you've already set (or when you want to advance autodemesne and run autodem) so you could do specific timing on the effects. Like for example I know aquamancers will tick quite a few of the effects off of the splashing from the heal spring.


yes the effects where timed on the heal spring message.

This is what I am doing

Sparkling water splashes up over your body, healing your wounds.
#alarm +10 (aquacast healspring demesne)
#alarm +20 {aquacast needlerain demesne}
#alarm +30 {aquacast jellies demesne}
#alarm +40 {aquacast icefloe demesne}
#alarm +50 (aquacast tsunami demesne)
ERROR: Trigger "Sparkling water splashes up over your body, healing your
Unknown2008-07-18 08:01:56
QUOTE(Esano @ Jul 17 2008, 08:20 PM) 534739
Alarm = do after. If you get interrupted, though, it keeps on going.

well that's confusing. When I think of an alarm I think of something that will alert me, not to DO things for me.

Oh well, I prefer MUSHClient better
Gregori2008-07-18 08:09:53
QUOTE(Dysolis @ Jul 17 2008, 08:33 PM) 534757
yes the effects where timed on the heal spring message.

This is what I am doing

Sparkling water splashes up over your body, healing your wounds.
#alarm +10 (aquacast healspring demesne)
#alarm +20 {aquacast needlerain demesne}
#alarm +30 {aquacast jellies demesne}
#alarm +40 {aquacast icefloe demesne}
#alarm +50 (aquacast tsunami demesne)
ERROR: Trigger "Sparkling water splashes up over your body, healing your



You have the wrong braces on that line. You should be using { } not ( )
Anisu2008-07-18 10:40:02
hrm I actually make use of an array instead of a switch, it makes it easier to modify demesne stuff (atleast for me)

#alias demdef {todem=@wanteddem;demesneloop}
#alias demesneloop {#if @noint {%pop(@todem);#if @todem {#alarm +10 {demesneloop}}}}
#alias int {noint=0}
#var wanteddem {forestcast squirrels demesne|forestcast spores demesne|forestcast pollen demesne|forestcast thorns demesne|forestcast swarm demesne|forestcast storm demesne}

Next part would need some trial and error modifying of timers since I have a demesne artifact

#alias demres {noint=1;#T+ demesneResume;demesne}
#var firstcall {Swarm} --> needs to be changed
#var temp {}
#var timevar {}
in class demesneResume
#Trigger {@firstcall%s(&temp)} {#T- demesneResume;timevar=(%mod(@temp,10) +6);#alarm {+@timevar} {demesneloop}} --> the 6 probably needs adjusting