mIRC Home    About    Download    Register    News    Help

Print Thread
#215184 06/09/09 04:52 PM
Z
zigster
zigster
Z
I have an idea for making a mirc script that will send an SMS to your mobile phone when someone queries you, or through the use of a trigger.

My own mobile phone carrier allows you to send text messages to phones by emailing mycellphonenumber@msg.telus.com. Example being 4031234567@msg.telus.com. The easiest way that I could see to implement this would be through authenticated smtp, such as your ISPs mail server.

In channel example, through use of a trigger:

>!sms Zigster, where are you? Come on IRC!

Which would send an email to your preferred SMS provider with the message body being "Zigster, where are you? Come on IRC!"

Some sort of flood protection would also need to be implemented, so that it's not abused. Say that the script will only send an SMS once every 5 minutes.

I'm just putting this out there for anyone who may find an interest in such an endeavor. I've already searched tirelessly to see if such a script exists. I'm also a bit busy in my life to be learning mirc scripting just to implement this idea.

If there's anyone out there who finds an interest in this, I'd greatly appreciate your effort. I'm sure that many people would find a use for it beyond just myself. smile

#215186 06/09/09 04:53 PM
Joined: Jan 2007
Posts: 1,155
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,155
I think the abuse that could be generated from this type of script greatly outweighs the usefullness.

#215228 08/09/09 02:06 PM
Joined: Oct 2005
Posts: 1,671
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,671
It seems to me that someone has already done something similar on this forum. All you would really need is a SMTP script that sends an email to the sms email address. Search this forum for SMTP and you might find something useful.

-genius_at_work

Z
zigster
zigster
Z
Originally Posted By: genius_at_work
It seems to me that someone has already done something similar on this forum. All you would really need is a SMTP script that sends an email to the sms email address. Search this forum for SMTP and you might find something useful.

-genius_at_work

Interesting, and the script was made by yourself even! smile

Here is your script in an updated, and ready to use form.

Quote:
on 1:TEXT:!sms*:#:{
if (%report.buffer) {
notice $nick A text has already been sent to YOUR_USER_NAME less than 5 minutes ago!
return
}
else { /sendmail $nick says: $2-
}
set -u300 %report.buffer 1
notice $nick Sending YOUR_USER_NAME your text message, $nick $+ .
sendmail
}

alias sendmail {
if (%sndmail.busy) {
echo -a Already sending. Try again later.
return -1
}
set %sndmail.busy 1
.timersmtp 1 5 mailsockclose sendmail


;------ SERVER SETTINGS ------
set %sndmail.smtpserver smtp.yourisp.net
set %sndmail.smtpport 25

set %sndmail.doauth $false
set %sndmail.authuser SMTP_USER_NAME
set %sndmail.authpass SMTP_USER_PASSWORD

set %sndmail.debug $true

;------ SET THESE VALUES THEN CALL /sendmail -----
set %sndmail.fromaddress youremail@yourisp.net
set %sndmail.toaddress YOUR_SMS_EMAIL_ADDRESS

;------
;
set %sndmail.body $1-
set %sndmail.logfile $+(maillog.,$asctime(dd.mm.yyyy),.txt)
set %sndmail.state 1

if ($sock(sendmail)) sockclose sendmail
write %sndmail.logfile # Connect Attempt to %sndmail.smtpserver $+ : %sndmail.smtpport
sockopen sendmail %sndmail.smtpserver %sndmail.smtpport
}
;
on *:sockread:sendmail:{
var %temptext
sockread %temptext
tokenize 32 %temptext

;echo 2 -a %sndmail.state > $1-
.timersmtp 1 5 mailsockclose $sockname

write %sndmail.logfile $asctime(HH:nn:ss) -> $1-
if ((%sndmail.state == 1) && ($1 == 220)) {
mailsockwrite EHLO localhost
maildebug 220 -> EHLO (Introduce ourselves)
%sndmail.state = 2
}
elseif ((%sndmail.state == 2) && ($left($1,4) == 250-)) {
; Do nothing
}
elseif ((%sndmail.state == 2) && ($1 == 250)) {
if (%sndmail.doauth) {
mailsockwrite AUTH LOGIN
maildebug 250 -> AUTH LOGIN (Begin authentication)
%sndmail.state = 3
}
else {
mailsockwrite MAIL From: $+ %sndmail.fromaddress
maildebug 250 -> MAIL (Auth OK; Specify FROM address)
%sndmail.state = 6
}
}
elseif ((%sndmail.state == 3) && ($1 == 334)) {
mailsockwrite $encode(%sndmail.authuser,m)
maildebug 334 -> $encode(%sndmail.authuser,m) (Send Base64 encoded username)
%sndmail.state = 4
}
elseif ((%sndmail.state == 4) && ($1 == 334)) {
mailsockwrite $encode(%sndmail.authpass,m)
maildebug 334 -> $encode(%sndmail.authpass,m) (Send Base64 encoded password)
%sndmail.state = 5
}
elseif ((%sndmail.state == 5) && ($1 == 535)) {
mailsockwrite QUIT
maildebug 535 -> QUIT (Auth failed; Disconnect)
%sndmail.state = -1
}
elseif ((%sndmail.state == 5) && ($1 == 235)) {
mailsockwrite MAIL From: $+ %sndmail.fromaddress
maildebug 250 -> MAIL (Auth OK; Specify FROM address)
%sndmail.state = 6
}

elseif ((%sndmail.state == 6) && ($1 == 250)) {
mailsockwrite RCPT To: $+ %sndmail.toaddress
maildebug 250 -> RCPT (Specify TO address)
%sndmail.state = 7
}

elseif ((%sndmail.state == 7) && ($1 == 250)) {
mailsockwrite DATA
maildebug 250 -> DATA (Initiate BODY specification)
%sndmail.state = 8
}

elseif ((%sndmail.state == 8) && ($1 == 354)) {
mailsockwrite Subject: %sndmail.subject
mailsockwrite $crlf
mailsockwrite %sndmail.body
mailsockwrite .
maildebug 354 -> SEND (Specify BODY data; Send email)
%sndmail.state = 9
}
elseif ((%sndmail.state == 9) && ($1 == 250)) {
mailsockwrite QUIT
maildebug 250 -> QUIT (Email accepted; Disconnect)
%sndmail.state = -1
}

elseif ((%sndmail.state < 0) && ($1 == 221)) {
sockclose $sockname
maildebug 221 (Quit successful)
unset %sndmail.*
}
else {
mailsockwrite QUIT
maildebug -> QUIT (Unhandled result; Disconnect)
maildebug ** 4ERROR: $1-
set %sndmail.state -1
}
}
;
alias mailsockwrite {
sockwrite -n $sockname $1-
write %sndmail.logfile $asctime(HH:nn:ss) <- $1-
}
alias maildebug { if (%sndmail.debug) echo 3 -at $1- }
alias mailsockclose {
if ($sock($1)) mailsockwrite $1 QUIT
.timersmtp2 1 3 mailsockcleanup $1
}

alias mailsockcleanup {
if ($sock($1)) sockclose $1
unset %sndmail.*
}

on *:START:{ unset %sndmail.* }

Original thread here.

All credit goes to genius_at_work!

Thanks! laugh


Link Copied to Clipboard