Send-A-Text — File Browser

Send-A-Textv5.0 / Send-A-Textv5.0 / Send-A-Text / s-a-t.txt

s-a-t.txt — 4.64 KB — Download this file

dialog smst {
  title "Send-a-Text"
  size -1 -1 275 112
  option dbu
  list 1, 147 19 127 75, hsbar vsbar
  text "Select a carrier from the list", 2, 189 2 65 14, center
  text "Phone Number (including area code)", 4, 1 1 55 13
  edit "", 6, 3 43 143 51, multi return autovs vsbar
  text "Enter message here (150 chars left)", 7, 23 31 100 10
  button "Send!", 8, 36 97 37 12, disable
  button "Close", 9, 197 97 37 12, ok
  text "Enter SMTP server", 3, 3 18 52 8
  edit "smtp.server.com", 10, 58 16 50 10, autohs center
  button "Save Info", 11, 114 97 37 12
  text "", 12, 110 3 65 8
  edit "1234567890", 5, 58 3 50 10, limit 10 center
  text "Port:", 13, 109 18 16 8
  edit "25", 14, 125 17 21 10 autohs center
}
on *:dialog:smst:init:*: {
  if (%sms-server) && (%sms-numb) && (%sms-port) { did -ra smst 5 %sms-numb | did -ra smst 10 %sms-server | did -ra smst 14 %sms-port }
  var %x = 1 | while ($read($scriptdirsmslist.txt,%x)) { did -a smst 1 $gettok($ifmatch,1,9) | inc %x }
  if ($read($scriptdirsmslist.txt,w, * $+ %.sms $+ *)) { did -a smst 12 @ $+ $gettok($v1,2,64) | did -c smst 1 $readn }
}
on *:dialog:smst:edit:5:if ($len($did(5)) != 10) { did -b smst 8 } | else did -e smst 8
on *:dialog:smst:edit:6: { 
  var %d = 1, %l = 0
  while ($did(smst,6,%d)) { 
    inc %l $len($v1)
    inc %d  
  }
  var %t = $calc(150 - %l)
  if (%t < 0) { did -b smst 8 | did -ra smst 7 You must delete $remove(%t,-) char(s) }
  if (%t = 0) { did -e smst 8 | did -ra smst 7 You have no more space to input chars }
  if (%t > 0) { did -e smst 8 | did -ra smst 7 Enter message here $+($chr(40),%t) chars left) }
}
on *:dialog:smst:sclick:1:set %.sms $gettok($read($scriptdirsmslist.txt,$did(1).sel),2,64) | did -ra smst 12 $+(@,%.sms)
on *:dialog:smst:sclick:11:if ($len($did(5)) == 10) && ($did(5)) && ($did(14)) { set %sms-server $did(10) | set %sms-numb $did(5) | set %sms-port $did(14) }
on *:dialog:smst:sclick:8:if ($len($did(5)) == 10) && ($did(5)) && ($did(14)) {  set %sms-server $did(10) | set %sms-numb $did(5) | set %sms-port $did(14) | sockopen smst %sms-server %sms-port }
on *:sockopen:smst: {
  if ($sockerr) { .timersmsf smsf | halt }
  did -b smst 5,8,6,1,10
  sockwrite -n smst MAIL $+(FROM:,$remove($me,[,],`,$chr(123),$chr(125),$chr(45),$chr(95),$chr(94),$chr(92)),@,$gettok($server,2-,46))
  if ($sockerr) { .timersmsf smsf | halt }  
  sockwrite -n smst RCPT $+(TO:,%sms-numb,@,%.sms)
  if ($sockerr) { .timersmsf smsf | halt }
  sockwrite -n smst DATA
  if ($sockerr) { .timersmsf smsf | halt }
  var %a = 1 | while ($did(smst,6,%a)) { sockwrite -n smst $did(smst,6,%a) | inc %a }
  if ($sockerr) { .timersmsf smsf | halt }
  sockwrite -n smst .
  if ($sockerr) { .timersmsf smsf | halt }
  .timersms 1 1 smsp
  sockwrite -n smst QUIT
}
on *:sockopen:smstext: {
  if ($sockerr) { .timersmsf 1 1 smsf | echo one | halt }
  sockwrite -n smstext MAIL $+(FROM:,$remove($me,[,],`,$chr(123),$chr(125),$chr(45),$chr(95),$chr(94),$chr(92)),@,$gettok($server,2-,46))
  if ($sockerr) { .timersmsf 1 1 smsf | echo two | halt }  
  sockwrite -n smstext RCPT $+(TO:,%temp.numb)
  if ($sockerr) { .timersmsf 1 1 smsf | echo three | halt }
  sockwrite -n smstext DATA
  if ($sockerr) { .timersmsf 1 1 smsf | halt }
  sockwrite -n smstext %temp.msg
  if ($sockerr) { .timersmsf 1 1 smsf | halt }
  sockwrite -n smstext .
  if ($sockerr) { .timersmsf 1 1 smsf | halt }
  .timersms 1 1 smsp
  unset %temp.*
  sockwrite -n smstext QUIT
}
alias smstext {
  if ($4) && ($gettok($1,2,64)) && ($len($4-) <= 150) && ($3 isnum) {
    set %temp.numb $1
    set %temp.smtp $2
    set %temp.msg $4-
    sockopen smstext %temp.smtp $3
    halt
  }
  else {
    echo -a Incorrect syntax!  Remember you can't have a message longer than 150 cahracters! Here is the correct syntax
    echo -a $chr(160)
    echo -a /smstext <number>@<carrier-pop3-server> <your-smtp-server> <smtp-port> <message>
  }
}
alias smst dialog -m smst smst
alias -l smsf var %b = $input(Message failed to be sent!,ohd,Message Failed!) | if ($dialog(smst)) did -e smst 5,8,6,1,10 
alias -l smsp var %b = $input(Message has been succuessfully sent!,oid,Message Sent!) | if ($dialog(smst)) did -e smst 5,8,6,1,10 
alias -l smsr var %b =  $input(Hope you don't mind reading to readme.txt. If you already read it $+ $chr(44) then dont worry. If not here's you chance...,oqd,Did you read the readme.txt???) | run $scriptdirreadme.txt
menu channel,menu,status {
  Send-A-Text
  .Dialog:smst
  .Readme:run $scriptdirreadme.txt
  .Unload:unload -rs $script | unset %sms-* | unset %.sms
}
on 1:load:echo -a Send-A-Text is now loaded! For use, just look in the pop-ups, or use /smst | .timerreadsms 1 1 smsr