Text only client- done!

A place for The Mana World players to discuss game-related topics outside the scope of development including guilds, player interactions, game meta and more.


User avatar
Derpella
Novice
Novice
Posts: 198
Joined: 14 Jun 2011, 08:08
Location: Poland

Text only client- done!

Post by Derpella »

Sometimes everyone musts use some resources eating programs, but would like to keep tmw open to see some nice flamewars to join...
Whisperbot got modified a bit to make possible reading and imputing text from terminal/console.


Download:
https://gist.github.com/2016586 (if you have no idea how git works, just download files config and whisperbot.py by clicking "raw" next to them)
or just git://gist.github.com/2016586.git

You must edit config file entering your data (case sensitive!), rename to config.py, then run whisperbot.py file, which needs having Python installed.


Big thanks for:
-kook who did input possibility and many small fixes
-anonymous author who made Whisperbot
-Mistakes who shared the original Whisperbot
-nikin who did logging code
-pwet who cooperated :)
Last edited by Derpella on 21 Mar 2012, 11:00, edited 8 times in total.
I'm Image too much.
User avatar
Chicka-Maria
TMW Adviser
TMW Adviser
Posts: 1562
Joined: 19 Feb 2010, 02:10
Location: Internet

Re: Text-mode client ;)

Post by Chicka-Maria »

First code is a fail : maltarules is of no more :twisted:
Yubaba
TMWC Member of The Mana World
Leader of The Mana Empire (TME)
[19:41] Ladysugar: he told me to push a setzer up his rear
www.deviantart.com/comfycheeks - Old Deviant Art
William James wrote:Act as If what you do make's a difference, because It does.
User avatar
kook
Novice
Novice
Posts: 93
Joined: 11 Mar 2009, 05:30

Re: Text-mode client ;)

Post by kook »

Image
User avatar
kook
Novice
Novice
Posts: 93
Joined: 11 Mar 2009, 05:30

Re: Text-mode client ;)

Post by kook »

ill leave removing the square as an exercise...
Image
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: Text-mode client ;)

Post by Crush »

The Gist you were looking for has been deleted. Sorry about that!
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
kook
Novice
Novice
Posts: 93
Joined: 11 Mar 2009, 05:30

Re: Text-mode client ;)

Post by kook »

Image
User avatar
Derpella
Novice
Novice
Posts: 198
Joined: 14 Jun 2011, 08:08
Location: Poland

Re: Text-mode client ;)

Post by Derpella »

Hmm... it is working, but I seem to have a one warning... http://pastebin.com/zQA77H4V
I'm Image too much.
User avatar
kook
Novice
Novice
Posts: 93
Joined: 11 Mar 2009, 05:30

Re: Text-mode client ;)

Post by kook »

thats a common error.
Image
User avatar
Derpella
Novice
Novice
Posts: 198
Joined: 14 Jun 2011, 08:08
Location: Poland

Re: Text-mode client ;)

Post by Derpella »

I took your latest kook's version and made :

-whispers readable
-logging possible, including own text and whispers
-timestamps

http://pastebin.com/eTJnvBTQ
Download: http://pastebin.com/download.php?i=eTJnvBTQ

What I'll try to do (or force poor kookie :3):
-making whispering and using commands, like /present possible
-cutting out color and market tab marks (like ##0)
-cutting out "^@" from end of lines in logs
I'm Image too much.
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: Text-mode client ;)

Post by o11c »

Derpella wrote:-cutting out "^@" from end of lines in logs
Just add [:-1] where you need to remove it.

Or, you can read the '\0' it in the sendall, and replace
message = packet[28:]
with
message = packet[28:-1]
Former programmer for the TMWA server.
User avatar
Derpella
Novice
Novice
Posts: 198
Joined: 14 Jun 2011, 08:08
Location: Poland

Re: Text only client- done!

Post by Derpella »

You fell from the sky to me!
Now I have opposite problem: the NULL sign isn't sent when you type in tty, and because of that commands like /present and /whisper don't work...
I'm Image too much.
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: Text only client- done!

Post by o11c »

You'll have to add it then. Try replacing:
return "\x96\0%s%s%s" % ...
with:
return "\x96\0%s%s%s\0" % ...
etc
Former programmer for the TMWA server.
User avatar
kook
Novice
Novice
Posts: 93
Joined: 11 Mar 2009, 05:30

Re: Text only client- done!

Post by kook »

// Added + 1 in order to let eAthena parse admin commands correctly
https://github.com/mana/mana/blob/maste ... andler.cpp

hmhhmh, but, /me is done by typing *xxx*, see this line:
void ChatHandler::me(const std::string &text)
{
std::string action = strprintf("*%s*", text.c_str());

talk(action);
}


as per other /actions, the hub is here:
https://github.com/mana/mana/blob/maste ... andler.cpp
and i dare not..
Image
User avatar
0x0BAL
Peon
Peon
Posts: 40
Joined: 19 Dec 2012, 10:36

Re: Text only client- done!

Post by 0x0BAL »

I cant get this working with Python 3.2.2 the last version
i get an invalid syntax error
User avatar
kook
Novice
Novice
Posts: 93
Joined: 11 Mar 2009, 05:30

Re: Text only client- done!

Post by kook »

0x0BAL wrote:I cant get this working with Python 3.2.2 the last version
i get an invalid syntax error
python 2.7 is here to stay, no reason to run this in version 3..or is there?
Image
Post Reply