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 ➜ Lua ➜ Odd errors in plugins

Odd errors in plugins

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


Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Wed 22 Aug 2007 02:02 PM (UTC)
Message
I have a few plugins for Aardwolf that I've started sharing out. So far they have worked pretty well for most people aside from needing a few workarounds for people who have blocked all os.* calls. There is one issue with one person trying to install them though. He recently upgraded from 3.65 to 4.14, and is having some odd problems I can't seem to track down.

[string "Plugin"]:109: unexpected symbol near `#' Line 121: Error parsing script (problem in this file)

  local qlength = GetInfo(304)
  qlength = math.floor( math.abs( qtime - qlength ) )
  gainstotal.quests = gainstotal.quests + 1
  gainstotal.qp = gainstotal.qp + gains.qp
  gainstotal.tp = gainstotal.tp + gains.tp
  gainstotal.train = gainstotal.train + gains.train
  gainstotal.prac = gainstotal.prac + gains.prac

  if #lastquests > 9 then
    for i = 1,9 do
      lastquests[i] = lastquests[i+1]
    end
    lastquests[ 10 ] = gains
  else
    table.insert( lastquests, gains )
  end
  local temp = GetInfo(304)
  lastquests[ #lastquests ].time = temp
  lastquests[ #lastquests ].length = qlength

Earlier in the script, lastquests is defined as an empty table, and I can't figure out why it doesn't give a nil value error if there's a problem with the variable's name. This works fine on my computer and a few others have tried it with no problem.

In another plugin, there is this error:
[string "Plugin"]:25: `)' expected near `%''
Line 48: Error parsing script (problem in this file)


--  Find total minutes it took to level
    local diff = math.floor( math.abs( newtime - oldtime ) )
--  Convert to days, hours, minutes, seconds
    local msg = GetVariable( "col2" )..string.format( "%02d", (diff % 60) )..GetVariable( "col3" ).."s"
    diff = math.floor( diff / 60 )
    msg = GetVariable( "col2" )..string.format( "%02d", (diff % 60) )..GetVariable( "col3" ).."m:"..msg

Again, it works on other computers. Any ideas on what could cause this?

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #1 on Wed 22 Aug 2007 03:51 PM (UTC)
Message
I might be mistaken, but I thought the Lua version got upgraded from 5.0 to 5.1 somewhere inbetween those versions. Maybe the Lua interpreter dll didn't get updated correctly? I seem to recall that atleast the modulus operator got added in 5.1 (although I may very well be mistaken.)
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #2 on Wed 22 Aug 2007 04:05 PM (UTC)
Message
The newer versions of MUSHclient come with newer Lua dlls though. Would one somewhere else possibly override the one in the MC directory?

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #3 on Wed 22 Aug 2007 04:57 PM (UTC)
Message
I don't know; I merely ment the installer may not have updated the dll (although it seems unlikely since it did that just fine for me). You could always look in system32 and whatever other standard searchpaths, though.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #4 on Wed 22 Aug 2007 09:17 PM (UTC)
Message
It certainly sounds like they are still on Lua 5.0. I would get them to type this (assuming they have "/" as the script prefix):


/print (_VERSION) --> Lua 5.1


Also, this:


/print (Version ()) --> 4.14


MUSHclient is linked against lua5.1.dll, it is hard to see how they could still be using Lua 5.0 without a lot of mucking around and renaming files.

It seems more likely to me that, although they downloaded and installed MUSHclient 4.14, they are still using the earlier version (somehow).

- Nick Gammon

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

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #5 on Thu 23 Aug 2007 06:54 PM (UTC)
Message
Thanks for the help. Somehow the guy was still using 3.65 after having installed 4.18.

It is much easier to fight for one's ideals than to live up to them.
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.


20,088 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.