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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Tips and tricks
. . -> [Subject]  How to use the Logitech G15 gamers keyboard with MUSHclient
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

How to use the Logitech G15 gamers keyboard with MUSHclient

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


Pages: 1  2 3  

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #15 on Sat 17 Jun 2006 02:01 PM (UTC)
Message
I was all set on buying this thing, but it looks like I'll have to wait for at least half a year until it finally arrives in the shops here. All I could find was a Logitech Multimedia keyboard for the absurd 230$ with a bunch of play/rewind buttons that I need about as badly as I need WinXP Media Center, or some other nonsense of the sorts.

And Ksilyan, you should email Arny and ask him for a law that would madnate the inclusion of the sales tax in the final price. We had the exact same situation in early 90's and I don't think there are many things that are as annoying as needing to figure out what 7% of a given number is and add the two together.
[Go to top] top

Posted by Nick Gammon   Australia  (21,478 posts)  [Biography] bio   Forum Administrator
Date Reply #16 on Sat 17 Jun 2006 10:05 PM (UTC)
Message
Amazon seem to have it on sale for $USD 67.25.

- Nick Gammon

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

Posted by Wyd   (14 posts)  [Biography] bio
Date Reply #17 on Tue 06 Mar 2007 05:28 AM (UTC)

Amended on Tue 06 Mar 2007 05:29 AM (UTC) by Wyd

Message
Hi,

Sorry to revive an old thread, but Im having some troubles getting the dll to load in.

I compiled a new DLL using Lua511.lib, as the one Nick compiled causes Mushclient 3.80 to crash (I'm guessing because it uses lua 5.0).

The problem im having though, is trying to load the dll in to a world....I'm using the following code:


if not g15 then
  assert (package.loadlib ("G15_Display.dll","luaopen_g15")) ()
  g15.SetAsForeground (true)
end -- if


However it keeps comming up with the following error:


Error number: 0
Event:        Run-time error
Description:  [string "Alias: "]:2: The specified procedure could not be found.

stack traceback:
	[C]: in function 'assert'
	[string "Alias: "]:2: in main chunk
Called by:    Immediate execution


Did I do something wrong when I compiled the DLL, or is there some other small/big fault?


Thanks
[Go to top] top

Posted by Nick Gammon   Australia  (21,478 posts)  [Biography] bio   Forum Administrator
Date Reply #18 on Tue 06 Mar 2007 05:56 AM (UTC)
Message
I'm not sure why you needed to compile it. Try downloading the one I compiled from:

http://www.gammon.com.au/files/mushclient/lua5.1_extras/

- Nick Gammon

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

Posted by Wyd   (14 posts)  [Biography] bio
Date Reply #19 on Tue 06 Mar 2007 06:01 AM (UTC)
Message
Ah, thanks. I was using the original zip from the begining of the tread.

Wyd
[Go to top] top

Posted by Nick Gammon   Australia  (21,478 posts)  [Biography] bio   Forum Administrator
Date Reply #20 on Tue 06 Mar 2007 06:42 AM (UTC)
Message
I have amended the original post to mention the newer version if you are using MUSHclient 3.80 onwards.

- Nick Gammon

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

Posted by Edoren   (31 posts)  [Biography] bio
Date Reply #21 on Sat 14 Apr 2007 08:03 PM (UTC)
Message
Just noticed this thread, and i must say its a cool feature to use. I have it working mostly the way i want it. But i was wondering if anyone could help me setup a way to switch the exits.

for example if i receive "southwest, south, east, northwest" i would like to instead see "sw, s, e, nw" displayed on the screen so that everything fits.

I've been reading through the forums and saw some suggestions on using arrays and cases as the ideal way to take a variable string length and split up, im just not quite sure how it would be written exactly.
[Go to top] top

Posted by Nick Gammon   Australia  (21,478 posts)  [Biography] bio   Forum Administrator
Date Reply #22 on Sat 14 Apr 2007 08:59 PM (UTC)

Amended on Sat 14 Apr 2007 09:00 PM (UTC) by Nick Gammon

Message
In the trigger that handles the exits there is the line that actually displays them:


exits_text:set ("%0")


This is simply displaying the text from the MUD (%0). We need to manipulate that a bit.

This code should do it. First we declare a table of substitutions (you can add to this if you like, you must get the capitalization exactly right). Then we make the "set" line use a string.gsub which processes the entire line, looking for whole words, and substituting where found.



-- substitutions table

exits_subs = {
  north = "n",
  south = "s",
  east = "e",
  west = "w",
  northeast = "ne",
  northwest = "nw",
  southeast = "se",
  southwest = "sw",
  up = "u",
  down = "d",
  
 -- add more here
  
  }

exits_text:set ((string.gsub ("%0", "%a+", exits_subs)))


- Nick Gammon

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

Posted by Edoren   (31 posts)  [Biography] bio
Date Reply #23 on Sun 15 Apr 2007 04:23 AM (UTC)
Message
Wow, i definitely went overboard in my thinking. Nice,clean, and simple solution. Thanks Nick!
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #24 on Sun 15 Apr 2007 02:50 PM (UTC)
Message
I have recently gotten this baby and I must say it's great. So now I've started toying around with the Lua 5.1 version of the dll you've made available.

I made a new plugin, loaded the thing and off it went. Very nice. But any subsequent use of the plugin fails like this:


Immediate execution
[string "Plugin"]:6: LCD device not opened
stack traceback:
        [C]: in function 'SetAsForeground'
        [string "Plugin"]:6: in main chunk


I took a look at the source code and I presume you need to add a delete lcd call somewhere. Sadly I'm not a C programmer nor have a compiler standing around, but I assume there would be a luaclose hook (akin to the luaopen when loading a library) where you can kill the reference and make it possible to use the plugin for a second time?
[Go to top] top

Posted by Edoren   (31 posts)  [Biography] bio
Date Reply #25 on Sun 15 Apr 2007 06:45 PM (UTC)
Message
I only got that after i edited the plugin and tried to reinstall. Had to remove the plugin, close mushclient, and reinstall the plugin again.
[Go to top] top

Posted by Nick Gammon   Australia  (21,478 posts)  [Biography] bio   Forum Administrator
Date Reply #26 on Sun 15 Apr 2007 09:51 PM (UTC)
Message
I have uploaded a new version to:

http://www.gammon.com.au/files/mushclient/lua5.1_extras/G15_Display.zip

(This is for Lua 5.1, that is MUSHclient 3.80 onwards).

The md5sum is: 9c409251cabff98b6d9f6ba6d28c52f1

This version adds a new method: Close.

This is intended to be called from a OnPluginClose function in your plugin. It simply deletes the lcd pointer, which hopefully will result in it releasing the appropriate resources. I haven't tested it. :)

eg.


function OnPluginClose ()
  g15.Close ()
end -- OnPluginClose 



- Nick Gammon

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

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #27 on Sun 15 Apr 2007 10:38 PM (UTC)
Message
I already figured out the 'restart' part of the deal. I can't keep doing that though, it's hard to have a conversation while coding that way. :)

