This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-06-10 19:42:48

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

ScratchChat--A global chat program in Panther!

This is the official forum page for ScratchChat, a global chat/IM program under development using a slightly modified version of Panther.

Scratch chat has different channels, which let you have private chats with friends. All you have to do is tell it what channel to use, and it will automatically create it if it is not in use, or join it if it is.

Also, for privacy reasons, the source code of ScratchChat will most likely NOT be released, as this would make it easy for people to hack into the systems.

This project uses escratch.org for functions such as update downloads and news.

The interface for ScratchChat is fairly similar to the interface for my project iChat,which uses scratch's mesh feature to chat.

To use ScratchChat, you NEED a scratch account. It will ask you for the username and password, but I can GUARANTEE that it does NOT store your password AT ALL. The only reason I require Scratch accounts is so that the server does not become overloaded with non-Scratchers. Your username will be shown upon entry to rooms and beside messages when you chat.

Current version: 1.2 - available NOW!

Available Downloads:
Main downloads
Version 1.1 (Dropbox)
Download!
Version 1.2 (Dropbox)
Download!
Version 1.3 BETA (N/A)
Available through auto-updater. Please give feedback!
Source code
Version 1.2 source* (Dropbox)
Download!
*In source versions, certain blocks are omitted for one of two reasons. 1) You need a modified version of Panther or it will be obsolete 2) They have been replaced to protect privacy. This means that they will not function, causing errors instead.

Users in the collabortation:
gbear605 (site management, php and panther programming, help with Mac versions)
dominic1 (site management, panther programming, forum thread manager)

Planned Features and Changelog
v1.1 (old)
-First public release
-Added private messages
-Fixed some bugs

v1.2
-escratch.org integration
--Automatic updates
-Updates will clear and reset config file
-Minor bugfixes
-Also, I changed the icon from the Bingo icon to a chat bubble!

v1.3 (available as beta)
-A chance to try out that brand new auto-updater in v1.2!
-COMPLETELY scrapping the config file system - more on this after release
-You will be prompted as to what channel you want to join after login

We are currently looking for anyone who would like to offer help-weather it be php coding to the actual Panther coding or even just ideas and suggestions

If you would like to help, please email me at scratchchatcolab@gmail.com-Please be sure to put your Scratch username!

Last edited by Dominic1 (2011-11-26 10:45:47)


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

#2 2011-06-10 19:51:27

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

Nice.  big_smile

Change your email to something non-personal though, XD


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#3 2011-06-10 20:38:22

cskidmsonic
Scratcher
Registered: 2011-01-22
Posts: 100+

Re: ScratchChat--A global chat program in Panther!

I'm making something like this in Scratch! (You need mesh enabled.)


This signature is TDD's fault... yes, I had to.

Offline

 

#4 2011-06-11 03:28:10

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

Claw can do this easy... here


You can now reach me on Twitter @johnnydean1_

Offline

 

#6 2011-06-11 07:02:03

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

Re: ScratchChat--A global chat program in Panther!

johnnydean1 wrote:

Claw can do this easy... here

I'll try it!

I tried using your MySQL blocks in the block library, but the website was blocked by my antivirus. Can you help me recode ot for another MySQL server?


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

#7 2011-06-13 15:50:23

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

Yes, I have the code.. I will post here...


You can now reach me on Twitter @johnnydean1_

Offline

 

#8 2011-06-13 15:51:41

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

set.php

Code:

<title>Scratch-Live <?php 
$title = 'Variables';
echo($title);?></title>

<?php 

$SQLhost     = "xxx";
$SQLuser     = "xxx";
$SQLpass     = "xxx";
$SQLdatabase = "xxx";
$SQLtable    = "xxx";

$con = mysql_connect($SQLhost,$SQLuser,$SQLpass);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
echo "Database Connected";
echo "<br />";
$user  = $_GET["user"];
$pass  = $_GET["pass"]; 
$value = $_GET["value"];

echo $user;
echo "<br />";
echo $pass;
echo "<br />";
echo $value;
echo "<br />";
                        if ($pass == 1)
                                {


$val = strlen($value);
if ($val > 0)
{
    echo "Acting on request";
    $act = "set";
}
else
{
    echo "Getting request";
    $act = "get";
    }
echo "<br />";


//**************************
//******DATABASE STUFF******
//**************************

mysql_select_db($SQLdatabase, $con);

            if(1==0)
                {

                    $sql = "CREATE TABLE" . $SQLtable. "
                    (
                    Username varchar(20),
                    Value varchar(20),
                    )";
                    mysql_query($sql,$con);
                    echo "<br />";
                    echo "Table made";
                    echo "<br />";
            
                }


    $you = "
SELECT * 
FROM Users";
$you4 = $you;

    
          $result = mysql_query($you4)
or die(mysql_error());
$n = 0;
$get = "";
$x = 0;
while($row = mysql_fetch_array($result))
  {
$x = $x + 1;
    $you = $row['Username'];
  if ($you == $user)
{
$n = $x;
if ($act == "get")
{
$get = $row['Value'];
}

}
 }



if ($n==0)
{
$you = "INSERT INTO ";
$you2 = $SQLtable;
$you3 = " (Username, Value)";
$you = $you . $you2 .$you3;
$you2 = ",";
$you3 = ")";
$you4 = "'";
$you5 = " VALUES (";
$query = $you . $you5 . $you4. $user . $you4 . $you2 . $you4. $value. $you4. $you3;
mysql_query($query);
}




                                echo "<br />";
                                echo "\n";




if ($act == "get")
{
echo $get;

}
if ($act == "set")
{


$you = "UPDATE ";
$you2 = $SQLtable;
$you3 = " SET Value = '";
$you = $you . $you2 .$you3 . $value;
$you2 = "' WHERE Username = '";
$you3 = $user;
$you4 = "'";
$query = $you . $you2 . $you3 . $you4; 
mysql_query($query);
echo "Updated";
}
                                }

