Re: Module problem with 4.1.1

Eugene <[email protected]> Tue, 13 Jul 2004 10:30:52 +0400
Newsgroups gmane.comp.games.mud.client.lyntin
Message-ID <[email protected]>
On Mon, 12 Jul 2004 13:25:29 -0500
  Jim Sanders <[email protected]> wrote:
>I've just put together a quick module to monitor my hp 
>bar, and I've
>gotten it to load successfully and I'm able to pass 
>variables to it.
>Everything works more or less ok until within the module 
>I put in a
>test statement just to see if its functional.  It 
>evaluates whether
>hp/maxhp is less than 1.0.  If it is, it tries to send 
>output to the
>mud.  I've tried having it just send a standard emote or 
>a #showme IT
>WORKS.  The actual evaluation lines in the module are:
>
>if (1.0 * hp) / maxhp < 1.0:
>   exported.lyntin_command("#showme IT WORKS")

Seems safe enough. Full sources of your module could help 
to fix the problem.


>PS If anyone could tell me how to bind numpad keys to 
>directions using
>cursesui with 4.1.1, I would greatly appreciate it  :)

#curses.bind KEY_UP north
#curses.bind KEY_LEFT west

etc.

It is not always convenient, as cursor navigation arrows 
will be bound to that "north", "west" too. If you running 
Lyntin in xterm (as I do), then there is more compilcated 
but more convenient way.

Put in your .Xdefaults these resources lines:

Lyntin*VT100.Translations: #override \n\
~Shift ~Ctrl        <Key>KP_8: string("north\n") \n\
~Shift ~Ctrl        <Key>KP_2: string("south\n") \n\
~Shift ~Ctrl        <Key>KP_4: string("west\n") \n\
~Shift ~Ctrl        <Key>KP_6: string("east\n") \n\
~Shift ~Ctrl        <Key>KP_9: string("up\n") \n\
~Shift ~Ctrl        <Key>KP_3: string("down\n") \n

etc. You could override any X keycodes as well.

Refresh the X Resources database:

xrdb <.Xdefaults

Then run Lyntin as below:

xterm -class Lyntin -e lyntin --ui curses (...any command 
line params here)

This method even works under textui.


If you run Lyntin in textmode only under Linux, then there 
is one more way to go - edit keymap file for linux 
console, but I don't like this idea myself. I'd rather run 
X Window and xterm.

--
Eugene
---
Professional hosting for everyone - http://www.host.ru


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com