Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Retrieving speed walk queue with Pause_Speedwalk plugin.

Retrieving speed walk queue with Pause_Speedwalk plugin.

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


Posted by Falgor   (36 posts)  Bio
Date Mon 27 Apr 2020 10:15 AM (UTC)
Message
Hi,

Sorry if this has already been posted, I had a search but could find anything.

I've been using the Pause_Speedwalk plugin, which works great. However I'd like to be able to see what is left of my speedwalk when I'm paused so I can see how many steps I have left.. and if need be execute them quickly (without the plugin delay) by sending them to a fresh speedwalk.

I've tried to interrogate the plugin to see where the queued path is stored but couldn't find anything.

Thanks,

Falg
Top

Posted by Falgor   (36 posts)  Bio
Date Reply #1 on Mon 27 Apr 2020 01:55 PM (UTC)

Amended on Mon 27 Apr 2020 09:41 PM (UTC) by Falgor

Message
I've made a potential work around.

I built an editable function in the Slow_Speedwalk Plugin that lets me set the delay using #CALLPLUGIN. This way I can set the delay to 0.1 seconds to speed up the walks (to the speed it is received from the MUD).

Firstly I removed the delay_secs Entity and all reference to it.

Quote:

function set_delay (value)

speedwalk_delay = value
print ("Speedwalk Delay updated to " .. value .. " seconds.")

end

-- pause before doing another if wanted

wait.time (speedwalk_delay)



I can then edit change the speedwalk delay from the command line.

Quote:

CallPlugin ("56c9c5763d0c9c6ccf1e5b60", "set_delay", "0.5")


It's a clunky workaround. I'd still like to be able to see my speed walk queue so I can send it in one go (as an alias).
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 28 Apr 2020 06:49 AM (UTC)
Message
Are you talking about this? Or something else?

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

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Falgor   (36 posts)  Bio
Date Reply #3 on Tue 28 Apr 2020 11:36 AM (UTC)
Message
Hi Nick!

Yeah, talking about that plugin. I want to find where the speedwalk queue is stored so I can access it.

For example if my speedwalk is !20ne19sws and I find the mob I'm after in the first 2 rooms, I don't want to have to spend ages slowly walking through the rest of the path.

Hence I'd like to grab that path and enter it as an alias or fresh speedwalk (one that doesnt wait for the room each time).

Ideally I'd like to modify the plugin so store whats left of the queue into a string.

As a side note, great to see this software still supported 20 years after I first used it. Really awesome job.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #4 on Tue 28 Apr 2020 09:29 PM (UTC)
Message
I'm not sure which version of the plugin (exactly) you are using as there have been a few. However this amendment should do what you want. If you pause or abort the speedwalk it shows the rest of it as a "command stack" string.

New/changed code in bold.


function show_remainder (line)
  local remainder = { }
  for rem_line = line + 1, #lines do
    table.insert (remainder, lines [rem_line])
  end -- for remaining lines
  ColourNote ("white", "green", "Remaining: " .. table.concat (remainder, ';'))
end -- show_remainder


