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
Oggsk
Newbie


Joined: 20 May 2015
Posts: 9
Location: United States

PostPosted: Wed May 20, 2015 8:47 am   

Need help building a small script
 
trying to figure this out and getting stumped-

I want to create an alias to do the following

Cast a spell.
When that spell completes, I want to send 7 simple commands to the mud, then enter a room and exit, then send 14 commands, enter/exit, and lastly another 14 commands, then enter/exit.

I know I need to create a temp trigger from the spell completing, "You complete your spell..." is the trigger text. After that I'm stumped as to how I should build it.

Thanks!
Reply with quote
apfinger
Novice


Joined: 19 Nov 2006
Posts: 40

PostPosted: Wed May 20, 2015 7:14 pm   
 
A trigger is composed of the trigger and the action. You indicate you know what to set as the trigger and you've already described what the action should be. You may need to be more specific with what you want accomplished. Otherwise, I'm stumped as to what you're stumped on.
Reply with quote
shalimar
GURU


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

PostPosted: Wed May 20, 2015 11:44 pm   
 
Unless there is some reason you can't just send all the commands at once, you will likely just need to make a lot of #TRIGGERs to accommodate each step of the way.
If it makes it easier, you can compartmentalize aspects of it by putting them into #CLASSes (folders in the GUI) and using the #T+(-) to toggle them as needed.
_________________
Discord: Shalimarwildcat
Reply with quote
Oggsk
Newbie


Joined: 20 May 2015
Posts: 9
Location: United States

PostPosted: Wed May 20, 2015 11:53 pm   
 
Actually I found the exact script I was trying to build, cept its build for ZMud. Whats the easiest way to convert/import this to CMUD?

I tried the editor and sending, and I got Error parsing command: illegal token: 1. Google searches havent really provided any solutions yet other than turning off parsing and some other settings in the editor, with no success on importing.

So how do I convert this?

#ALIAS cdd {cd;#temp {^You complete} {#loop 8-%len( %1) {time};.%1;..%1;#loop 8-%len( %1) {#2 time};.%1;..%1;#loop 8-%len( %1) {#2 time};.%1;..%1}}
#ALIAS kdd {cd;#temp {^You complete} {kneel;#loop 7-%len( %1) {time};.%1;..%1;#loop 8-%len( %1) {#2 time};.%1;..%1;#loop 8-%len( %1) {#2 time};.%1;..%1;stand}}

Thanks!
Reply with quote
shalimar
GURU


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

PostPosted: Thu May 21, 2015 3:16 am   
 
Well that alias is expecting you to pass it some value for one.
But other then that, all it seems to be doing is send the 'time' command a lot, and for no discernible purpose.

For the record, most all zMUD scripts work natively in CMUD. The only error I see in that script, other then the output, is that the equasion need to be wrapped in parenthesis.
Namely, this: 8-%len( %1)
Should be this: (8-%len( %1))

I suggest you get rid of that alias and simply try to make something of your own, that you fully understand.
Have you tried just having an alias issue all the commands for you?

To make your own alias:
Click the alias button at the top of the CMUD window.
Click the new button in the GUI that pops up.
Enter a name for your alias.
In the large section, enter all the commands you want it to do, each on its own line.

Please be as specific as possible about how this doesn't work/apply.
_________________
Discord: Shalimarwildcat
Reply with quote
Oggsk
Newbie


Joined: 20 May 2015
Posts: 9
Location: United States

PostPosted: Thu May 21, 2015 3:59 am   
 
Because this is more advanced than a simple alias.

I dont want to get rid of the alias, i know it works correctly. It casts a spell that has 3 delayed effects, you cast the spell, wait, enter a room and immediately leave, the effect hits that room, and it repeats 2 more times. Very very powerful spell and the fact you can move and "drag" its effects makes it very handy for killing very tough mobs.

Thank you for the correction to the original, I will see if it imports correctly now.
Reply with quote
Oggsk
Newbie


Joined: 20 May 2015
Posts: 9
Location: United States

PostPosted: Thu May 21, 2015 4:42 am   
 
Some other corrections before it would import... had to delete the . before the %1 Now its importing.
Reply with quote
Oggsk
Newbie


Joined: 20 May 2015
Posts: 9
Location: United States

PostPosted: Wed May 27, 2015 7:40 am   
 
shalimar wrote:
Well that alias is expecting you to pass it some value for one.
But other then that, all it seems to be doing is send the 'time' command a lot, and for no discernible purpose.

For the record, most all zMUD scripts work natively in CMUD. The only error I see in that script, other then the output, is that the equasion need to be wrapped in parenthesis.
Namely, this: 8-%len( %1)
Should be this: (8-%len( %1))

I suggest you get rid of that alias and simply try to make something of your own, that you fully understand.
Have you tried just having an alias issue all the commands for you?

To make your own alias:
Click the alias button at the top of the CMUD window.
Click the new button in the GUI that pops up.
Enter a name for your alias.
In the large section, enter all the commands you want it to do, each on its own line.

Please be as specific as possible about how this doesn't work/apply.


Alright I am still working on this as the imported script didnt quite work right.

What I am trying to do is cast a spell that takes a variable amount of time, when it completes, I want to temp trigger off that completion message, send 7 commands to the mud, (Using the time command for now) and then move a direction, reverse that direction, send 14 "time" commands, move the same direction, reverse direction, and then another set of 14 "time" commands and then a final move into a room and then right back out.

