Page 1 of 2 12 LastLast
Results 1 to 25 of 29

Thread: SendSMS using Google Voice via Simba!

  1. #1
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Talking SendSMS using Google Voice via Simba!

    This function will send an SMS using Google Voice to the number of your choice, using Simba. FYI, Google Voice is currently only available 100% free for United States users, and you may only SMS to +1 country code (US/Canada).

    At the moment, there are one blocker that you as a user will experience;
    Problem: HTTPS sites do not load in Simba. This is due to lacking proper SSL libs.
    Solution: Extract the two attached OpenSSL DLLs into the same folder as your Simba.exe. NOTE: OpenSSL uses an Original BSD-style license with an announcement clause that makes it "incompatible" with GPL; I am unsure if these dlls are legal to redistribute, and using OpenSSL is even illegal in some non-free countries, so use at your own risk.


    Without further to do, here's the code! Enjoy, and post any bugs you have with it :)
    Simba Code:
    program GoogleVoiceSMSSender;

    (*
    SendSMS
    ~~~~~~~~~~

    .. code-block:: pascal

        function SendSMS(yourEmail, yourPassword, toNumber, theMessage: string): boolean;

    Sends an SMS from a Google Voice account to a mobile number in the US.

    yourEmail/yourPassword should have a Google Voice number set up @ voice.google.com
    toNumber should be a 10 digit US number; no spaces nor special characters.
    theMessage should be under 160 characters.

    Please don't use this to spam people! Google takes abuse seriously.

    .. note::

        Author: Harry and Sex
        Last Modified: 4 November 2014

    Example:

    .. code-block:: pascal

        if SendSMS('FakeGoogleLogin@gmail.com', 'mypassword', '5551231234', 'This Simba SMS sending is really cool!') then
          WriteLn('Woohoo!');
    *)

    function SendSMS(yourEmail, yourPassword, toNumber, theMessage: string): boolean;
    var
      cl, i, redir: integer;
      verifyStatus, s, loc, _rnr_se: string;
      PostVars: TStringArray;
    begin
      try
      cl := InitializeHTTPClient(True);
      SetHTTPUserAgent(cl, 'SimbaVoice/0.2');

      verifyStatus := '';
      if (length(yourEmail) < 1) or (length(yourPassword) < 1) then
        verifyStatus := 'up';
      if (length(toNumber) <> 10) then
        verifyStatus := 'number';
      if (length(theMessage) > 160) then
        verifyStatus := 'message';

      case verifyStatus of
        'up': WriteLn('Email or Password is invalid!');
        'number': WriteLn('Number is invalid! Number must be 10 digits, no spaces or symbols.');
        'message':
        begin
          WriteLn('WARNING: Your message is long (length: '+toStr(length(theMessage))+' characters)!');
          WriteLn(' Your message should be under 160 characters, but it will most likely still go through.');
          verifyStatus = '';
        end;
      end;
      if (verifyStatus <> '') then
        Exit;

      WriteLn('Logging into Google Voice.'); // Load login page for GALX etc
      s := GetHTTPPage(cl, 'https://accounts.google.com/ServiceLogin?service=grandcentral&passive=1209600&continue=https://www.google.com/voice&followup=https://www.google.com/voice&ltmpl=open');
      if (length(s) < 10) then
      begin
        WriteLn('You don''t have the SSL libs for Simba, or https://accounts.google.com/ is blocked by your firewall.');
        WriteLn('You must place libeay32.dll and libssl32.dll in the same folder as your Simba.exe!');
        Exit;
      end;

      PostVars := ['Email', yourEmail,
                   'GALX', between('    value="', '">', s),
                   'Passwd', yourPassword,
                   'continue', 'https://www.google.com/voice',
                   'followup', 'https://www.google.com/voice',
                   'service', 'grandcentral',
                   'signIn', 'Sign in'];

      for i := 0 to high(PostVars) do
      begin
        AddPostVariable(cl, PostVars[i], PostVars[i + 1]);
        inc(i);
      end;

      s := PostHTTPPageEx(cl, 'https://accounts.google.com/ServiceLoginAuth');
      ClearPostData(cl);
      if (pos('LoginDoneHtml', s) <> 0) then
        WriteLn('Login successful!')
      else begin
        WriteLn('Login failed. Check your username/password and ensure your Google account is validated.');
        Exit;
      end;

      WriteLn('Loading inbox, please be patient...');
      redir := 0;
      repeat  // follow Google's insane number of redirects.
        loc := between('Location: ', #13#10, GetRawHeaders(cl));
        writeln(loc);
        if loc <> '' then
          s := GetHTTPPage(cl, loc)
        else
          break;
        DebugLn('Following link to '+ loc);
        if (redir > 9) then
        begin
          WriteLn('Took over 9 redirects to get to Google Voice. Something is wrong!');
          Exit;
        end;
        inc(redir);
      until(loc = '');

      _rnr_se := between('<input name="_rnr_se" type="hidden" value="','"/>',s); // Some anti-CSRF stuff Google has.
      if (_rnr_se = '') then
      begin
        WriteLn('The CSRF code was not found properly!');
        WriteLn('Ensure your Google Voice account works, and that you have a US-based IP address.'); // country-specific Google domains break this script for some reason, t.ex google.se
        Exit;
      end
      else
        DebugLn('CSRF: '+_rnr_se);

      WriteLn('Sending SMS now...!');
      AddPostVariable(cl, 'phoneNumber', '+1'+toNumber);
      AddPostVariable(cl, 'text', theMessage);
      AddPostVariable(cl, '_rnr_se', _rnr_se);
      s := PostHTTPPageEx(cl,'https://www.google.com/voice/sms/send/');
      ClearPostData(cl);

      if (Pos('Your client has issued a malformed or illegal request',s) <> 0) then
      begin
        WriteLn('You got a HTTP-400 error from Google. This means you sent invalid cookies. This probably means your Simba is out of date.');
        Exit;
      end;

      case s of  // return codes. There is no published list, and these may be inaccurate.
        '{"ok":true,"data":{"code":0}}':
        begin
          WriteLn('SMS sent okay!');
          Result := True;
        end;

        '{"ok":false,"data":{"code":2046}}':
          WriteLn('Error 2046: you do not have a Google Voice number.');

        '{"ok":false,"data":{"code":67}}':
          WriteLn('Error 67: invalid destination (only US numbers supported)');

      else
        WriteLn('We did not get a proper send code. Result: '+s);
      end;

      finally
        FreeHTTPClient(cl);
      end;
    end;

    begin
      ClearDebug;

      if SendSMS('usename@gmail.com','password','5555555555','Simba is cool!') then
        writeln('Yay!');
    end.

    Enjoy. :)
    Attached Files Attached Files
    Last edited by Harry; 11-04-2014 at 04:25 PM.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  2. #2
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Looks good .
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  3. #3
    Join Date
    Jan 2012
    Location
    Long Island, NY
    Posts
    413
    Mentioned
    5 Post(s)
    Quoted
    95 Post(s)

    Default

    Awesome work can't wait to try it out in a script!

  4. #4
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    Something I been waiting for! Thank You, must test!

  5. #5
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    2. Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in
    * the documentation and/or other materials provided with the
    * distribution.
    So we can just add it to LICENSE, no? Lol.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  6. #6
    Join Date
    Oct 2011
    Posts
    434
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    =0 I ever wanted something like this. Awesome! Thank you Harry ^^

  7. #7
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    193
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    I mentioned doing this in i believe Justin's thread. Good job, I didn't know there is blockers. Good to know nice tut! So in order for Simba to receive messages, maybe there is a way to log in to google voice and read the messages from a certain sender. You could also read the HTML page, and use that aswell.

    Maybe, send message->Google voice->Forwards to some other email that is totally HTML based.

    Just some suggestions. Also idk if you can email google voice, or the account then have that forwarded to your phone. I'd imagine there is some ways you could work this out, which would be the easiest?

  8. #8
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Looks great, but what is the point of knowing our script ran into a random when we are out?

  9. #9
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by hunt3rx3 View Post
    Looks great, but what is the point of knowing our script ran into a random when we are out?
    This could extend the functionality of RandomTool so that you may be able to reply with commands at one point, such as "Your account xxx has entered the xxx random. Reply with 'solve' or 'logout'." etc.

    This can be used for things other than randoms with the addition of TMayaTimer (thanks Daniel!) we can do things like remote control.

    Also, please note, I've never used Google Voice so I'm not sure if it is possible to receive messages.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  10. #10
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    193
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    This could extend the functionality of RandomTool so that you may be able to reply with commands at one point, such as "Your account xxx has entered the xxx random. Reply with 'solve' or 'logout'." etc.

    This can be used for things other than randoms with the addition of TMayaTimer (thanks Daniel!) we can do things like remote control.

    Also, please note, I've never used Google Voice so I'm not sure if it is possible to receive messages.
    It is possible I've used GV before. What is TMayaTimer O_O? Is that the maya plugin or whatever?

  11. #11
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by LordJashin View Post
    It is possible I've used GV before. What is TMayaTimer O_O? Is that the maya plugin or whatever?
    Nah, it is basically a working TTimer. It runs in a separate thread etc. It will be in Simba 0.99rc4.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  12. #12
    Join Date
    Sep 2006
    Posts
    89
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wonderful idea! Thank you kindly!!

  13. #13
    Join Date
    Nov 2011
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hey i cant code because i dont really understand the tutorials but was trying to read through this code i guess, i wanted it just to text me if it was stuck in a random but just if its in a random mind enligtening me?

  14. #14
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Code:
    Logging into Google Voice.
    Login successful!
    Sending SMS...
    You got a HTTP-400 error from Google. This means you sent invalid cookies. This probably means your Simba is out of date.
    Successfully executed.
    This looks so awesome.

    Is there a fix to make it work again yet ? Got Simba Rev. 984


    //or it maybe that its still working just for for EU numbers
    Last edited by caused; 06-08-2012 at 01:08 PM.

  15. #15
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by caused View Post
    Code:
    Logging into Google Voice.
    Login successful!
    Sending SMS...
    You got a HTTP-400 error from Google. This means you sent invalid cookies. This probably means your Simba is out of date.
    Successfully executed.
    This looks so awesome.

    Is there a fix to make it work again yet ? Got Simba Rev. 984


    //or it maybe that its still working just for for EU numbers
    Read again the solution for problem 1.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  16. #16
    Join Date
    Feb 2012
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    cool..

    Is this HTTP stuff the same as a webrequest?

  17. #17
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Velvet Glam View Post
    cool..

    Is this HTTP stuff the same as a webrequest?
    Yes.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  18. #18
    Join Date
    Apr 2012
    Location
    St. Louis, Missouri
    Posts
    383
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    I have been thinking about this for months! I even posted a thread about it, and people said "yeah it could be possible", and here it is. It's been here for like 4 months and I'm just now seeing it!?!?

    By the way, I intend on using this to help me get my max cape. I plan on using it when doing skills like wcing in remote areas where you don't see anyone for hours upon hours besides an occasional bot hunter - I have a "SomeoneTalked" function (thanks to sin ) that I call with FindNormalRandoms, and I have it play a loud alarm to alert me so I can get to my pc and respond. Obviously this only works throughout my house.

    But it'll be nice to be out and still have bot running, so if someone talks I can have a text sent to me, and I can get on team viewer via my iPhone and respond!

    Wala, 24 hr safe botting, with REAL human responses !!!

  19. #19
    Join Date
    Jun 2012
    Location
    THE Students-City of Holland
    Posts
    332
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Really cool! Will test this in Ă  while )))
    Former Name: MasterCrimeZ.
    ToDo: 1. Finish my private bot 2. Make some cool bots for this community 3. Become a member
    If you have any questions about scripting, feel free to PM me

  20. #20
    Join Date
    Nov 2011
    Location
    Louisiana
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    This could extend the functionality of RandomTool so that you may be able to reply with commands at one point, such as "Your account xxx has entered the xxx random. Reply with 'solve' or 'logout'." etc.

    This can be used for things other than randoms with the addition of TMayaTimer (thanks Daniel!) we can do things like remote control.

    Also, please note, I've never used Google Voice so I'm not sure if it is possible to receive messages.
    This is exactly what I did until Warrior's site went down. I'd just use the Random Tool so it stopped my script, and have a SMS message sent to my phone. I'd login via TeamViewer and if it was one I know Simba solves, click let SRL do it. If not, I'd either just logout or do it myself. Worked really well.

    Being able to get a SMS sent to your phone saying- "You are in the Molly Random. Reply SOLVE to solve, or LOGOUT to logout" would be even sweeter. To know what random we were in would be awesome.

    We need to make this happen!

  21. #21
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    nice, subscribing till simba official release solves issues.

  22. #22
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Updated this, fixed some stuff, added stuff. Let me know if any problems!


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  23. #23
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Woo, looks like Harry is back in the game
    Quote Originally Posted by Harry View Post
    Updated this, fixed some stuff, added stuff. Let me know if any problems!
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  24. #24
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by Harry View Post
    Updated this, fixed some stuff, added stuff. Let me know if any problems!
    Do we still need to muck around to get this to work in Simba?

  25. #25
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •