Using slow_speedwalk plugin with speedwalk_fixer plugin

Posted by Ganada on Mon 13 Jan 2020 05:36 AM — 7 posts, 26,107 views.

#0
Hi, is it possible to use the speedwalk_fixer with the slow_speedwalk plugin?

I tried to get the script from speedwalk_fixer and tried to use it in slow_speedwalk, but it doesn't seem to work.

If there is a way to use both at the same time so that !* command of the slow_speedwalk plugin would change the direction commands of "north|south|..." to "n|s|.... it would be much appreciated!

BTW, how do I change the title of a posting?

I accidently pressed tab x3 and enter, which just saved it immediately, and I can't change the title or delete it :)

Thank you so much!
Amended on Mon 13 Jan 2020 05:40 AM by Ganada
USA Global Moderator #1
Quote:
BTW, how do I change the title of a posting?

Do you see a link anywhere that says "Amend subject description"?
Australia Forum Administrator #2
To help understand exactly what you are asking, can you please post a link to the threads describing both plugins?
#3
Hi, I'm referring to these 2 plugins.


speedwalk_fixer

http://gammon.com.au/forum/?id=9011


slow_speedwalk
https://www.gammon.com.au/forum/?id=6008

Thank you!!
#4
Fiendish said:

Do you see a link anywhere that says "Amend subject description"?


Thanks!!! I didn't see it before XD


Nick Gammon said:

To help understand exactly what you are asking, can you please post a link to the threads describing both plugins?


Yes, I'm referring to these 2 plugins.

1. speedwalk_fixer

http://gammon.com.au/forum/?id=9011


2. slow_speedwalk
https://www.gammon.com.au/forum/?id=6008

Thank you!!
Australia Forum Administrator #5
In the slow_speedwalk plugin, after these lines:



-- main function called when you type a speedwalk

function func_handle_speedwalk (name, line, wildcards)
    
  wait.make (function ()  --- coroutine below here
  
  sw = EvaluateSpeedwalk (wildcards [1])
  
  if string.sub (sw, 1, 1) == "*" then
    ColourNote ("white", "red", string.sub (sw, 2))
    return
  end -- if



Insert these new lines:


local conversions = {
  north = "n",
  south = "s",
  east  = "e",
  west  = "w",
  up    = "u",
  down  = "d",
  }

sw =  string.gsub (sw, "%f[%a]%a+%f[%A]", conversions)



That will use string.gsub to replace whole words in the table above, with the replacement letter. The %f stuff is a "frontier" pattern used to make sure we are matching on a whole word.
#6
Thanks Nick! This works like a charm.

I'll surely explore and have fun with this!!!

Have a wonderful day!