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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Bug reports
. . -> [Subject]  Busted Plugin

Busted Plugin

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


Pages: 1 2  

Posted by Starky   (28 posts)  [Biography] bio
Date Wed 11 Jun 2008 03:54 AM (UTC)

Amended on Wed 11 Jun 2008 03:57 AM (UTC) by Starky

Message
Been using this plugin for MONTHS and recently caused a crash of MUSH when I tried to use and it ever since has been randomly returning this error

Run-time error
Plugin: Aardwolf_SpellupLUA (called from world: Aardwolf)
Function/Sub: nospells called by trigger
Reason: processing trigger ""
[string "Plugin"]:463: 'string.gfind' was renamed to 'string.gmatch'
stack traceback:
        [C]: in function 'gfind'
        [string "Plugin"]:463: in function <[string "Plugin"]:460>
Error context in script:
 459 : 
 460 : function nospells(sName,sLine,wildcards)
 461 : spellist = spells
 462 : count = 0
 463*: for spell in string.gfind(spellist, "[^||]+") do
 464 :  count = count + 1
 465 : end
 466 : if count >= 3 then
 467 : Send("prompt")


restarting MUSH or reinstalling the plugin or both has managed to fix it most of the time but now it refuses to work even doing that multiple times is there something I missed? I've reinstalled MUSH twice now and still am getting this error. I've redownloaded the plugin countless times and it's seriously getting annoying any ideas?

I originally saw the gfind has been renamed to gmatch line and tried that and while it doesnt return the error when I make that change through the plugin, then it ceases to function correctly. And the fact that reinstalling it a few times and or restarting MUSH has fixed it a few times in the past I seem to think its something else other than just the code.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 11 Jun 2008 04:16 AM (UTC)
Message
Have you upgraded MUSHclient recently?

See this thread: http://www.gammon.com.au/forum/?id=7322

In September 2006 (almost two years ago) MUSHclient upgraded to Lua 5.1, and that page mentions that string.gfind will no longer work, as it was renamed to string.gmatch.

It is a bit strange it has worked so long for you, and that the plugin has not been ugraded meanwhile.

You need to edit the plugin with a text editor and change string.gfind to string.gmatch, wherever that occurs inside it.

Quote:

... recently caused a crash of MUSH when I tried to use ...


MUSHclient actually crashed? Or you just got the error message you showed?

Quote:

I originally saw the gfind has been renamed to gmatch line and tried that and while it doesnt return the error when I make that change through the plugin, then it ceases to function correctly ...


So you changed every place? And in what way does it cease to function correctly?

I tested it with a bit of code below, and that gave me the expected results ...


spellist = "fire|brimstone|ice|water"
count = 0

for spell in string.gmatch(spellist, "[^||]+") do
  print (spell)
  count = count + 1
end

print (count)

Output

fire
brimstone
ice
water
4


Can you give the link to where you downloaded the plugin from? Maybe it needs to be updated, or there is a more recent version elsewhere.

- Nick Gammon

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

Posted by Starky   (28 posts)  [Biography] bio
Date Reply #2 on Wed 11 Jun 2008 04:26 AM (UTC)
Message
http://homepages.ihug.co.nz/~taramai/ is where I got the mush from been using that for quite a while.

The crash happened I triggered the script it's a spellup script that sets out about 20-50 spells cast depending on the level I am at the time and it started to scroll then froze and end task appeared and I even waited for it but nothing happened so I had to end task it out. The error started appearing after that.

What happens is the script looks through my spells list compares it to a list of my spellup spells and casts any that are missing. If I change them all to gmatch then it shows the spell list fails to capture anything then casts every spell on the list so the script 'works' but not as it's supposed to.

This plugin is way beyond my Lua programming skills thus far so I can't say why it's not working.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 11 Jun 2008 04:41 AM (UTC)
Message
Well the person to ask would be Onoitsu2 who wrote those. You could try the one from his web page:

http://geocities.com/onoitsu2/MC_Plugins/

However that still seems to have the string.gfind in it.

You hang might be caused by incautiously modifying the script.

The minimal change would be to edit the plugin, and add one line. Look for the lines below and add the extra line as shown:


