SRL Archive - SRL Archives

[New]PostReport


Kyle Undefined

2008-12-13 04:01:13

Well I know that everyone has wanted to know how well our scripts are doing if they are getting leeched or what not. So me and Floor66 created this function. It uploads the proggy that you have in your script to a MySql database that I have up on the web. I know alot of you will be thinking "Oh noez! It will steal my account!" No, it wont. It only gets the proggy text. The actual site is
http://scarprogressreports.net76.net/ . The welcome page is this, I know it's not much but it's better than nothing. Then when you click on Scar Reports and there will be a link to the show.php NOTE, WHATEVER IS POSTED IN YOUR PROGGY WILL BE POSTED UP HERE.
Those are some tests that I did while making sure it was working.

My database is freely public so nothing is hidden, you can use mine if you would like or you can setup your own. If this is good enough for a nice release I'll right a tutorial on how to setup your own MySql database site. Or if you want to use it privately but want your own database, just PM me or send me a message on MSN.

Currently, the only way to view the reports is by going here http://scarprogressreports.net76.net/show.php but I will fix that as soon as I edit the index.php
Here is the function itself
{*******************************************************************************
function PostReport(ScriptName, Website, Proggy : String): Boolean;
By: Camo Kyle & Floor66
Description: Posts the Progress Report to my database which you can see
*******************************************************************************}
function PostReport(ScriptName, Website, Proggy : String): Boolean;
var
Dbase : String;
Client : Integer;
begin
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
Wait(10);
AddPostVariable(Client, 'proggy', Proggy);
AddPostVariable(Client, 'scn', ScriptName);
Dbase := PostHTTPPageEx(Client, Website);
FreeHTTPClient(Client);
Result := true;
end;

This is an example on how it would be included.
Program New;
{.include SRL\SRL.scar}

Const
Games = 5000;
GetTicketCount = 1000000;

Var
Proggy : String;

{*******************************************************************************
function PostReport(ScriptName, Website, Proggy : String): Boolean;
By: Camo Kyle & Floor66
Description: Posts the Progress Report to my database which you can see
*******************************************************************************}
function PostReport(ScriptName, Website, Proggy : String): Boolean;
var
Dbase : String;
Client : Integer;
begin
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
Wait(10);
AddPostVariable(Client, 'proggy', Proggy);
AddPostVariable(Client, 'scn', ScriptName);
Dbase := PostHTTPPageEx(Client, Website);
FreeHTTPClient(Client);
Result := true;
end;

//below is a test proggy :p
procedure ProgressReport;
begin
ClearDebug;
Writeln('==========RangeGuilder by Camo Kyle ==========');
Writeln('||===== Games Completed : ' +IntToStr(Games));
Writeln('||===== Tickets Earned : ' +IntToStr(GetTicketCount));
Writeln('||===== GP Spent : ' +IntToStr(Games * 200));
Writeln('===================================================');
Writeln('======= Don''t forget to Rep++ if you like ;) ======');
Writeln('===================================================');
Writeln('==============NO PROGGY''S NO UPDATES!=============');
Writeln('===================================================');
end;

Begin
SetupSRL;
ProgressReport;
PostReport('RangeGuilder!', 'http://scarprogressreports.net76.net/add.php', GetDebugText);
End.

Please post your comments/suggestions or whatever else you feel. Thanks for taking the time reading :)

~Camo

noidea

2008-12-13 04:43:37

Impressive guys! Good job!

Magiic

2008-12-13 04:59:40

yeah :P nice, just watch your bandwidth :P

Floor66

2008-12-13 06:07:14

Why don't you make a show.php themed the same as your website…
It's just copypasting :p

[S]paz

2008-12-13 06:08:57

Code and Ability = 100%
Very good job, however, This is good for the leechers that cant be bothered to post the reports, but what about the people that can? if this posts it on your database, then reports within the script thread will decrease. Thus making it harder and more tedious to update the script as they would have to go fishing for the reports?

Maybe?

~Spaz

EvilChicken!

2008-12-13 06:09:48