Thanks Nick, it's really appreciated. I'll let you know how it works out... next time I restart my pc. (I tried using Unlocker to unload the DLL at one point, hoping to achieve the same effect.. but I can't run it at all anymore right now.. Oops ^_^)
[Go to top] top

Posted by Nick Gammon   Australia  (21,478 posts)  [Biography] bio   Forum Administrator
Date Reply #28 on Sun 15 Apr 2007 10:43 PM (UTC)
Message
Quote:

I assume there would be a luaclose hook (akin to the luaopen when loading a library)


Actually there isn't exactly. All luaopen really does is add names to the Lua internal code space (that is, it adds functions to the g15 table).

I was toying with the idea of making some sort of object that would be garbage-collected, but I think manually closing like I suggested would be adequate in this case.

- Nick Gammon

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

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #29 on Mon 16 Apr 2007 12:40 AM (UTC)
Message
Bah. I'm sorry to disappoint you, but it doesn't seem to work. My plugin is as follows, and I've tested reloading both through 'reinstall' and manually using 'Remove' and 'Add' again in the Plugin menu.

I'm off on a bold guess here (again!) with only the source of your plugin to look at and nothing else.. and looking at the following code...


  // Have it initialize itself
  hRes = lcd->InitYourself(_T("MUSHclient"));

  if (hRes != S_OK)
    {
    // Something went wrong, when connecting to the LCD Manager software. 
    delete lcd;
    lcd = NULL;
    }

... I think lcd->InitYourself() may return a value other than S_OK to indicate a previous value had been found? Or maybe you need to call another function to release the LCD display hook?

Again, just guessing.. I'm curious now though and going to see if I can find the SDK somewhere. :)
[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.


74,259 views.

This is page 2, subject is 3 pages long:  [Previous page]  1  2 3  [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 FutureQuest]