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.
 Entire forum ➜ MUSHclient ➜ General ➜ Errors in Slow_speedwalk plugin

Errors in Slow_speedwalk plugin

Posting of new messages is disabled at present.

Refresh page


Pages: 1 2  

Posted by Death   (55 posts)  Bio
Date Tue 08 Sep 2020 12:03 PM (UTC)
Message
Hey Nick,

I've been having some issues with the slow_speedwalk plugin, and I'm not sure quite why... it seems when I try to resume a walk while in combat this happens randomly.

I tried fixing this issue by adding some fight start and fight finish triggers, but it remains..

Run-time error
Plugin: Slow_speedwalk (called from world: Death)
Function/Sub: func_resume_speedwalk called by alias
Reason: processing alias ""
[string "Plugin: Slow_speedwalk"]:113: [string "Plugin: Slow_speedwalk"]:73: attempt to index upvalue 'wildcards' (a nil value)
stack traceback:
        [C]: in function 'assert'
        [string "Plugin: Slow_speedwalk"]:113: in function <[string "Plugin: Slow_speedwalk"]:110>


Error raised in trigger function (in wait module)
stack traceback:
        [string "Plugin: Slow_speedwalk"]: in function <[string "Plugin: Slow_speedwalk"]:10>
Run-time error
Plugin: Slow_speedwalk (called from world: Death)
Function/Sub: wait.trigger_resume called by trigger
Reason: processing trigger "wait_trigger_133399" when matching line: "[Exits: north east west ]"
C:\Users\Death\Desktop\Death\lua\wait.lua:67: cannot resume dead coroutine
stack traceback:
        [C]: in function 'error'
        C:\Users\Death\Desktop\Death\lua\wait.lua:67: in function <C:\Users\Death\Desktop\Death\lua\wait.lua:59>


https://pastebin.com/gVkRHPL7


The code can be seen above, on the pastebin, but it's just your basic slow_speedwalk plugin you made, with only the added fight trigger you recommended adding here, and a delay change to try and prevent timeouts. Meanwhile, your plugin can be found here:



I have no idea why this error is happening, I'm just trying to resume speedwalk when this happens, using Execute("resume speedwalk")

Any help would be appreciated. This error seems to happen when I get stuck in combat and try resuming walk. Is this an inherent bug in the plugin? How can I avoid this?
Thanks
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 09 Sep 2020 09:41 PM (UTC)

Amended on Wed 09 Sep 2020 11:44 PM (UTC) by Nick Gammon

Message
I would change, at around line 200 of the plugin:


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


to:


    -- send the speedwalk
   
     Send (walk_line) 
    
    -- now wait for an appropriate response
    
    line, exits_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 (exits_wildcards.exits == nil) or (exits_wildcards.exits == "") then
      ColourNote ("white", "red", "Speedwalk cancelled")
      speedwalk_thread = nil
      return  -- give up
    end -- if
 


See if that works.

[EDIT] Tested exits_wildcards for being nil.

- Nick Gammon

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

Posted by Death   (55 posts)  Bio
Date Reply #2 on Thu 10 Sep 2020 03:18 AM (UTC)

Amended on Thu 10 Sep 2020 03:38 AM (UTC) by Death

Message
Hey Nick,

I'm having issues with the same error occurring.


Function/Sub: func_resume_speedwalk called by alias
Reason: processing alias ""
[string "Plugin: Slow_speedwalk"]:112: [string "Plugin: Slow_speedwalk"]:72: attempt to index global 'exits_wildcards' (a nil value)
stack traceback:
        [C]: in function 'assert'
        [string "Plugin: Slow_speedwalk"]:112: in function <[string "Plugin: Slow_speedwalk"]:109>

Error raised in trigger function (in wait module)
stack traceback:
        [string "Plugin: Slow_speedwalk"]: in function <[string "Plugin: Slow_speedwalk"]:10>



Reason: processing trigger "wait_trigger_268400" when matching line: "[Exits: north east west northeast northwest ]"



The error is still in: lua\wait.lua:67: cannot resume dead coroutine
Any help would be appreciated.

I've never seen this error before, so have no idea how to fix it.

To clarify, this is your standard slow_speedwalk plugin with only adding a trigger to catch if you're in a fight or not, which you described in another thread, but the functions themselves after <script> have not been touched.

Any ideas about how this might be happening?
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #3 on Thu 10 Sep 2020 04:09 AM (UTC)

Amended on Thu 10 Sep 2020 04:37 AM (UTC) by Fiendish

Message
Quote:
[EDIT] Tested exits_wildcards for being nil.

You didn't, though!

Ok, so....
obviously changing the line
    if (exits_wildcards.exits == nil) or (exits_wildcards.exits == "") then

to instead be
    if (exits_wildcards == nil) or (exits_wildcards.exits == nil) or (exits_wildcards.exits == "") then


or changing
    if not line then

to instead be
if not line or not exits_wildcards then

might just bypass the error.

But the question remains how exits_wildcard is nil if line is not.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Death   (55 posts)  Bio
Date Reply #4 on Thu 10 Sep 2020 05:35 AM (UTC)