Wow, this is actually really impressive! (See the "!"? That means I'm serious.)
I really wish you the best of luck, and if you need any help that doesn't involve mySQL, I would be really glad to be able to assist in the development of this.


Great job, I will definitely use it once it's fully ready.

Kyle Undefined

2008-12-13 10:17:30

From: floor66
Why don't you make a show.php themed the same as your website…
It's just copypasting :p

I am, but I need to edit the index.php so that way the page Scar Reports displays show.php The only problem is I can't find a good php editor and I can't do it on the site because it's encrypted. Also, I know how to do it but I couldn't get it working so I left it alone. Do you know how to add a filter in there? So that way the show.php would have:
$sel = mysql_query("SELECT * FROM `proggies` LIKE ' ?>'");
You know what I mean? So then, if you only wanted to look up your script all you have to do it like .net/show.php?value= whatever and it will only pull proggies with what you have specified.


From: [S]paz
Code and Ability = 100%
Very good job, however, This is good for the leechers that cant be bothered to post the reports, but what about the people that can? if this posts it on your database, then reports within the script thread will decrease. Thus making it harder and more tedious to update the script as they would have to go fishing for the reports?

Maybe?

~Spaz

I think that the ones that are generally helpful on here won't stop being helpful just because this is a failsafe (as you will) for scripters. Like I said, I'm working on a filtering part so it will be easier to find the reports.


From: EvilChicken!
Wow, this is actually really impressive! (See the "!"? That means I'm serious.)
I really wish you the best of luck, and if you need any help that doesn't involve mySQL, I would be really glad to be able to assist in the development of this.


Great job, I will definitely use it once it's fully ready.

Thanks, and thanks to everybody else who said they liked :) Thanks, basically right now I'm just doing some minor tweaks to it. Should I make the tut on setting up MySQL databases? I gave a friend a walkthrough over MSN last night and he didn't have a clue -.- lol. That's another reason why I made mine public, so that way everybody could see it and use it. But I know some people are going to want to make their own databases.

~Camo

[S]paz

2008-12-13 10:28:56

You have a point. Then i must say its very good :)
if i ever get back into scripting again ill be sure to use this :)

~Spaz

Floor66

2008-12-13 11:18:58

That's easy;
[php]
$name = $_GET['scn'];

$sel = mysql_query("SELECT * FROM `proggies` WHERE `name` = '$name'");
[/php]

In the DB just add a comlumn 'name' varChar 255.
Like that it'd be show.php?name=TheName

P.S: If someone's confused, I just set up the PHP and the website connection in SCAR, Kyle did some stuff too :p
I mean. Be honest, I did almost all of it except getting a website builder which is basically drag and drop ^^, gl improving it though!

Kyle Undefined

2008-12-13 11:33:36

Lol Thanks. I'm leaving for work now so I don't have time to build it right now. But will when I get home. True, and I have given you creds also. Do I need to change/ add something to clarify?

~Camo

Floor66

2008-12-13 12:09:56

It's fine :p I just wanted to make it clear :p
I hope you bring forth many good scripts :D

EvilChicken!

2008-12-13 12:15:19

From: Camo Kyle
Should I make the tut on setting up MySQL databases?

~Camo


Absolutely! I just made a new page at agilityhoster (really good, free host) since I forgot the pass of my old site, and since it has support for SQL databases, and I saw this, I tried to make a database of my own. I ofcourse failed miserably and gave up after a minute or two. :p

So, a tutorial on this would be really appreciated. ^^

Floor66

2008-12-13 13:22:44

Look around for 'PhpMyAdmin' in the website CP… Get in there and then it's a matter of filling in a name for the db and ur set.

Lol making a db is just filiing out a form… Same goes for adding stuff to it… But I'd suggest you learning PHP too.

I'm now a quite advanced PHP/MySQL scripter but hey, everyone starts somewhere :p

NiCbaZ

2008-12-13 15:28:12

Your not the first ;) , ive acturally been trying to do this but i have not mde that much progress yet, great job, Btw munks done this already.

Magiic

2008-12-13 18:01:13

just thought on, unless you post errors in the script with the proggy you won't know what stopped it, and if the public think they don't have to post any more, just bad proggies no errors.

