Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Thu Mar 28, 2013 8:12 pm   

CMud and txt msging/email
 
A friend of mine has mentioned he has tells from other players forwarded to his cell phone(txt) and email using CMud.

I'm just curious, is this even possible, is he pulling my chain, or is there a way to set this up?

Please and thank you? :)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Mar 28, 2013 10:06 pm   
 
It's possible, you just have to script it. Your choices, I guess, would be either COM scripting (connecting to Outlook or whatever email client you use) or URL scripting (parsing the html data from your webmail page).
_________________
EDIT: I didn't like my old signature
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Thu Mar 28, 2013 10:18 pm   
 
I use GMail. Do you have an example by chance? I tried searching the forums but was unable to find out how.

What about sending over txt msgs? or like Gmail Chat?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Mar 29, 2013 2:22 am   
 
I imagine the same processes would be used. I know someone sends tweets out about common in-game events. There was a scripting-enabled plugin for ZMud that let you chat with other ZMud users, but that doesn't work with CMud and the talk about adding a native chat module into CMud obviously never made it off the wishlist.
_________________
EDIT: I didn't like my old signature
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Fri Mar 29, 2013 3:05 am   
 
Shucks. I checked out gmail, they have some gmailapp stuff on their site, but I couldn't figure out how to incorporate it into cmud. If anyone feels adventurous and would like to offer me assistance, I'd be very grateful :D

Thanks Matt for your info.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Mar 30, 2013 2:28 am   
 
You can use Lua to actually script it, as I do. And you can send text messages via email as long as you know the carrier's text-message email address.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Mar 30, 2013 2:33 am   
 
By the way, there's a finished COM scripting script in ZMUD's finished forums, I posted the changes for CMUD a long while back.

But let me elaborate on the Lua scripting. You can use smtp.lua and OpenSSL to send email from Gmail's account. I've been doing that for well over a year now, it's just a bit of a pain to initially put together. I can attempt to put together a little package for you and try to explain the steps, if you'd like.
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Sat Mar 30, 2013 12:49 pm   
 
Charneus, I would appreciate that very much if it's not too much trouble. Thank you very much!
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Mar 30, 2013 5:16 pm   
 
I'll see if I can explain it as easily as possible, then. Personally, I love it as it seems to work much better and quicker than COM scripting does.

I think I may have isolated the key components necessary for sending mail through Lua.

1. First, download this file: https://dl.dropbox.com/u/16729822/email.zip
2. Extract everything to the root of your Program Files/CMUD directory. If it asks you to overwrite anything, go ahead and do it.
3. Next, open up Program Files/CMUD/luaemail.lua in notepad.
4. Look for the following lines:
Code:
from = '<yourlogin@gmail.com>',
user = 'yourlogin',
password = 'yourpassword',


Change it appropriately. For instance, if your email was ImJoeSchmoe@gmail.com, you'd change the from to:
Code:
 from = '<ImJoeSchmoe@gmail.com>'

Make sure you keep the angle brackets.
5. After making the necessary changes, it's time to go to CMUD and enter the Lua prompt (Ctrl + `)
6. Type: require 'luaemail' to call the functions into CMUD.
7. To send a message, type (in Lua prompt): sendMessage("some@emailaddress.com","Your subject","Your message")

That should be about it. If you get any issues whatsoever, you may need to download the OpenSSL Visual C++ Redistributables, which you can find here.

If you run into any problems, let me know. I've tried to streamline it as much as possible, but I never know how it's going to turn out. Also, if you want to send a text message, you can do so using the following format:

sendMessage("1234567890@carriertextemail.com","",Text from CMUD!")

You can look up your carrier's specific email address by googling your carrier's name and "text message email". Lastly, you can send multiple line emails as well with the inclusion of <br> at the proper places, as it recognizes HTML code and will apply it properly. You can put this all into an alias, doing:

Code:
#ALIAS sendemail {#LUA {sendMessage(zs.param(1), zs.param(2), zs.param(3)}}


and just typing sendemail "me@myown.com" "Subject" "Message"

I hope this helps!
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Tue Apr 02, 2013 12:26 pm   
 
Thanks for taking the time to do this Charneus. Sorry I haven't gotten back sooner, but have been busy.

I tried this, but unfortunately it did not work.

When I try require 'luaemail' I get:

Parse Error
Error parsing command:
loop or previous error loading module 'luaemail' (line 1)

require 'luaemail'

Stack trace:
[C]:-1:in function "require"
[string "code"]:1:in main chunk"



if I try to send an email I get:

Parser Error
Error parsing command:
attempt to call global 'sendMessage' (a nil value) (line 1)

sendMessage("my test email address","testing","test")

Stack trace:
[string "code"]:1:in main chunk"

All the files were extracted into c:\progra~1\cmudpro\
I tried installing the visual c+, but that didn't help

Any ideas what happened?

Again, thanks for your help!
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Tue Apr 02, 2013 11:30 pm   
 
I missed something.

The very first time I try to run require 'luaemail' I get this

Parse Error
Error parsing command:

module 'socket' not found:
no field package.preload['socket']
no file '.\socket.lua'
no file 'C:\Program Files (x86)\CMUDPro\lua\socket.lua'
no file 'C:\Program Files (x86)\CMUDPro\lua\socket\init (line 11)
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Wed Apr 03, 2013 2:33 am   
 
Copy the contents of the luaemail.lua file, change command prompt to Lua command prompt, paste the contents and hit enter. What happens when you do that?
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Wed Apr 03, 2013 2:35 am   
 
there is no socket.lua in the zip file. I tried downloading socketlua from another website, but I still couldn't get it to function properly.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Wed Apr 03, 2013 3:25 am   
 
Try downloading the zip file again and copying the contents over to the same folder. I added two more folders. Let me know how it works out from there.
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Wed Apr 03, 2013 12:39 pm   
 
Parse Error
Error parsing command:
"error loading module 'ssl' from file '.\ssl.dll':
The specified procedure could not be found. (line 0)

require 'luaemail'

Stack trace:

[C]:-1:in a C function
[C]:-1:in function "require"
.\luaemail.lua:5:in main chunk
[C]:-1:in function "require"
[string "code"]:1:in main chunk



After that, sendmail fails like normal.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Thu Apr 04, 2013 3:08 pm   
 
I'll see what I need to do on my end here, then update it once I figure it out. I'm documenting the steps this time to make sure I get everything, too. :p
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Mon Apr 15, 2013 7:56 pm   
 
Have you had any luck digging up all the required files to make this work?
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Tue Apr 16, 2013 6:52 pm   
 
Sorry, been busy with school and whatnot, but I may have found something. Once I'm out of class, I'll update the post. Sorry for taking so long on it!
Reply with quote
Tarn
GURU


Joined: 10 Oct 2000
Posts: 873
Location: USA

PostPosted: Tue Apr 16, 2013 10:25 pm   
 
charneus wrote:
Sorry, been busy with school and whatnot, but I may have found something. Once I'm out of class, I'll update the post. Sorry for taking so long on it!


If you have too much trouble, it shouldn't be that hard to script an SMTP (telnet) session in CMUD for email and most of the big cellphone providers have (used to have?) email->text gateways.

Example:
220 mail.example.com ESMTP Sendmail 8.13.1/8.13.2; Tue, 16 Apr 2013 18:19:50 -0400 (PDT)
helo example.com
250 mail.example.com Hello testserv.att.com [111.7.212.178], pleased to meet you
mail from:tarn@example.com
250 2.1.0 tarn@example.com... Sender ok
rcpt to:charneusl@example.com
250 2.1.5 charneus@example.com... Recipient ok
data
354 Enter mail, end with "." on a line by itself
From: tarn@example.com
To: charneus@example.com
Subject: test message

This is the first line of a test message.
Second line.
Lst line.
.
250 2.0.0 w67JFrbs485232 Message accepted for delivery
quit
221 2.0.0 mail.example.com closing connection
Reply with quote
Tarn
GURU


Joined: 10 Oct 2000
Posts: 873
Location: USA

PostPosted: Wed Apr 17, 2013 3:09 pm   
 
For a quick and dirty solution, try this.

You'll need to set:
messagetext
msgsubject
recipientemail
senderemail
senderserver

in a session defined to connect to port 25 of whatever mail server your ISP tells you to use (it probably blocks direct connections to arbitrary mail servers).

Then, call the alias sendemail

Might need tweaking if your particular server responses are different..

<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<class name="smtp">
<trigger priority="20" regex="true">
<pattern>220(.+)</pattern>
<value>#echo matched 2 2 0
#NOOP the server's greeting
helo @senderserver
</value>
</trigger>
<var name="senderserver">mail.example.com</var>
<var name="senderemail">"sender@example.com"</var>
<trigger priority="50" regex="true">
<pattern>250 (.+)</pattern>
<value>step</value>
</trigger>
<var name="msgstate">3</var>
<alias name="sendemail">
<value>msgstate = 0
#connect</value>
</alias>
<alias name="step">
<value>#SWITCH (@msgstate = 0) {
msgstate = 1
mail from: @senderemail
} (@msgstate = 1) {
msgstate = 2
rcpt to: @recipientemail
} (@msgstate = 2) {
msgstate = 3
data
} (@msgstate = 3) {
#NOOP after skipping the state when server says 354
quit}
{
#NOOP Shouldn't happen...
#echo Error in SMTP, stepped past end of defined steps
}</value>
</alias>
<var name="recipientemail">"receiver@example.com"</var>
<var name="messagetext">abcdefg
testing
hijklmnop
</var>
<trigger priority="110" regex="true">
<pattern>354 (.+)</pattern>
<value>#ECHO matched 3 5 4
From~: @senderemail
To~: @recipientemail
Subject~: @msgsubject
%crlf
@messagetext %crlf
~.%crlf
msgstate = 3
</value>
</trigger>
<var name="msgsubject">Test message</var>
<trigger priority="130" regex="true">
<pattern>221 (.*)</pattern>
<value>#NOOP and we're done... server is disconnecting
#DISCONNECT
</value>
</trigger>
</class>
</cmud>
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net