[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  Pulling Directions from Slow Speedwalk Plugin

Pulling Directions from Slow Speedwalk Plugin

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Honestly   (2 posts)  [Biography] bio
Date Fri 22 May 2020 08:03 PM (UTC)
Message
Hi,

So I'm trying to pull the queued direction in the slow_speedwalk.xml plugin, (walk_line). Basically the purpose of this is that my speedwalk will occasionally get interrupted by an aggressive mob, so the direction that was intended to be input is lost in combat, and then the rest of my speedwalk is one room behind.

The solution I thought of for this was to save (walk_line) to a variable, and then make a trigger to input that variable and resume my speedwalk when I'm out of combat again, so I went into the plugin itself and set a secondary variable for the value of walk_line, like this:

SetVariable("direction", (walk_line))

Ok, so then to test it I went into the world itself and make a trigger to pull the variable and check it in the say channel:

<triggers>
<trigger
enabled="y"
expand_variables="y"
group="test"
match="Kudo tests something"
regexp="y"
send_to="12"
sequence="100"
>
<send>SetVariable ("aggrod", (GetPluginVariable ("56c9c5763d0c9c6ccf1e5b60", "direction")))
Send 'say @aggrod'
</send>
</trigger>
</triggers>


Cool, now this ALMOST works, but I get this compile error:

Compile error
World: DBE
Immediate execution
[string "Trigger: "]:2: unfinished string near ''say west'

Apparently the value of walk_line always formats with a ' in front of the string, and this is where I get stuck. Can I format this out or is there a better method to accomplish what I'm trying to do? Any help would be much appreciated!

Thank you
[Go to top] top

Posted by Fiendish   USA  (2,525 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Fri 22 May 2020 08:25 PM (UTC)
Message
I don't understand why you're using SetVariable and then @variable expansion on the next line.

I would do

aggrod = GetPluginVariable("56c9c5763d0c9c6ccf1e5b60", "direction")
Send("say "..aggrod)

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Honestly   (2 posts)  [Biography] bio
Date Reply #2 on Fri 22 May 2020 09:39 PM (UTC)
Message
The worked perfect, Fiendish, thank you. To answer your question of why I was doing it that way; it was the only way I could think of doing it, appreciate the insight!
[Go to top] top

Posted by Nick Gammon   Australia  (23,016 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Sat 23 May 2020 05:33 AM (UTC)
Message
Fiendish said:

I don't understand why you're using SetVariable and then @variable expansion on the next line.


Which wouldn't work anyway. The variable expansion is done before the script is executed.

So, if foo currently contains "bar" and you execute this:


SetVariable ("foo", "abcd")
print ("@foo")


It will print "bar" and not "abcd".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


10,725 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]