Kyle Undefined

2008-12-14 00:07:27

From: EvilChicken!
Absolutely! I just made a new page at agilityhoster (really good, free host) since I forgot the pass of my old site, and since it has support for SQL databases, and I saw this, I tried to make a database of my own. I ofcourse failed miserably and gave up after a minute or two. :p

So, a tutorial on this would be really appreciated. ^^


K, I don't know that but my tut can be used for all MySql databases but I'm going to use the site I use. I'm going to start from scratch and make a whole new account. If you want Pm/Msn me what you want your site name and I'll hand it over to you. I only need one site :p

@Nicbaz, Yes I know. But I thought hey, why not give it a shot?

@Sandos, Yeah, I know. But this is just the base for it now.

~Camo

P1nky

2008-12-14 16:00:02

awsome you got it done :)

found the mysql thing or w/e you were looking for , like i said before ITS AWSOME!

Kyle Undefined

2008-12-14 16:24:54

Thanks, hope this becomes useful. Oh and EC!, check your PM's ;)

~Camo

Mr.Klean

2008-12-20 12:50:30

It looks very good so far. I like it.

Although for the databases I would maybe add a bit more categorization. Like separate databases for different scripts and if you really want to get into it sort them by date.

TViYH

2008-12-20 17:50:48

I would like this much, much better if a user could post it to his own specific database, so it wouldn't flood the main database so much that not all of them are viewable.

It'd also be cool if, it was the same script running, it would delete the last proggy it gave. Something along those lines.

But it'd be better if each person could get his own page.

Kyle Undefined

2008-12-21 00:33:13

Ok. I'll try to implement those. I won't have time now because I'm going out of town for Christmas either tomorrow or Monday but will defiantly get that working.

~Camo

Woot! I'm on your list TViYH :p

TViYH

2008-12-21 08:47:26

And make it so that they can go to show.php?name=TViYH or w/e their name is, and view their proggies.

Forget the part about deleting them. Just make it to where they can go to show.php?name= and use their name that they use in the script (such as TViYH Powerminer, mormonman tut runner, etc.) to view their proggies, instead of using 1 big long list.

Floor66

2008-12-21 09:18:33

Look in the thread in Test Corner, I've posted a script for show.php?page={nr}&max={max to show on a page}
For the names, create a column in the db: `creator`, Varchar 255.
And in your show.php (this is with page sorting):
[php]
<?php
include "cfg.php";

$p = $_GET['page'];
if (empty($p) || $p == '')
{
$p = 1;
} else {
$p = $_GET['page'];
}
$limit = $_GET['max'];
if (empty($limit) || $limit == '')
{
$limit = 5;
} else {
$limit = $_GET['max'];
}
$start_from = ($p-1) * $limit;
$creator = $_GET['creator'];
if (empty($creator) || $creator == '')
{
$result = mysql_query("SELECT * FROM `proggies` LIMIT ". $start_from .",". $limit);
} else {
$result = mysql_query("SELECT * FROM `proggies` WHERE `creator` = ". $creator ." LIMIT ". $start_from .",". $limit);
}
$total = mysql_query("SELECT count(*) FROM `proggies`");
$total = mysql_result($total, 0);
if ($p > ceil($total/$limit))
{
echo "<strong>Incorrect pageID</strong><br />";
echo "<a href='?page=1&max=". $limit ."'>Back to page 1</a>";
exit;
}

echo "Page(s): || ";
$i = 1;
while ($i <= (ceil($total/$limit)))
{
if ($p == $i)
{
echo "<strong>". $i ."</strong> || ";
} else {
echo "<a href='?page=". $i ."&max=". $limit ."'>". $i ."</a> || ";
}
$i++;
}
echo "<br /><br />";
while($row = mysql_fetch_array($result))
{
echo "<strong>". $row['scn'] ."</strong>";
echo "<PRE>". stripslashes($row['Proggy']) ."</PRE>";
}
?>
[/php]

Kyle Undefined

2008-12-21 12:20:58

Thanks again, also thanks for posting. Hope you got my PM ;)

~Camo