The Mana World

Feel the mana power growing inside you!
It is currently Wed May 22, 2013 1:32 pm

All times are UTC - 1 hour




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Text only client- done!
PostPosted: Sun Mar 11, 2012 11:42 am 
Offline
Novice
Novice
User avatar

Joined: Tue Jun 14, 2011 7:08 am
Posts: 198
Location: Poland
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 :)

_________________
I'm Image too much.


Last edited by Derpella on Wed Mar 21, 2012 10:00 am, edited 8 times in total.

Top
 Profile  
 
 Post subject: Re: Text-mode client ;)
PostPosted: Sun Mar 11, 2012 12:16 pm 
Offline
TMW Committee Member
TMW Committee Member
User avatar

Joined: Fri Feb 19, 2010 1:10 am
Posts: 1072
Location: Internet
First code is a fail : maltarules is of no more :twisted:

_________________
Yubaba
TMWC Member of The Mana World
[19:41] Ladysugar: he told me to push a setzer up his rear
http://themanaempire.webs.com/ - The Mana Empire Guild Website
Alexander Pope wrote:
No one should be ashamed to admit they are wrong, which is but saying, in other words, that they are wiser today than they were yesterday.


Top
 Profile  
 
 Post subject: Re: Text-mode client ;)
PostPosted: Sun Mar 11, 2012 12:38 pm 
Offline
Peon
Peon
User avatar

Joined: Wed Mar 11, 2009 4:30 am
Posts: 85
https://gist.github.com/2016490

_________________
Image


Top
 Profile  
 
 Post subject: Re: Text-mode client ;)
PostPosted: Sun Mar 11, 2012 12:40 pm 
Offline
Peon
Peon
User avatar

Joined: Wed Mar 11, 2009 4:30 am
Posts: 85
ill leave removing the square as an exercise...

_________________
Image


Top
 Profile  
 
 Post subject: Re: Text-mode client ;)
PostPosted: Sun Mar 11, 2012 1:19 pm 
Offline
Forum Administrator
Forum Administrator
User avatar

Joined: Thu Aug 25, 2005 3:08 pm
Posts: 7773
Location: Germany
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.


Top
 Profile  
 
 Post subject: Re: Text-mode client ;)
PostPosted: Sun Mar 11, 2012 1:24 pm 
Offline
Peon
Peon
User avatar

Joined: Wed Mar 11, 2009 4:30 am
Posts: 85
here, nearby..
https://gist.github.com/2016586

_________________
Image


Top
 Profile  
 
 Post subject: Re: Text-mode client ;)
PostPosted: Sun Mar 11, 2012 1:42 pm 
Offline
Novice
Novice
User avatar

Joined: Tue Jun 14, 2011 7:08 am
Posts: 198
Location: Poland
Hmm... it is working, but I seem to have a one warning... http://pastebin.com/zQA77H4V

_________________
I'm Image too much.


Top
 Profile  
 
 Post subject: Re: Text-mode client ;)
PostPosted: Sun Mar 11, 2012 2:18 pm 
Offline
Peon
Peon
User avatar

Joined: Wed Mar 11, 2009 4:30 am
Posts: 85
thats a common error.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Text-mode client ;)
PostPosted: Wed Mar 21, 2012 7:21 am 
Offline
Novice
Novice
User avatar

Joined: Tue Jun 14, 2011 7:08 am
Posts: 198
Location: Poland
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.


Top
 Profile  
 
 Post subject: Re: Text-mode client ;)
PostPosted: Wed Mar 21, 2012 4:51 pm 
Offline
User avatar

Joined: Sun Feb 20, 2011 8:09 pm
Posts: 1269
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]

_________________
Source Lead for tmwa: chat.freenode.net #tmwa
<Frost>Remind me not to argue with you, btw.
<BigCrunch>look at o11c, half the time he speaks in code, yet he's getting **** done


Top
 Profile  
 
 Post subject: Re: Text only client- done!
PostPosted: Wed Mar 21, 2012 4:53 pm 
Offline
Novice
Novice
User avatar

Joined: Tue Jun 14, 2011 7:08 am
Posts: 198
Location: Poland
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.


Top
 Profile  
 
 Post subject: Re: Text only client- done!
PostPosted: Wed Mar 21, 2012 4:55 pm 
Offline
User avatar

Joined: Sun Feb 20, 2011 8:09 pm
Posts: 1269
You'll have to add it then. Try replacing:
return "\x96\0%s%s%s" % ...
with:
return "\x96\0%s%s%s\0" % ...
etc

_________________
Source Lead for tmwa: chat.freenode.net #tmwa
<Frost>Remind me not to argue with you, btw.
<BigCrunch>look at o11c, half the time he speaks in code, yet he's getting **** done


Top
 Profile  
 
 Post subject: Re: Text only client- done!
PostPosted: Wed Mar 21, 2012 5:46 pm 
Offline
Peon
Peon
User avatar

Joined: Wed Mar 11, 2009 4:30 am
Posts: 85
// 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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 1 hour


Who is online

Users browsing this forum: Bing [Bot], blackrazor, enchilado and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group