Why? This particular spell, when its cast, has an intial immediate damage wave, then there are 3 more damage waves. You can move after that first wave, hence the move into a room and move out. The effect is, I cast the spell, the swarm hits in the room i start off in.. does nothing there. Then I move into a room with something I want to do damage to and immediately move out, but the timing is such that the 2nd wave hits while I am in that room, but I am back out before the creatures can engage me. Rinse and repeat.

So far I have created this.

cast 'creeping doom'
#TEMP {^You complete} #loop 7 time

But I am getting an error

ERROR: Trigger "^You complete" fired but did not compile

Additionally it appears to be increment by 1 each time i use it, which tells me I am incrementing a variable somehow.

I was able to get the old script to work as far as sending the commands, but I could not figure out how to work in movement into that old script.

Suggestions on where to go next?
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Wed May 27, 2015 11:44 am   
 
Code:
cast 'creeping doom'
#TEMP {^You complete} {#loop 7 {time}}


This should fix the code you posted, you didn't really provide enough details to add the subsequent commands though. How do you want them to be sent exactly? Should they all be stacked at once? Should they wait a certain amount of time? Should they wait for a trigger on the result of the time command?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed May 27, 2015 11:44 am   
 
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <class name="CreepingDoom" copy="yes">
    <alias name="cdd" copy="yes">
      <value>cd
CreepingDoomMoveDir=%1
#T+ CreepingDoomTrig</value>
    </alias>
    <trigger name="CreepingDoomTrig" priority="20" enabled="false" copy="yes">
      <pattern>^You complete</pattern>
      <value>#LOOP 3 {
 #LOOP 7 {#SEND {time}}
 #IF (%i>1) {#LOOP 7 {#SEND {time}}}
 #SEND {@CreepingDoomMoveDir}
 #SEND {%reversedir(@CreepingDoomMoveDir)}
}
#T- CreepingDoomTrig</value>
    </trigger>
    <var name="CreepingDoomMoveDir" usedef="true" copy="yes"/>
  </class>
</cmud>
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Oggsk
Newbie


Joined: 20 May 2015
Posts: 9
Location: United States

PostPosted: Wed May 27, 2015 9:10 pm   
 
Ok this seems to be working pretty well, except I am not sure I understand how to choose the direction i want the alias to move.

I would think I need to input "cdd e" to have the script cast the spell, wait for the 1st trigger {^You complete}, send 7 "time" commands, then move 1 room east, reverse direction, and so on and so on. However, that didn't work so either I am not entering the initial start command correctly, or its not capturing it.



Vijilante wrote:
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <class name="CreepingDoom" copy="yes">
    <alias name="cdd" copy="yes">
      <value>cd
CreepingDoomMoveDir=%1
#T+ CreepingDoomTrig</value>
    </alias>
    <trigger name="CreepingDoomTrig" priority="20" enabled="false" copy="yes">
      <pattern>^You complete</pattern>
      <value>#LOOP 3 {
 #LOOP 7 {#SEND {time}}
 #IF (%i>1) {#LOOP 7 {#SEND {time}}}
 #SEND {@CreepingDoomMoveDir}
 #SEND {%reversedir(@CreepingDoomMoveDir)}
}
#T- CreepingDoomTrig</value>
    </trigger>
    <var name="CreepingDoomMoveDir" usedef="true" copy="yes"/>
  </class>
</cmud>
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri May 29, 2015 8:52 pm   
 
It should work by doing "cdd e" as you said. I understand what you expect it to do, but you haven't said what it is actually doing. Have you checked what was recorded in the CreepingDoomMoveDir variable? Have you tried adding some #SHOW commands to figure out where it is not doing what it should?
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Oggsk
Newbie


Joined: 20 May 2015
Posts: 9
Location: United States

PostPosted: Fri Jun 05, 2015 1:48 am   
 
got it figured out...

Code:
<class name="CreepingDoom" id="4879">
  <alias name="cdd" id="4880">
    <value>cd
CreepingDoomMoveDir= %1
#T+ CreepingDoomTrig</value>
  </alias>
  <trigger name="CreepingDoomTrig" priority="20" enabled="false" id="4881">
    <pattern>^You complete</pattern>
    <value>#LOOP 3 {
  #LOOP 7 {time}

  #IF (%i>1) {#LOOP 7 {time}}
 
  @CreepingDoomMoveDir
  %reversedir(@CreepingDoomMoveDir)
}
#T- CreepingDoomTrig</value>
  </trigger>
  <var name="CreepingDoomMoveDir" usedef="true" id="4882">s</var>
</class>
Reply with quote
Oggsk
Newbie


Joined: 20 May 2015
Posts: 9
Location: United States

PostPosted: Fri Aug 14, 2015 1:21 am   
 
How can i make this script recognize multiple direction inputs? ie if i need to move 3 rooms east and then 3 rooms back between waves?


Oggsk wrote:
got it figured out...

Code:
<class name="CreepingDoom" id="4879">
  <alias name="cdd" id="4880">
    <value>cd
CreepingDoomMoveDir= %1
#T+ CreepingDoomTrig</value>
  </alias>
  <trigger name="CreepingDoomTrig" priority="20" enabled="false" id="4881">
    <pattern>^You complete</pattern>
    <value>#LOOP 3 {
  #LOOP 7 {time}

  #IF (%i>1) {#LOOP 7 {time}}
 
  @CreepingDoomMoveDir
  %reversedir(@CreepingDoomMoveDir)
}
#T- CreepingDoomTrig</value>
  </trigger>
  <var name="CreepingDoomMoveDir" usedef="true" id="4882">s</var>
</class>
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