Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
fox
Beginner


Joined: 31 May 2022
Posts: 11

PostPosted: Tue May 31, 2022 4:26 pm   

Alarm firing too often
 
I started down the path of creating a separate package, etc, but apparently that's way over my head despite reading the help files multiple times. So, I created a new class within one of my sessions, and I'd expect the XML below to:

- fire the trigger/alarm within `casting` every 10 seconds
- cast the @adepting_spell and fire another command (MUD doesnt like lots of repeats)
- when im out of mana, disable the alarm class and trance
- when im done trance, re-enable alarm class and start casting again
- on the adept message, just shut off the whole auto-adept class

The alarm 1) doesn't start firing right away (no clue why, it usually takes some random output from the MUD to start, and 2) seems to fire every 5 seconds and executes the contents of the alarm twice.

What am I missing/misunderstanding?

Edit: please ignore the `enabled="false"` at the class-level. I copy/pasted after disabling

Code:
<class name="auto-adept" enabled="false" id="51">
  <class name="casting" id="52">
    <trigger priority="500" id="53">
      <pattern>*10</pattern>
      <value>c '@adepting_spell'
#IF (%random(1,2) == 1) {save} {anothercommand}
</value>
    </trigger>
  </class>
  <var name="adepting_spell" id="55">acidward</var>
  <trigger priority="423" id="56">
    <pattern>^You are now an adept of</pattern>
    <value>#T- auto-adept
#ECHO done adepting @adepting_spell</value>
  </trigger>
  <trigger priority="421" id="57">
    <pattern>^You complete your trance.</pattern>
    <value>#ECHO enabling casting alarm
#T+ casting</value>
  </trigger>
  <trigger priority="422" id="58">
    <pattern>^You don't have enough mana.</pattern>
    <value>#ECHO disabling casting
#T- casting
trance</value>
  </trigger>
</class>
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Tue May 31, 2022 6:51 pm   
 
Well, the trigger that is supposed to be an alarm should be of type alarm.
Since it is not, I would imagine it is instead triggering off of a 10 scrolling across your screen.

Which would affect timing.
_________________
Discord: Shalimarwildcat
Reply with quote
fox
Beginner


Joined: 31 May 2022
Posts: 11

PostPosted: Wed Jun 01, 2022 11:42 am   
 
Great point--fixed that and got it working for this session! I think there was some overlap in things I was trying and I manually created a trigger with that pattern, since that's what the #ALARM command seemed to do. I guess there's no UI for alarms and they have to be done by #ALARM.

So now I'd like to make this a module, so I can drop it into only my sessions that cast spells and need auto adepting. Is that a valid use case for modules?

Here's what I tried:

- created a new package
- confirmed it was loaded in one session (for now)
- ran the `adept spell` alias
- problem: it sent commands to all sessions and windows, sometimes duplicates
- confirmed the new package was not included in other sessions

I changed the module to "local" publishing, and no sessions recognize the module. Am I still misunderstanding how modules should work?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Wed Jun 01, 2022 6:48 pm   
 
There is a type option selector on the options of the trigger (bottom panel).

Modules (global) are for settings you want to fire in ALL windows of a given session, not just the main one. I tend to use it for my highlights.
When set to Local, no other window can see what the module is doing. i haven't found a use for that myself, but there is sure to be one out there.

If you want it to be used by several separate character sessions, you need a package.

As for the problem you ran into via package...
Usually, you need the #ALL command to send the command to every window.

Have you made the one session autoload the other sessions into one big layout by chance?
If so you can disable the package in select windows by going to the advanced tab of the window in the setting editor and make sure to uncheck any package you don't want to run in that window.
_________________
Discord: Shalimarwildcat
Reply with quote
fox
Beginner


Joined: 31 May 2022
Posts: 11

PostPosted: Fri Jun 03, 2022 12:59 pm   
 
I think yes, my windows are all in a layout. It's been a little weird since I started using a CMUD a few months back, and I haven't spent a lot of time trying to figure out layouts. What's the alternative? Can I somehow multi-play character sessions in an isolated manner where adding a new package simply picks up and works with that session only until I manually drop it into other sessions?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Fri Jun 03, 2022 3:50 pm   
 
Yes, you can run each character in a separate instance of CMUD.
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net