Nodepad!

User projects written in or related to FreeBASIC.
KristopherWindsor
Posts: 2428
Joined: Jul 19, 2006 19:17
Location: Sunnyvale, CA
Contact:

Nodepad!

Postby KristopherWindsor » May 25, 2008 1:34

Image

This networked program lets everyone who is using the program draw on the same screen.
It is named Nodepad because the programs connect to each other through Freenode (at channel #nodepad).
If you go to that channel, you can see the programs communicate to each other in hexadecimal.
Since this uses Freenode, I added some primitive chat functionality.

I hope to use this form of networking for other programs, too.
This was something of an experiment, so I don't think I'll update the program much.

The people in #freebasic had fun testing this the last few days. ^_^

Image
Image
Image
Image
Image
Image
Image
Image

The program and source are here:
http://freefile.kristopherw.us/uploads/ ... odepad.zip
If no one else is using it, you can test by running two instances of the application simultaneously, or by running it on two different computers.
You theoretically could compile it for Linux, but I have set it up to compile with the .a (Windows) versions of Chisock and iGUI.

ThePuppetMaster modified the program or made a new one for Linux that would draw text for you (because I had not implemented the chat at that point).
Hopefully he can post his program here. ;-)

xD
Last edited by KristopherWindsor on May 25, 2008 4:21, edited 1 time in total.
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Postby cha0s » May 25, 2008 2:32

Cool! Using IRC for that is insanity... hehehe
yetifoot
Posts: 1710
Joined: Sep 11, 2005 7:08
Location: England
Contact:

Postby yetifoot » May 25, 2008 3:37

Hey! Who drew that not so complimentary picture of me? I demand answers!!!
Pritchard
Posts: 5492
Joined: Sep 12, 2005 20:06
Location: Ohio, USA

Postby Pritchard » May 25, 2008 4:34

This is the greatest invention the FB Community has ever known. IMO, we need a community nodepad.
marinedalek
Posts: 124
Joined: Aug 24, 2005 1:55
Contact:

Postby marinedalek » May 25, 2008 4:40

I agree completely - great work!
voodooattack
Posts: 605
Joined: Feb 18, 2006 13:30
Location: Alexandria / Egypt
Contact:

Postby voodooattack » May 25, 2008 6:18

Hey!!! I don't look like that!!

Good job though :D
nkk_kan
Posts: 209
Joined: May 18, 2007 13:01
Location: India
Contact:

Postby nkk_kan » May 25, 2008 10:09

Lags a bit on mine but it's ok
Excellent program!
Love it!
Lachie Dazdarian
Posts: 2337
Joined: May 31, 2005 9:59
Location: Croatia
Contact:

Postby Lachie Dazdarian » May 25, 2008 13:29

I agree. Great program.
notthecheatr
Posts: 1759
Joined: May 23, 2007 21:52
Location: Cut Bank, MT
Contact:

Postby notthecheatr » May 28, 2008 23:39

Whee, fun xD
Dr_D
Posts: 2375
Joined: May 27, 2005 4:59
Contact:

Postby Dr_D » May 29, 2008 3:24

I was messing around and made something so you can send a bunch of crap using a ulongint. lol


Code: Select all

const as ubyte COMMAND_1 = 1
const as ubyte COMMAND_2 = 2
const as ubyte COMMAND_3 = 4
const as ubyte COMMAND_4 = 8
const as ubyte COMMAND_5 = 16
const as ubyte COMMAND_6 = 32
const as ubyte COMMAND_7 = 64
const as ubyte COMMAND_8 = 128
 
#define packulong(m,x,y,c,u)( (culngint(m) shl 56) or (culngint(x) shl 46) or (culngint(y) shl 37) or (culngint(c) shl 5) or (culngint(u)) )
 
#define unpack_mflags(m)( m shr 56 and 255 )
#define unpack_xcoord(x)( x shr 46 and 1023 )
#define unpack_ycoord(y)( y shr 37 and 511 )
#define unpack_rgba(c)( c shr 5 and 4294967295 )
#define unpack_userid(u)( u and 31 )
 
'commands = m shr 56 and 255 '8 bit
'x = m shr 46 and 1023 '10 bit
'y = m shr 37 and 511 '9 bit
'c = m shr 5 and 4294967295 '32 bit lol
'u = m and 31' 5 bit... allows up to 32 users.
 
dim as ulongint package = packulong( COMMAND_1 or COMMAND_2 or COMMAND_8, 640, 480, RGBA(64,128,96,255), 13 )
 
 
dim as ubyte flags = unpack_mflags( package )
dim as short x = unpack_xcoord( package )
dim as short y = unpack_ycoord( package )
dim as uinteger c = unpack_rgba( package )
dim as ubyte u = unpack_userid( package )
 
print "x = " & x
print "y = " & y
print "r = " & (c shr 16 and 255)
print "g = " & (c shr 8 and 255)
print "b = " & (c and 255)
print "a = " & (c shr 24 and 255)
print "userid = " & u
 
if flags and COMMAND_1 then
    print "COMMAND_1 = sent!"
end if
 
if flags and COMMAND_2 then
    print "COMMAND_2 = sent!"
end if
 
if flags and COMMAND_3 then
    print "COMMAND_3 = sent!"
end if
 
if flags and COMMAND_4 then
    print "COMMAND_4 = sent!"
end if
 
if flags and COMMAND_5 then
    print "COMMAND_5 = sent!"
end if
 
if flags and COMMAND_6 then
    print "COMMAND_6 = sent!"
end if
 
if flags and COMMAND_7 then
    print "COMMAND_7 = sent!"
end if
 
if flags and COMMAND_8 then
    print "COMMAND_8 = sent!"
end if
 
 
sleep
marinedalek
Posts: 124
Joined: Aug 24, 2005 1:55
Contact:

Postby marinedalek » May 29, 2008 18:55

It'd be pretty cool if you could draw primitives (circle, line, box, etc.) to save on data (i.e. faster)
h4tt3n
Posts: 678
Joined: Oct 22, 2005 21:12
Location: Denmark

Postby h4tt3n » May 29, 2008 19:30

This reminds me of...

http://www.isketch.net/

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 2 guests