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

Thread: Notifications

  1. #1
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Notifications

    Is there a way for scar to email or something of that nature to the owner if something were to go wrong with a script? Like if it doesn't find a color or something?

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by death12652 View Post
    Is there a way for scar to email or something of that nature to the owner if something were to go wrong with a script? Like if it doesn't find a color or something?
    Yes, by using a HTTPPostaPage or similar, using PHP on your website to send the mail.
    There used to be something meaningful here.

  3. #3
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So how would I do that?!?!?!

  4. #4
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    trilez has a tut in the member section, ask him to share
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  5. #5
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Heres SCAR code:
    SCAR Code:
    function MailError(Error, Text: String): String;
    var Page: Integer;
    begin
      Page := InitializeHTTPClient(False, False);
      ClearPostData(Page);
      AddPostVariable(Page, 'error', Error);
      AddPostVariable(Page, 'text', Text);
      Result := PostHTTPPageEx(Page, 'http://www.domain.com/mail.php');
      FreeHTTPClient(Page);
    end;
    and heres the PHP code:
    PHP Code:
    <?php

    $mail 
    "yourmail@domain.com";
    $subject "ERROR: " $_POST["error"];
    $message $_POST["text"];

    if (
    strlen($mail) > && strlen($subject) > && strlen($message) > 1) {
      
    mail($mail$subjet$message);
      echo 
    "Success!";
    } else {
      echo 
    "Failed!";
    }


    ?>
    Last edited by Frement; 05-16-2010 at 09:07 PM.
    There used to be something meaningful here.

  6. #6
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Frement Where do I post the php code? In MySQL.
    Last edited by Death12652; 05-16-2010 at 06:21 PM.

  7. #7
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    Heres SCAR code:
    SCAR Code:
    function MailError(Error, Text: String): String;
    begin
      Page := InitializeHTTPClient(False, False);
      ClearPostData(Page);
      AddPostVariable(Page, 'error', Error);
      AddPostVariable(Page, 'text', Text);
      Result := PostHTTPPageEx(Page, 'http://www.domain.com/mail.php');
    end;
    and heres the PHP code:
    PHP Code:
    <?php

    $mail 
    "yourmail@domain.com";
    $subject "ERROR: " $_POST["error"];
    $message $_POST["text"];

    if (
    strlen($mail) > && strlen($subject) > && strlen($message) > 1) {
      
    mail($mail$subjet$message);
      echo 
    "Success!";
    } else {
      echo 
    "Failed!";
    }


    ?>
    Don't forget to free the HTTPClient!
    Also, Page doesn't exist in that function..

  8. #8
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    Don't forget to free the HTTPClient!
    Also, Page doesn't exist in that function..
    Yeah sorry about those, i almost exactly copied it from my script :P

    Quote Originally Posted by death12652 View Post
    Frement Where do I post the php code? In MySQL.
    Just make it a PHP file named mail.php

    Then modify the scar function to send it to yoursite.com/mail.php and edit the php file to contain your email address.
    Last edited by Frement; 05-16-2010 at 09:08 PM.
    There used to be something meaningful here.

  9. #9
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So I did what you said and I get this...

    Code:
    [Runtime Error] : Exception: Access violation at address 0077D26D in module 'scar.exe'. Read of address 00000000 in line 5 in script

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

    Default

    Show exactly what you have in your SCAR window.
    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"

  11. #11
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Here...

    Code:
    program New;
    function MailError(Error, Text: String): String;
    begin
      Page := InitializeHTTPClient(False, False);
      ClearPostData(Page);
      AddPostVariable(Page, 'error', Error);
      AddPostVariable(Page, 'text', Text);
      Result := PostHTTPPageEx(Page, 'http://www.domain.com/mail.php');
    end;
    begin
         FreeHTTPClient(Page);
         MailError('Error', 'Video Out Of Date');
    end.
    Or am I doing it wrong?

  12. #12
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Well first of all, that shouldn't compile.

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

    Default

    SCAR Code:
    program New;

    function MailError(Error, Text: String): String;
    var
      Client : integer;
    begin
      Client := InitializeHTTPClient(False, False);
      AddPostVariable(Client, 'error', Error);
      AddPostVariable(Client, 'text', Text);
      Result := PostHTTPPageEx(Client, 'http://www.domain.com/mail.php');
      FreeHTTPClient(Client);
    end;

    begin
         MailError('Error', 'Video Out Of Date');
    end.
    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"

  14. #14
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay It executes and stuff so will it email me the 'Error' and 'video out of date' part or what. Also I want it to email what video. The videos are in a seperate scar file set up as arrays. It chooses a website randomly and goes to it. I want it to send me an email if the video is out of date? I used an OpenWebPage() Function. Thanks.

  15. #15
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by death12652 View Post
    Okay It executes and stuff so will it email me the 'Error' and 'video out of date' part or what. Also I want it to email what video. The videos are in a seperate scar file set up as arrays. It chooses a website randomly and goes to it. I want it to send me an email if the video is out of date? I used an OpenWebPage() Function. Thanks.
    Well you have to make some detection if the video is outdated, then just add it to to text.
    There used to be something meaningful here.

  16. #16
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I did what you said but it doesn't send the email. It says successfully compiled but doesn't send the email?

  17. #17
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by death12652 View Post
    I did what you said but it doesn't send the email. It says successfully compiled but doesn't send the email?
    And you have the PHP done right? Make it writeln the return from the site
    There used to be something meaningful here.

  18. #18
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    if you don't even want to mess with the php, use smtp...

    for example, this will send me a txt message. it works, i just made sure...

    Code:
    program smtpEmail;
    
    Procedure WaitForResponse(c : Integer);
    var  s : String;
    begin
      repeat
       if (ReadConnectionData(c, s)) then
       begin
         Wait(50);
       end else
       begin
         Writeln('Connection error');
         Exit;
       end;
      until (s<>'') or (not IsConnectionOpen(c));
    end;
    
    Procedure SendEmail(smtpserver, frommail, tomail, subject, data : String);
    var  c : Integer;
    begin
      c := OpenConnection(smtpserver, 25, 1000);
      WaitForResponse(c);
      SendConnectionData(c, 'HELO me' + #13#10);
      WaitForResponse(c);
      SendConnectionData(c, 'MAIL FROM: ' + frommail + #13#10);
      WaitForResponse(c);
      SendConnectionData(c, 'RCPT TO: <' + tomail + '>' + #13#10);
      WaitForResponse(c);
      SendConnectionData(c, 'DATA' + #13#10);
      WaitForResponse(c);
      SendConnectionData(c, 'Subject: ' + subject + #13#10#13#10);
      SendConnectionData(c, data + #13#10);
      SendConnectionData(c, '.' + #13#10);
      WaitForResponse(c);
    end;
    
    begin
      SendEmail('smtp.windstream.net', 'illkillutill@live.com', 'MyPhoneNumber@vtext.com', 'hi', 'hola');
    end.

    Just change "smtp.windstream.net" from the example to whatever your service provider is, like "smtp.yourisp.whatever". Then change "illkillutill@live.com" to your email address, and "MyPhoneNumber" to your number or your email address and it should email you whatever is in the "hi" and "hola" params. Edit: So change "hi" to "Error" and "hola" to "text".
    Last edited by Illkillutill; 05-19-2010 at 03:04 AM.

  19. #19
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I have this...

    Code:
    begin
      SendEmail('smtp.live.com', '*********@live.com', '*********@live.com', 'hi', 'hola');
    end.
    but nothing in my inbox? plus I tried port 25 and 587.

  20. #20
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    erm... i dont think your isp is live.com?

    who is your internet service provider? [i.e] comcast, windstream, etc...

    try fixing that and see what comes up


    Edit: so if it were comcast, make it ('smtp.comcast.net'...)

  21. #21
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks you!!! it works now!!!

  22. #22
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Glad i could help

  23. #23
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Will it work for everyone. I have Comcast by the way. If I send it to them to they need to change that part to there provider or does it just have to be mine?

  24. #24
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Just have a constant variable. const ISP = 'smtp.comcast.net'; Email = 'wat@wat.com'; PhoneNumber = '1234567890@vtext.com';

  25. #25
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    okay so you do have to change it according to the person. Just wandering and I did. Just making sure that it was the user not who its sending to.
    Last edited by Death12652; 05-20-2010 at 02:30 AM.

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
  •