-- 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
  
  
  pause_speedwalk = false  -- no pause yet
  abort_speedwalk = false  -- no abort yet
  speedwalk_thread = coroutine.running ()  -- remember this thread
  

  -- build table of speedwalk lines
  lines = { } -- table of lines
  for walk_line in getlines (sw) do
    
    if string.match (walk_line, "^%s*$") then
      break
    end -- empty line - probably end of speedwalk
    table.insert (lines, walk_line)
    
  end -- for
    
  
  -- iterate the speedwalk string, line by line, sending each line to the MUD
  
  for line, walk_line in ipairs (lines) do
    
    -- see if pausing wanted (global variable set)
    
    if pause_speedwalk then
      ColourNote ("white", "green", "Speedwalk paused.")
      show_remainder (line)
      ret = coroutine.yield ()
      if ret == "abort" then
        ColourNote ("black", "yellow", "Speedwalk abandoned.")
        speedwalk_thread = nil
        return
      end -- abort speedwalk wanted
      ColourNote ("white", "green", "Speedwalk resumed.")
      pause_speedwalk = false
    end -- if
    
    -- see if aborting wanted
    
    if abort_speedwalk then
      ColourNote ("black", "yellow", "Speedwalk abandoned.")
      show_remainder (line)
      speedwalk_thread = nil
      return
    end -- if
    
    -- send the speedwalk
   
     Send (walk_line) 
    
    -- now wait for an appropriate response
    
    line, wildcards = wait.regexp ("&exits_trigger;", &timeout_secs;)
    
    -- check for timeout
    
    if not line then
      ColourNote ("white", "red", "Speedwalk timed-out")
      speedwalk_thread = nil
      return  -- give up
    end -- if
    
    -- check we didn't get told it was impossible
    
    if wildcards.exits == "" then
      ColourNote ("white", "red", "Speedwalk cancelled")
      speedwalk_thread = nil
      return  -- give up
    end -- if
    
    -- pause before doing another if wanted
    
    if &delay_secs; > 0 then
      wait.time (&delay_secs;)
    end -- if pause wanted
      
  end  -- of iterating through each speedwalk line
  
  -- all done!
  
  ColourNote ("white", "blue", "Speedwalk done.")
  
  speedwalk_thread = nil
  
  end) -- end of coroutine
end -- function func_handle_speedwalk


If you want to actually get a new speedwalk string out of it you will have to do a little extra work, but the command stacking should go a fair way towards what you described.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #5 on Tue 28 Apr 2020 09:45 PM (UTC)
Message
You know, the plugin already allows you to pause and resume a speedwalk, if you happen to come across something interesting. You type "pause speedwalk" and then "resume speedwalk".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Falgor   (36 posts)  Bio
Date Reply #6 on Tue 28 Apr 2020 10:09 PM (UTC)

Amended on Tue 28 Apr 2020 10:16 PM (UTC) by Falgor

Message
Yeah, I've used it a lot. Thanks for the fix.

My issue was on a long speedwalk, if I found my target early then I'd have to sit through a long drag of finishing the path (in order to get back to a known location)

Whereas now I have access to the stored path I can enter that as a string and not have to wait for the movement each room.

I have far bigger problems right now. I've just blown up my lua.wait file somehow. All timed functions are throwing an error because 'local seconds' is nil.

I caused an infinite loop in my script file that flooded my client with temporary triggers. I've reinstalled MUSHclient but to no avail. I'll try and find the error.

Here it is:

Quote:
Error raised in trigger function (in wait module)
stack traceback:
C:\Program Files (x86)\MUSHclient\lua\wait.lua:76: in function 'convert_seconds'
C:\Program Files (x86)\MUSHclient\lua\wait.lua:90: in function 'time'
[string "Plugin: Slow_speedwalk"]:87: in function <[string "Plugin: Slow_speedwalk"]:16>
Run-time error
Plugin: Slow_speedwalk (called from world: World_1)
Function/Sub: wait.trigger_resume called by trigger
Reason: processing trigger "wait_trigger_121" when matching line: " The great sea [ w, n, e, s ]"
C:\Program Files (x86)\MUSHclient\lua\wait.lua:67: C:\Program Files (x86)\MUSHclient\lua\wait.lua:76: attempt to perform arithmetic on local 'seconds' (a nil value)
stack traceback:
[C]: in function 'error'
C:\Program Files (x86)\MUSHclient\lua\wait.lua:67: in function <C:\Program Files (x86)\MUSHclient\lua\wait.lua:59>


No speedwalks or waits are working currently.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #7 on Tue 28 Apr 2020 10:31 PM (UTC)
Message
It looks like you are sending an invalid time to wait.time (such as no time at all, or a string that couldn't be converted to a number).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


19,122 views.

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

Go to topic:           Search the forum


[Go to top] top

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