Auto reply sms

For user who dont speak german please use this part of my forum
bnilantha
Beiträge: 43
Registriert: Di 4. Nov 2008, 14:56

Beitrag von bnilantha »

FJ hat geschrieben:
save the file, then open the file %appdata%\MyPhoneExplorer\general.ini and add this lines:

Code: Alles auswählen

[EventHandlers] 
OnIncomingMessage=<path to script> number="%number" text="%text"
i tried with this on IE it was working fine. But on google chrome and firefox split text by space. i cant get full text
Bernard Nilantha
FJ
Site Admin
Beiträge: 32106
Registriert: Mi 15. Feb 2006, 01:16
Wohnort: Tirol
Kontaktdaten:

Beitrag von FJ »

Why you are using a browser to accept this command ? If it does not work on chrome then you have to replace the spaces probably by a script with %20
Ich bitte um Verständnis daß ich aufgrund des hohen Aufkommens im Forum und meines zeitlichen Rahmens nichtmehr jeden Thread im Forum persönlich lesen bzw. beantworten kann.

Bitte benutzt auch die Forum-Suche bzw. die FAQ
bnilantha
Beiträge: 43
Registriert: Di 4. Nov 2008, 14:56

Beitrag von bnilantha »

FJ hat geschrieben:Why you are using a browser to accept this command ? If it does not work on chrome then you have to replace the spaces probably by a script with %20
i want to save sms to mysql database once recieved sms also have to some function. i cant replace it on your command line. how can i do that?
Bernard Nilantha
rationalboss
Beiträge: 6
Registriert: Mi 22. Feb 2012, 16:55

Beitrag von rationalboss »

FJ hat geschrieben:MyPhoneExplorer has already interfaces to detect incoming messages and to send messages. Create a *.vbs-File with this content:

Code: Alles auswählen

Dim i, text, number, tmp, outtext

'First we filter out the commandlinearguments. We get the sender of the SMS and the text throught commandline from MPE
For i = 0 to WScript.Arguments.Count - 1
  tmp = WScript.Arguments.Item(i)
  If Instr(1, LCase(tmp), "number=") = 1 Then
    number = Mid(tmp,8)
  ElseIf Instr(1, LCase(tmp), "text=") = 1 Then
    text = Mid(tmp,6)
  End If
Next

'MPE does send the Number if possible also with the name (like "Name [0123456789]"), we have to cut this of.
If Instr(1,number,"[") <> 0 Then
  number = Mid(number, InstrRev(number,"[") + 1)
  If Instr(1, number, "]") <> 0 Then
    number = Left(number, Instr(1, number, "]") - 1)
  End If
End If

'Msgbox "Text=" & text & vbNewLine & "Number=" & number  'This line is for debugging, it shows the parsed variables

If IsNumeric(number) = True Then 

' you can also set a numberfilter and/or textfilter like: If number = "1234567" And InStr(1,text,"question") <> 0 Then
' here you could do anything. An example: Another program writes some value (lets say the weather) into a local file
' your script checks if the messagetext contained "weather" and if yes then the script reads the wheater-textfile and
' tells the sender of the message how the weather will be. Or maybe it answers with the count of unread emails when the
' text contained "emails"

   outtext = "Automated response (" & text & "):%nThis is a test-feedback"  'here the returned text is set, %n represents a line break

   RunMPE "action=sendmessage flags=noerrmsg savetosent=1 number=" & number & " text=" & Chr(34) & outtext & Chr(34)
End If


Function RunMPE(Arguments) 
  set shell = CreateObject("WScript.Shell") 
  shell.run "myphoneexplorer " & Arguments ,3 
End Function
save the file, then open the file %appdata%\MyPhoneExplorer\general.ini and add this lines:

Code: Alles auswählen

[EventHandlers] 
OnIncomingMessage=<path to script> number="%number" text="%text"
how can the received message be deleted? :)
bnilantha
Beiträge: 43
Registriert: Di 4. Nov 2008, 14:56

Beitrag von bnilantha »

??
Bernard Nilantha
FJ
Site Admin
Beiträge: 32106
Registriert: Mi 15. Feb 2006, 01:16
Wohnort: Tirol
Kontaktdaten:

Beitrag von FJ »

Do it with Visual Basic Scripts

Please do not misunderstood, i am helpfully to everybody. But i do not understand why you are dealing with pho, mysql,... without knowing even the basics. Its not the target that i will build scripts for every tiny thing for you. Learn scripting, there are many stuff about this in the web and i wrote already some scripts for you so you have examples
Ich bitte um Verständnis daß ich aufgrund des hohen Aufkommens im Forum und meines zeitlichen Rahmens nichtmehr jeden Thread im Forum persönlich lesen bzw. beantworten kann.

Bitte benutzt auch die Forum-Suche bzw. die FAQ
Antworten