User Control Panel
Advertisements

HELP US, HELP YOU!

Sonora::Interface::Telnet
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Bot Depot Forum Index -> Modules & Add-ons
View unanswered posts
Author Message
thomashp
Member
Member


Joined: 22 Feb 2004
Posts: 121
Location: Richmond, VA
Reputation: 29.3Reputation: 29.3Reputation: 29.3

PostPosted: Tue Dec 07, 2004 9:44 am    Post subject: Reply with quote

Sonora::Interface::Telnet v0.2

This is the first release of my Telnet interface for Sonora. Basically it creates a listening server on the port you specify and accepts incoming connections from a telnet client. This is a very initial release so it does not work perfectly, but the basic functionality is there. It has been tested with Windows telnet command and Putty and works fairly well with both.

This interface has 2 wonderful uses. First, you can use this just as another interface for your users to connect to. Even if a user doesn't have a IM client installed, they can still contact the bot threw telnet, because most Operating Systems come with a telnet command. Secondly, it's a great way for you to test your bot w/o having to connect to an IM server. It takes milliseconds for the bot to start up with just this interface and you can test your bot with no latency.

Have fun with it and let me know what I need to fix.

In the included zip is a test script called telnettest.pl and the module Telnet.pm that you should put in your .../Sonora/Interfaces/ folder.

Updated to v0.2. I made username pretty, added a friendly name (the users ip) and fixed a few bugs.
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Tue Dec 07, 2004 12:43 pm    Post subject: Reply with quote

Where's the download? :rolleyes:
_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Gavin
God Like
God Like


Joined: 15 Mar 2004
Posts: 661
Location: Manchester, UK
Reputation: 36.2Reputation: 36.2Reputation: 36.2Reputation: 36.2

PostPosted: Tue Dec 07, 2004 5:05 pm    Post subject: Reply with quote

It sounds very cool and everything but we need the download. Wink
_________________
MSN: gavin [at] gavinbrittain [dot] co [dot] uk
E-Portfolio: www.gavinbrittain.co.uk (New version comming soon)
Back to top
thomashp
Member
Member


Joined: 22 Feb 2004
Posts: 121
Location: Richmond, VA
Reputation: 29.3Reputation: 29.3Reputation: 29.3

PostPosted: Tue Dec 07, 2004 6:01 pm    Post subject: Reply with quote

oops... there you go.
Back to top
purcelly
God Like
God Like


Joined: 10 Jun 2004
Posts: 560
Location: North West, England
Reputation: 35.1Reputation: 35.1Reputation: 35.1Reputation: 35.1

PostPosted: Tue Dec 07, 2004 6:09 pm    Post subject: Reply with quote

Nice

good to see some new add-ons !
Back to top
thomashp
Member
Member


Joined: 22 Feb 2004
Posts: 121
Location: Richmond, VA
Reputation: 29.3Reputation: 29.3Reputation: 29.3

PostPosted: Tue Dec 07, 2004 8:01 pm    Post subject: Reply with quote

Updated to version 0.2. Se the first post for the download and details.
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Tue Dec 07, 2004 8:41 pm    Post subject: Reply with quote

That's really cool! I might implement telnet into my bot... I don't know if it would get any users to that interface, but I've been thinking of telnet things for a while (though not for a bot; I was planning to make a password-protected telnet server for doin' DOS commands on my machine from elsewhere Very Happy )
_________________
Current Site (2008) http://www.cuvou.com/
Back to top
mattaustin
Sentinel
Sentinel


Joined: 19 Jul 2004
Posts: 556
Location: Los Angeles, CA
Reputation: 50.7
votes: 1

PostPosted: Tue Dec 07, 2004 9:23 pm    Post subject: Reply with quote

Quote:
I was planning to make a password-protected telnet server for doin' DOS commands on my machine from elsewhere  )


thats not hard...just enable the telnet service in windows then you can just create and use windows users.

_________________
[ matt ]
Back to top
mattaustin
Sentinel
Sentinel


Joined: 19 Jul 2004
Posts: 556
Location: Los Angeles, CA
Reputation: 50.7
votes: 1

PostPosted: Tue Dec 07, 2004 9:42 pm    Post subject: Reply with quote

Sonora::Interface::HTTP?


What about an http interface? useing HTTP::Daemon to make an online chat type interface.

_________________
[ matt ]
Back to top
thomashp
Member
Member


Joined: 22 Feb 2004
Posts: 121
Location: Richmond, VA
Reputation: 29.3Reputation: 29.3Reputation: 29.3

PostPosted: Tue Dec 07, 2004 11:07 pm    Post subject: Reply with quote