mysql_close($con);
?>

You can now reach me on Twitter @johnnydean1_

Offline

 

#9 2011-06-13 15:52:41

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

Replace the "xxx" with your info. BTW even though it is called set.php it can get and set variables (See code in block library)


You can now reach me on Twitter @johnnydean1_

Offline

 

#10 2011-06-13 15:53:46

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

clear.php (WILL CLEAR ALL RESULTS WHEN ACCESSED)

Code:

<title>Scratch Live - <?php 
$title = 'Clear all';
echo($title);?></title>

<?php 
$run = $_GET["clear"];
if ($run == 1)

{
$SQLhost     = "xxx";
$SQLuser     = "xxx";
$SQLpass     = "xxx";
$SQLdatabase = "xxx";
$SQLtable    = "xxx";

$con = mysql_connect($SQLhost,$SQLuser,$SQLpass);
mysql_select_db($SQLdatabase, $con);




$query1 = "DELETE FROM ";
$query2 = $SQLtable;
$query4 = $query1 . $query2;
$result = mysql_query($query4);
mysql_close($con);
echo "table ";
echo $SQLtable;
echo " cleared";
}
?>

Last edited by johnnydean1 (2011-06-13 15:54:24)


You can now reach me on Twitter @johnnydean1_

Offline

 

#11 2011-06-13 17:31:21

RUMCHEERYPOOPOO
Scratcher
Registered: 2008-12-23
Posts: 100+

Re: ScratchChat--A global chat program in Panther!

just a little tip:

When using die() you don't need to check if the previous thing gave a result, you can just use or die.

for example in set.php you put:

Code:

$con = mysql_connect($SQLhost,$SQLuser,$SQLpass);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

if writing it how I suggest you put it:

Code:

$con = mysql_connect($SQLhost,$SQLuser,$SQLpass) or die('Could not connect: ' . mysql_error());

(I could be completely wrong but I think thats how you do it)


I AM ROOKWOOD101 NOW! (just so you know)

Offline

 

#12 2011-06-13 17:33:30

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

Well this is my style of coding PHP, same as I have my own way of coding JavaScript.


You can now reach me on Twitter @johnnydean1_

Offline

 

#13 2011-06-13 21:18:16

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

Re: ScratchChat--A global chat program in Panther!

Thanks, I'll try to work on this. In the actual blocks, do I just change the website, though?


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

#14 2011-06-14 02:48:14

jpeterson
New Scratcher
Registered: 2011-05-25
Posts: 21

Re: ScratchChat--A global chat program in Panther!

Any way to access the source for this chat program so we can see its current development?

Offline

 

#15 2011-06-14 11:56:22

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

Re: ScratchChat--A global chat program in Panther!

jpeterson wrote:

Any way to access the source for this chat program so we can see its current development?

As soon as the first stable version comes out, I'll post a download.


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

#16 2011-06-14 12:00:32

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

Re: ScratchChat--A global chat program in Panther!

johnnydean1 wrote:

set.php

Code:

<title>Scratch-Live <?php 
$title = 'Variables';
echo($title);?></title>

<?php 

$SQLhost     = "xxx";
$SQLuser     = "xxx";
$SQLpass     = "xxx";
$SQLdatabase = "xxx";
$SQLtable    = "xxx";

$con = mysql_connect($SQLhost,$SQLuser,$SQLpass);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
echo "Database Connected";
echo "<br />";
$user  = $_GET["user"];
$pass  = $_GET["pass"]; 
$value = $_GET["value"];

