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?
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?
So how would I do that?!?!?!
trilez has a tut in the member section, ask him to share![]()
<TViYH> i had a dream about you again awkwardsaw
Malachi 2:3
Heres SCAR code:
and heres the PHP 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;
PHP Code:<?php
$mail = "yourmail@domain.com";
$subject = "ERROR: " . $_POST["error"];
$message = $_POST["text"];
if (strlen($mail) > 1 && strlen($subject) > 7 && 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.
Frement Where do I post the php code? In MySQL.
Last edited by Death12652; 05-16-2010 at 06:21 PM.
Last edited by Frement; 05-16-2010 at 09:08 PM.
There used to be something meaningful here.
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
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)
Originally Posted by #srl
"A programmer is just a tool which converts caffeine into code"
Here...
Or am I doing it wrong?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.
Well first of all, that shouldn't compile.![]()
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)
Originally Posted by #srl
"A programmer is just a tool which converts caffeine into code"
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.
I did what you said but it doesn't send the email. It says successfully compiled but doesn't send the email?
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.
I have this...
but nothing in my inbox? plus I tried port 25 and 587.Code:begin SendEmail('smtp.live.com', '*********@live.com', '*********@live.com', 'hi', 'hola'); end.
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'...)
Thanks you!!! it works now!!!
Glad i could help![]()
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?
Just have a constant variable.const ISP = 'smtp.comcast.net'; Email = 'wat@wat.com'; PhoneNumber = '1234567890@vtext.com';
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)