Amended on Thu 10 Sep 2020 05:36 AM (UTC) by Death

Message
I've added ALL of your guys' changes, and will be testing..
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #5 on Thu 10 Sep 2020 07:51 AM (UTC)
Message
Fiendish said:

But the question remains how exits_wildcard is nil if line is not.


That's what I was wondering.

- Nick Gammon

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

Posted by Death   (55 posts)  Bio
Date Reply #6 on Thu 10 Sep 2020 01:12 PM (UTC)

Amended on Fri 11 Sep 2020 06:05 AM (UTC) by Death

Message
Hey friends, I didn't get the upvalue error any more after the code change, but this still popped up by itself..

Might there be some inherent odd bug issue with wait.lua?

Error raised in timer function (in wait module).
stack traceback:
Run-time error
Plugin: Slow_speedwalk (called from world: Death)
Function/Sub: wait.timer_resume called by timer
Reason: processing timer "wait_trigger_7278"
C:\Users\Death\Desktop\Death\lua\wait.lua:51: cannot resume dead coroutine
stack traceback:
        [C]: in function 'error'
        C:\Users\Death\Desktop\Death\lua\wait.lua:51: in function <C:\Users\Death\Desktop\Death\lua\wait.lua:43>



I also must say this problem is seemingly random, and I can't reproduce it, but it does happen consistently, multiple times per day. I have not changed the code in any way besides what has been mentioned, and yeah it still does happen as mentioned in this reply.
Top

Posted by Death   (55 posts)  Bio
Date Reply #7 on Sat 12 Sep 2020 05:11 AM (UTC)
Message
I'm seeing that whenever the speedwalk times out, and it tries to resume based on a timer, it pops this error.
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #8 on Sat 12 Sep 2020 05:22 AM (UTC)
Message
Quote:
whenever the speedwalk times out, and it tries to resume based on a timer

Who made that timer? What does it call when it fires? You can't resume the speedwalk after it times out.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Death   (55 posts)  Bio
Date Reply #9 on Sat 12 Sep 2020 12:32 PM (UTC)
Message
Fiendish said:

Quote:
whenever the speedwalk times out, and it tries to resume based on a timer

Who made that timer? What does it call when it fires? You can't resume the speedwalk after it times out.



I made the timer, and it's supposed to resume the speedwalk (using Execute("resume speedwalk") after I kill something. Resuming a speedwalk after it times out should not yield a broken wait module/plugin; according to the plugin it should simply yield

"No speedwalk is active"
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #10 on Sat 12 Sep 2020 03:59 PM (UTC)

Amended on Sat 12 Sep 2020 04:01 PM (UTC) by Fiendish

Message
Hmm, indeed, and the plugin works for me in the scenario you described without any changes. What version of MUSHclient are you using?

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #11 on Sat 12 Sep 2020 09:11 PM (UTC)
Message
As far as I can see in the plugin, every time the coroutine finishes it sets speedwalk_thread to be nil, which means you should get that message "No speedwalk is active" if you attempt to resume it.

Can you make up a test case which reproduces it without having to connect to a specific MUD and play for hours?

- Nick Gammon

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

Posted by Death   (55 posts)  Bio
Date Reply #12 on Wed 16 Sep 2020 02:16 AM (UTC)
Message
Hey Nick,


I'm not saying I'm doing this, but I've been able to reliably reproduce the error every single time by spamming resume speedwalk while it's on a walk.

Right when it's moving a room seems to be the time where it can break.


I think what's happening is that it is trying to resume right when walking, before receiving all of the room information.

I'd assume before receiving the new exits line..

Can you confirm this behavior?
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #13 on Wed 16 Sep 2020 04:50 AM (UTC)
Message
Try changing:


-- called to resume after a pause
function func_resume_speedwalk ()
  if speedwalk_thread then
    if pause_speedwalk then
      assert (coroutine.resume (speedwalk_thread, "resume"))
    else
      ColourNote ("black", "yellow", "The speedwalk is not paused.")
    end  
  else
    ColourNote ("black", "yellow", "No speedwalk is active.")
  end
end -- func_resume_speedwalk


To add the bold line:


-- called to resume after a pause
function func_resume_speedwalk ()
  if speedwalk_thread then
    if pause_speedwalk then
      pause_speedwalk = false  -- ADD THIS
      assert (coroutine.resume (speedwalk_thread, "resume"))
    else
      ColourNote ("black", "yellow", "The speedwalk is not paused.")
    end  
  else
    ColourNote ("black", "yellow", "No speedwalk is active.")
  end
end -- func_resume_speedwalk

- Nick Gammon

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

Posted by Death   (55 posts)  Bio
Date Reply #14 on Wed 16 Sep 2020 06:19 AM (UTC)
Message
Hey Nick,


you're still very much able to break it in the same exact way with that addition, and I actually made that exact addition earlier to try and solve the problem, but alas.
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.


42,513 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

Posting of new messages is disabled at present.

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.