echo $user;
echo "<br />";
echo $pass;
echo "<br />";
echo $value;
echo "<br />";
                        if ($pass == 1)
                                {


$val = strlen($value);
if ($val > 0)
{
    echo "Acting on request";
    $act = "set";
}
else
{
    echo "Getting request";
    $act = "get";
    }
echo "<br />";


//**************************
//******DATABASE STUFF******
//**************************

mysql_select_db($SQLdatabase, $con);

            if(1==0)
                {

                    $sql = "CREATE TABLE" . $SQLtable. "
                    (
                    Username varchar(20),
                    Value varchar(20),
                    )";
                    mysql_query($sql,$con);
                    echo "<br />";
                    echo "Table made";
                    echo "<br />";
            
                }


    $you = "
SELECT * 
FROM Users";
$you4 = $you;

    
          $result = mysql_query($you4)
or die(mysql_error());
$n = 0;
$get = "";
$x = 0;
while($row = mysql_fetch_array($result))
  {
$x = $x + 1;
    $you = $row['Username'];
  if ($you == $user)
{
$n = $x;
if ($act == "get")
{
$get = $row['Value'];
}

}
 }



if ($n==0)
{
$you = "INSERT INTO ";
$you2 = $SQLtable;
$you3 = " (Username, Value)";
$you = $you . $you2 .$you3;
$you2 = ",";
$you3 = ")";
$you4 = "'";
$you5 = " VALUES (";
$query = $you . $you5 . $you4. $user . $you4 . $you2 . $you4. $value. $you4. $you3;
mysql_query($query);
}




                                echo "<br />";
                                echo "\n";




if ($act == "get")
{
echo $get;

}
if ($act == "set")
{


$you = "UPDATE ";
$you2 = $SQLtable;
$you3 = " SET Value = '";
$you = $you . $you2 .$you3 . $value;
$you2 = "' WHERE Username = '";
$you3 = $user;
$you4 = "'";
$query = $you . $you2 . $you3 . $you4; 
mysql_query($query);
echo "Updated";
}
                                }

mysql_close($con);
?>

Thx for the code. What directories/files would I need to make, though? In the blocks it says the website is "scratchlive.xtreemhost.com", but I know that there is probably more than just one php page for this...


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

#17 2011-06-14 14:38:08

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

Nope just one .php page and a SQL server.


You can now reach me on Twitter @johnnydean1_

Offline

 

#18 2011-06-14 18:24:44

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

Re: ScratchChat--A global chat program in Panther!

johnnydean1 wrote:

Nope just one .php page and a SQL server.

Ok- So if the php file is at escratch.org/scratchchat/, I just put that exact URL in the block coding?


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

#19 2011-06-15 06:50:24

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

Dominic1 wrote:

johnnydean1 wrote:

Nope just one .php page and a SQL server.

Ok- So if the php file is at escratch.org/scratchchat/, I just put that exact URL in the block coding?

I'm working on it, and I already got this part down.

It uses variables to get a server name (channel name) to put inside a get from URL block.  I will use the get file at URL block to also retrieve data, but in a slightly different way -- I will change the php page to being a php page that writes to a log file, and then the program will read.


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#20 2011-06-15 07:05:01

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

Re: ScratchChat--A global chat program in Panther!

bbbeb wrote:

Nice.  big_smile

Change your email to something non-personal though, XD

Just did that!


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

#21 2011-06-15 07:06:09

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

Re: ScratchChat--A global chat program in Panther!

gbear605 wrote:

Dominic1 wrote:

johnnydean1 wrote:

Nope just one .php page and a SQL server.

Ok- So if the php file is at escratch.org/scratchchat/, I just put that exact URL in the block coding?

I'm working on it, and I already got this part down.

It uses variables to get a server name (channel name) to put inside a get from URL block.  I will use the get file at URL block to also retrieve data, but in a slightly different way -- I will change the php page to being a php page that writes to a log file, and then the program will read.

Thanks gbear605!


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

#22 2011-06-15 11:57:44

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

If your using claw, goto the Scratch Live menu and set the URL to the "escratch.org/scratchchat/" you chose.


You can now reach me on Twitter @johnnydean1_

Offline

 

#23 2011-06-15 12:26:37

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

Re: ScratchChat--A global chat program in Panther!

johnnydean1 wrote:

If your using claw, goto the Scratch Live menu and set the URL to the "escratch.org/scratchchat/" you chose.

I never knew I could do that... Maybe I'll make a version for Panther and Claw because both have different advantages and disadvantages.

eg:
Panther has a CYOB interface, and a block library, but Claw comes with many different blocks that aren't in the block library or would take forever to code.

Thanks for the tip!


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

#24 2011-06-15 12:32:18

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

Re: ScratchChat--A global chat program in Panther!

gbear605, can you please email me the latest version of ScratchChat? Use scratchchatcolab@gmail.com please


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

#25 2011-06-15 15:47:11

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

Re: ScratchChat--A global chat program in Panther!

gbear605 wrote:

Dominic1 wrote:

johnnydean1 wrote:

Nope just one .php page and a SQL server.

Ok- So if the php file is at escratch.org/scratchchat/, I just put that exact URL in the block coding?

I'm working on it, and I already got this part down.

It uses variables to get a server name (channel name) to put inside a get from URL block.  I will use the get file at URL block to also retrieve data, but in a slightly different way -- I will change the php page to being a php page that writes to a log file, and then the program will read.

I just tried to use the set.php page gbear605 created, but when trying the host site as "www.escratch.org/scratchchat/" or "www.escratch.org/scratchchat/set.php", it wouldn't work...

jonnydean1, would you like to join the colaboration? If you do, email me at scratchchatcolab@gmail.com

EDIT: Never mind, I forgot that it was escratch.org/scratchchat/dev/

Last edited by Dominic1 (2011-06-15 15:49:49)


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

Board footer