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

#1 2012-04-11 20:05:53

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Scratch and C#

With the sensr value bock, you can send/receive broadcasts and variables with another program. Hw would yu send a number valu to Scratch using C#?


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

#2 2012-04-11 22:31:00

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Offline

 

#3 2012-04-12 10:54:29

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: Scratch and C#

scimonster wrote:

Try using remote sensor connectionssmile

I know that, but how do I use Scratch sockets and send information to the sensor block?


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

#4 2012-04-12 14:47:03

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Scratch and C#

I'm not a C# expert; but have a google for c# sockets, learn a little about socket programming, and have a look at the description of the protocol on the Scratch wiki.  smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#5 2012-04-13 07:36:02

BrynnaeBroghan
New Scratcher
Registered: 2012-04-11
Posts: 8

Re: Scratch and C#

No idea about that, sorry. You can definitely get the answer in Google.

Offline

 

#6 2012-04-13 12:27:52

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Scratch and C#

You can create sensor-variables by sending this message to the Scratch program:

sensor-value "Variable Name" "Variable Value"

Though there is some binary data that is placed at the beginning which indicates the length of the message (for the above, it's 45). You can find out more about the protocol at the wiki. There don't seem to be any C# examples in the wiki at the moment so maybe you could make an article once you get it to work? Other languages are here. (Python, Objective-C, and Flash Action Script)

For dealing with sockets, you'll have to google that I'm afraid.

Offline

 

Board footer