<script>
<![CDATA[

string.gfind = string.gmatch  --> add this

spells = GetVariable("spells")
cspells = GetVariable("currentspells")


Then the rest of the plugin will treat string.gfind as string.gmatch.

It is possible your "state" file has become corrupted. Look in the "state" subdirectory of "plugins" for a file with "4d41b78adc358ae824fb70f6" in its name. For example:


C:\Program Files\MUSHclient\worlds\plugins\state



Delete that file (with MUSHclient not running), and then the plugin will then make a new one, I imagine.

Then it should work OK. Failing that, try sending a message to Onoitsu2 via the forum.


- Nick Gammon

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

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Wed 11 Jun 2008 05:10 AM (UTC)
Message
The other thing you could try is to stop the plugin going into a loop. By the sound of it, that is what is happening.

Down at the bottom of the plugin, after the line "</script>" (3rd last line) insert some extra stuff, but before the line "</muclient>", like this:


</script> 

<timers>
  <timer enabled="y" second="5.00"  send_to="12" >
  <send>
runaway_instruction_limit = 100000

function hook ()
  debug.sethook (hook, "", runaway_instruction_limit)
  error ("Runaway instruction limit reached")
end -- hook

debug.sethook (hook, "", runaway_instruction_limit)
</send>
  </timer>
</timers>


</muclient>


This extra code will make the plugin stop after it executes 100000 instructions. That should be enough to work normally, but if it loops you get control back and don't have to close MUSHclient in the task manager.

- Nick Gammon

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

Posted by Starky   (28 posts)  [Biography] bio
Date Reply #5 on Wed 11 Jun 2008 05:16 AM (UTC)

Amended on Wed 11 Jun 2008 05:27 AM (UTC) by Starky

Message
okay that worked temporarily but is causing crashing deleting the state file removed all the spells from the spellup plugin so I was readding them and it crashed on the first one

missed your second post there sec I"ll try it
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Wed 11 Jun 2008 05:33 AM (UTC)
Message
When you say "crash" do you mean "go into a loop" so that you have to abort it? I am trying to get exactly what is happening here.

If you use my runaway instruction idea you should get an error message, please post what that is, so we can see what it was doing at the time.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Wed 11 Jun 2008 05:34 AM (UTC)
Message
And can you answer my question "Have you upgraded MUSHclient recently?".

It shouldn't have worked at all unless you were using a 2-years old version of MUSHclient and recently upgraded.

- Nick Gammon

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

Posted by Starky   (28 posts)  [Biography] bio
Date Reply #8 on Wed 11 Jun 2008 06:23 AM (UTC)
Message
been using 4.19 not sure how old that is I changed versions about umm 3 weeks ago to 4.19 dont remember why and its been working before and after the switch until recently. I can't pinpoint any reason for the initial crash to have ocurred since I hadnt changed anything. Was even about a week after I finished my speedwalker plugin. Everything was running fine then suddenly unexpected BOOM and broken since.
[Go to top] top

Posted by Starky   (28 posts)  [Biography] bio
Date Reply #9 on Wed 11 Jun 2008 06:07 PM (UTC)

Amended on Wed 11 Jun 2008 06:23 PM (UTC) by Starky

Message
When I say crash I mean completely locked up non responsive windows marks it at Not Responding and it stays that way even if I wait. I used your runaway instruction bit of code and it doesnt seem to do anything. Still locks up unable to respond to anything until I close it out forceably.


Okay so I completely uninstalled everything saving my scripts but not the states and the world files and deleted all the folders it leaves behind and reinstalled with the new version and it works... Idunno something must have been corrupted I guess
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #10 on Wed 11 Jun 2008 11:56 PM (UTC)
Message
Yes well technically that is not a crash, because a script can go into a loop if it is badly written or gets bad data. MUSHclient patiently waits for the script to end, and the script does what it is told to do.

Unfortunately it is hard to cancel a runaway script which is why I suggested that extra piece of code.

However from what you describe the problem might be in a different plugin (perhaps they interact in some way), since clearing all of their state files seems to have resolved it.

- Nick Gammon

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

Posted by Starky   (28 posts)  [Biography] bio
Date Reply #11 on Thu 12 Jun 2008 04:16 AM (UTC)

Amended on Thu 12 Jun 2008 04:43 AM (UTC) by Starky

Message
tis broken again same error, I really dont know what's going on just that it's really starting to annoy me.

figured out a way to test that ran the script with no other scripts loaded and it still freezes with that solution going.

the original code uses

if string.sub(_VERSION,1,7) == "Lua 5.1" then
string["gfind"] = string.gmatch
end -- if


is it possible that theres something going on with MUSH thats keeping that if from firing? Because it was working properly before but maybe it's not anymore? Thats the only thing I can think of that might cause the sudden stoppage of a script.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #12 on Thu 12 Jun 2008 07:52 AM (UTC)
Message

  • Can you please give me the exact download link that you got the plugin from?

    You said when I asked this before:

    http://homepages.ihug.co.nz/~taramai/

    However I can't see Aardwolf_SpellupLUA on that page. Maybe I am blind. If you give me the exact link I can see exactly what you have.

  • You said "tis broken again same error". Do you mean it freezes up? Or do you mean the error "'string.gfind' was renamed to 'string.gmatch'"?

    Please be specific, you have said two different things go wrong.

  • The code you posted:

    
    if string.sub(_VERSION,1,7) == "Lua 5.1" then
    string["gfind"] = string.gmatch
    end -- if
    


    is effectively the same as what I suggested:

    
    string.gfind = string.gmatch  --> add this
    


    Since we know you have Lua 5.1 these days. Or we think you do ...

  • Try doing this. In the command window, and with "/" as the scripting prefix, and Lua as the language, type:

    
    /print (_VERSION)
    


    Tell us what you see.

  • When you say "it still freezes up", is that with absolutely no plugins installed other than Aardwolf_SpellupLUA? Not the plugin you wrote, or anything else? No triggers or other scripts?

  • Have you ever edited the Lua "sandbox" code in the Global Preferences?


There is something strange going on here. Code doesn't just "go bad" - something has changed to cause this problem. I strongly suspect something is interacting with something else.

Can you do this for me please? ...


  • Make a completely new MUSHclient world.

  • Just add enough configuration to connect to Aardwolf and no more (eg. MUD address, port, character name).

  • Do not add any:


    • Triggers
    • Aliases
    • Timers
    • Scripts
    • Plugins


  • Then install the one Aardwolf plugin that you are doubtful about, and no more. Not your speedwalker script or anything else.

  • You don't need to delete any "state" files - each new world gets a new one, because it has a different "world ID".

  • Then connect to Aardwolf and try it out. If it still hangs please note the exact thing you were doing the moment before it hung.

  • If you have no problems gradually add back in any other plugins you were using - one at a time - and then test it again.





- Nick Gammon

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

Posted by Starky   (28 posts)  [Biography] bio
Date Reply #13 on Thu 12 Jun 2008 04:47 PM (UTC)

Amended on Thu 12 Jun 2008 04:56 PM (UTC) by Starky

Message

  • The link I gave you earlier is when you were asking where I got MUSH, I got the plugin from:

    http://www.torasin.com/~venificius/Aardwolf_MC_Plugins.exe

  • What happened earlier was I completely uninstalled everything reinstalled it and the unedited script was working. And I got the string.gfind was renamed to string.gmatch

    as I'm typing this now after making no changes it's working again.

  • With the script I posted it either works or gives the string.gfind was renamed to string.gmatch error randomly and with the bit of code you posted it always freezes ie going into the loop as you have said.

  • Lua 5.1 is what it says

  • when I tested it earlier I was using the testport which is a seperate connection on the server and I had no other scripts loaded and it froze using the bits of code you posted and errors string.gfind to string.gmatch with the original code

  • I havent even touched Global Preferences

  • I keep getting an error since the reinstall C:\MUSHclient\worlds\testfile.lua was not found.


I cant seem to get the plugin to break again for the purposes of testing seems about par for the course does it not? I made a new world to test it like you said I'll test it next time it breaks
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #14 on Thu 12 Jun 2008 09:40 PM (UTC)
Message
Quote:

The link I gave you earlier is when you were asking where I got MUSH ...


I actually asked "Can you give the link to where you downloaded the plugin from?". See further back in this thread.

Quote:

I keep getting an error since the reinstall C:\MUSHclient\worlds\testfile.lua was not found.


Something strange is going on. I strongly suggest you download the latest MUSHclient from this site, see the Downloads button above on this page. This is the official copy here. Currently the latest version is 4.27.

The standard MUSHclient distribution does not have a "testfile.lua" in it, nor does it need it.

You should use a new, clean, copy of MUSHclient, and a new, clean, world file for connecting to Aardwolf.

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


36,587 views.

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

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]