Thread: [lyntin-devl] Offshoot of my old lyntin layer available
Brought to you by:
glasssnake,
willhelm
From: Brazen <odb...@ya...> - 2009-06-05 03:34:33
|
Very alpha stuff based on on what I stuck in the development sandbox back in 2004 and recently picked up again. I had some free time so I cleaned it up and added a bare minimum of docs. http://bazaar.launchpad.net/~odbrazen/leanlyn/trunk/revision/64/README.txt It is useable but not very polished. I added a '#help' command just today. Useful if you play 3kingdoms and more so if you are in the juggernaut's guild (it has extra screen scrapers for that). Enjoy or ignore at your leisure. [from the README] Leanlyn is a telnet client written in pure python with two goals: 1) Noting is special 2) State based and not trigger based 1) Nothing is special The core API is tiny; so tiny that basic commands like '#connect' are actually not in the core! i.e. they aren't special and work with the same API as any code you write. So the best examples of how to use the client are included in the distribution. 2) State based and not trigger based Instead of reacting to single lines of input Leanlyn adds the concept of 'catchers.' Catchers watch for all the status messages (hpbar, stats, skills, etc) and update the state of the session. The cather module contains utility classes for parsing multi-line input and updating state. Instead of writing triggers you write little functions that check the state and then do something appropriate. If someone has written a mudpack (see the mudpacks/ directory) you don't have to write a single regexp or parser; just define the login as using the mudpack and you get all the parsing for free. A big hat tip to Will; my code started as something that was layered on top of Lyntin and then evolved to its own thing. If any of the code is the same (the tkui is derivative, I think everything else is clean) then I throw myself on the mercy of the court and/or will buy him lunch. I published it under an Apache license. The GPL is problematic for python and other non compiled languages according to the GNU foundation and PSF - it is untested in court if imported python code counts as linked or not. The PSF asks all contributors so sign an Apache licensing agreement so I'm using one as well. -odbrazen |
From: Mac D. <est...@gm...> - 2009-06-11 04:59:47
|
The problem I am trying to solve is elegantly creating a (kill) list, upon entering a room, and then removing the name(s) when I leave the room. certainly, simple KoS triggers would function the same - but they aren't as nice. For example, I enter the room, my list is populated with "Some Bloak." An attack function then attacks 0 in my list. When I am done looting, it removes it from the list. I think I can figure out the list parts... Just trying to figure out where to look in the client for examples of populating the list - or evaluating mud data + adding the bloaks to my list. I have looked up and down the action.py and highlight.py modules for hints, but I have not been able to figure it out. I am guessing it is related to the "def mudFilters," therein. Or, those seem like possible examples to build from. I got lost reading through the Argparser. Oh, I am basically just trying to build a module. I slept about an hour and a half last night -- but the sun is coming up, and the coffee is flowing =) I will keep trying to figure it out... Any tips would be greatly appreciated. Thanks |