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
miegorengman
Wanderer


Joined: 05 Sep 2008
Posts: 53

PostPosted: Fri Jun 24, 2022 12:40 pm   

Making a spontaneous action list, specifically grouped/spammed commands
 
I have an existing trigger that performs repetitious tasks for me, to which I have added a simple interface through a button to update a variable via a #prompt, as well as another button using a #prompt to update the #repeat for said task. each time my energy is restored it performs the task. easy to use.


With that template in mind, I am now fanaticizing about using a variable list, in combination with %pop, Which would allow me to create a list of commands to be send to the mud that will only trigger when I have the energy to complete them, each command in sequence, and each command erased as it is issued to the mud. I could effectively plan ahead as many steps as I wanted to, add each step via the button/prompt, and once the list was empty, the command could trigger, but there would be nothing to issue, so I don't have to turn the trigger or class on and off


But there is one hitch. as far as I can tell adding a semicolon into a variable does not function the same way as a command line. So if click my button and fill in the prompt to update my viable with:

n;n;n;ne

instead of the mud receiving each direction in turn, the mud receives a single line of text it does not recognize.

is there a way to use a prompt to update a list variable in a way that effectively applies the function of the semicolon, saving all the content into a single row, but still issuing a spammed chunk of commands all at once then that line is %poped? Or is there a character that effectively represents the return key that could be applied to a variable?

If not is there a simple way to create a button with a prompt that feeds a list of commands that can then be issued and erased each time a trigger runs?

thank you readers
Reply with quote
shalimar
GURU


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

PostPosted: Fri Jun 24, 2022 2:42 pm   
 
You would want to insert a path command
.3nj
in this example.

but then you would need to
#EXEC %pop(varname)
To ensure it gets evaluated.

the same holds true if you want to insert an aliasname or a "#RAISE eventName"
_________________
Discord: Shalimarwildcat
Reply with quote
miegorengman
Wanderer


Joined: 05 Sep 2008
Posts: 53

PostPosted: Sun Jun 26, 2022 5:08 am   
 
Thank you very much, this worked great :)

Here is what I came up with if anyone else finds this useful.

Code:

<class name="z Execute Each at Next Bright Eyed" id="4010">
  <trigger priority="9820" id="4012">
    <pattern>You're bright-eyed and bushy-tailed.</pattern>
    <value>#EXEC %pop(@oneStepOnConc)</value>
  </trigger>
  <var name="oneStepOnConc" type="StringList" id="4015"/>
  <button autosize="false" width="81" height="16" autopos="false" left="-1" top="-32" toolbar="4" color="black" textcolor="#FF6600" priority="56510" id="5651">
    <caption>Input Actions</caption>
    <value>#prompt intermediateVariableForPrompt "Add to your Conc Driven to-do list, but don't kill youself....."
#var oneStepOnConc %additem(@intermediateVariableForPrompt,@oneStepOnConc)
//#var droppedgear %additem("backpack",@droppedgear)
</value>
  </button>
  <var name="intermediateVariableForPrompt" id="5652">n;n;n;n;n;e</var>
  <button autosize="false" width="81" height="16" autopos="false" left="-1" top="-16" toolbar="4" color="black" textcolor="#CCFFFF" priority="56530" id="5653">
    <caption>List Steps</caption>
    <value>#loop %exec("%numitems (@oneStepOnConc)") {#show ---- %item(@oneStepOnConc,((%i-1) \ %numitems(@oneStepOnConc))+1)}</value>
  </button>
  <var name="reviewItemsByRowOneStepOnConc" id="5654"/>
  <button autosize="false" width="81" height="16" autopos="false" left="-1" top="-1" toolbar="4" color="black" textcolor="aqua" priority="56550" id="5655">
    <caption>Reset</caption>
    <value>#var oneStepOnConc (0)
#DELNITEM oneStepOnConc 1</value>
  </button>
</class>
Reply with quote
miegorengman
Wanderer


Joined: 05 Sep 2008
Posts: 53

PostPosted: Tue Jun 28, 2022 2:26 am   it worky!!! variation no worky....
 
works great thank you.

so i tried to adapt this learning to something new. instead of %pop, i am pulling the variable value by row. i have tried running it in the following ways:


Code:
#rep @howmanytimes {#exec ("%item(@anything,@anythingListRowNum)")}

#exec ("#rep @howmanytimes {%item(@anything,@anythingListRowNum)}")


the good news is that both pull from the desired row. the bad news is I a have recreated the issue of the variable row x being get mango;eat mango being sent to the mud in the same format, instead of

get mango
eat mango


any suggestions?
Reply with quote
shalimar
GURU


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

PostPosted: Tue Jun 28, 2022 8:29 pm   
 
I am thinking it might be the quote marks, try pulling those out.
_________________
Discord: Shalimarwildcat
Reply with quote
miegorengman
Wanderer


Joined: 05 Sep 2008
Posts: 53

PostPosted: Wed Jun 29, 2022 6:37 pm   
 
removing the quotes results in

ERROR: Trigger "You're bright-eyed and bushy-tailed." fired but did not compile
Reply with quote
shalimar
GURU


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

PostPosted: Thu Jun 30, 2022 1:36 am   
 
#exec {#rep @howmanytimes {%item(@anything,@anythingListRowNum)}}

#rep @howmanytimes {#exec %item(@anything,@anythingListRowNum)}
_________________
Discord: Shalimarwildcat
Reply with quote
miegorengman
Wanderer


Joined: 05 Sep 2008
Posts: 53

PostPosted: Thu Jun 30, 2022 6:20 am   
 
i can't explain why, but when i copy and paste it works, thank you very much.

i have been working from an example I found where there were issues with %alarm not working in all conditions and the example was something like %exec("#ALARM {+10} {AuraCheckForPC}"), so that is how I have been using execute up to this point.

Learning alot, thank you for taking the time to explain.
Reply with quote
shalimar
GURU


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

PostPosted: Thu Jun 30, 2022 8:23 pm   
 
Parenthesis() are only needed when passing arguments to a function, or when defining an equation to be tested against.

Which works for %exec as it is a function.

But not with #EXEC which is a command.
_________________
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