QUOTE(Cer @ Dec 7 2004, 12:41 PM)
That's really cool! I might implement telnet into my bot... I don't know if it would get any users to that interface, but I've been thinking of telnet things for a while (though not for a bot; I was planning to make a password-protected telnet server for doin' DOS commands on my machine from elsewhere Very Happy )

Well the biggest reason I made it is for testing of my own bots. I can just add this interface and test my bot w/o even having to be connected to the internet.
Back to top
thomashp
Member
Member


Joined: 22 Feb 2004
Posts: 121
Location: Richmond, VA
Reputation: 29.3Reputation: 29.3Reputation: 29.3

PostPosted: Tue Dec 07, 2004 11:08 pm    Post subject: Reply with quote

QUOTE(mattaustin @ Dec 7 2004, 01:42 PM)
Sonora::Interface::HTTP?


What about an http interface? useing HTTP::Daemon to make an online chat type interface.

yea... I've been thinking about this. I think it would be pretty easy.
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Wed Dec 08, 2004 12:27 am    Post subject: Reply with quote

Yeah, I've done HTTP interfaces to bots.... the problem is that HTTP::Daemon doesn't work well with loops (daemon = idle process that sits in the background and waits until it's provoked), so it doesn't run well with looping bots.

You could probably use a really basic server object, that DOES do looping, and program it yourself though (the HTTP commands are very simple... a request from a client is like "GET /index.html" - and then you return some stuff back).

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
mattaustin
Sentinel
Sentinel


Joined: 19 Jul 2004
Posts: 556
Location: Los Angeles, CA
Reputation: 50.7
votes: 1

PostPosted: Wed Dec 08, 2004 12:48 am    Post subject: Reply with quote

accually you can use the http damon in looping bots i made onw a while ago also...you can make the waiting conncetion time out just like ithe sockets do in the msn.pm

I think i acculayy released it in a white warrier template


my $d = new HTTP::Daemon (LocalPort => 180, Timeout=>.1);

then: $d->accept; will time out and work well with loops

_________________
[ matt ]
Back to top
thomashp
Member
Member


Joined: 22 Feb 2004
Posts: 121
Location: Richmond, VA
Reputation: 29.3Reputation: 29.3Reputation: 29.3

PostPosted: Wed Dec 08, 2004 1:19 am    Post subject: Reply with quote

Why in the heck would you do that?
HTTP::Daemon works well with looping.
http://cpan.uwinnipeg.ca/htdocs/libwww-perl/HTTP/Daemon.html

Having a .1 timeout is horrible. That would just open and close the port over and over missing some clients that are trying to connect.

If you notice the test script in the documentation of HTTP::Daemon, it is a big loop.
Code:
  use HTTP::Daemon;<br />  use HTTP::Status;<br /><br />  my $d = HTTP::Daemon->new || die;<br />  print "Please contact me at: <URL:", $d->url, ">\n";<br />  while (my $c = $d->accept) { #<<<-----BIG LOOP<br />      while (my $*lazy* = $c->get_request) {<br />          if ($*lazy*->method eq 'GET' and $*lazy*->url->path eq "/xyzzy") {<br />              # remember, this is *not* recommended practice :-)<br />              $c->send_file_response("/etc/passwd");<br />          }<br />          else {<br />              $c->send_error(RC_FORBIDDEN)<br />          }<br />      }<br />      $c->close;<br />      undef($c);<br />  }

So all you have to do is make that loop with the rest of your program and it should work fine.
Back to top
mattaustin
Sentinel
Sentinel


Joined: 19 Jul 2004
Posts: 556
Location: Los Angeles, CA
Reputation: 50.7
votes: 1

PostPosted: Wed Dec 08, 2004 1:21 am    Post subject: Reply with quote

because it will hang at #<<<-----BIG LOOP tell there is a request, and with the timeout you are onlytimeing out the accetp request not opening and closeing the port. Did you test what you posetd... you would see your BIG LOOP is blocking. So if you wrote the rest of your program in that loop it would hang until there was each http request (probly not good for most programs)


Code:
 #!/usr/bin/perl<br /> use HTTP::Daemon;<br />use HTTP::Status;<br /><br />my $d = new HTTP::Daemon (LocalPort => 180, Timeout=>.1);<br /> print "Please contact me at: <URL:", $d->url, ">\n";<br /><br />while(1){<br />print "in loop\n"; <br />http_loop();<br />}<br /><br />sub http_loop{<br />   my $c = $d->accept || return;<br />   while (my $*lazy* = $c->get_request) {<br />       my $rs = new HTTP::Response(RC_OK);<br />       $rs->content( '<html><h1>test 2</h1></html>');<br />       $c->send_response($rs);<br />   }<br />   $c->close;<br />   undef($c);<br />}

_________________
[ matt ]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Modules & Add-ons All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group