Jump to content




[Official] CCLite - Lightweight CC Emulator

utility

  • This topic is locked This topic is locked
138 replies to this topic

#41 Sorroko

  • Members
  • 87 posts

Posted 15 June 2013 - 05:39 AM

View PostEngineer, on 14 June 2013 - 08:10 PM, said:

I really like this, especially since it is written in lua. And I have to say I love open source! :D
The only thing that is bugging me, is the font rendering. When you have time to sort that out, I think you have a pretty good simulator right there.

Please keep updating this, it has very much potential! And for the name, make it something easy so peoplecan remember it. Also putting in the name what it does in the name is a very good idea. I was thinking: "loveEmu for CC"
Yeah the font isn't designed to be fixed width so some of the spacing is a bit borked, and the cursor needs some tweaking too. I'll keep playing around with words to try and come up with a name, I agree that it should be memorable though.

Quote

Edit: Also, I might want to help you out, but only if you want it. Because it seemse very fun to work on something like this!
Yeah sure! I think it's good to collaboration, I'll upload to github in a minute. ;)
EDIT: The repo is here: https://github.com/Sorroko/cclite

#42 jesusthekiller

  • Banned
  • 562 posts
  • LocationWrocław, Poland

Posted 15 June 2013 - 12:08 PM

You might want to work on font... (look at i, t and l)

Posted Image

#43 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 15 June 2013 - 12:11 PM

Also note how (in vanilla CC) there are spaces on the borders of the screen, where the cells are slightly larger than they are near the middle.

#44 jesusthekiller

  • Banned
  • 562 posts
  • LocationWrocław, Poland

Posted 15 June 2013 - 12:23 PM

True that!

#45 Sorroko

  • Members
  • 87 posts

Posted 15 June 2013 - 12:50 PM

Yeah the font... don't remind me :P And I'll make sure to include a border in the next update, however are the cells actually larger or is there just a small black margin? I think it's the latter but I'll have to check that.

#46 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 15 June 2013 - 12:58 PM

Posted Image

Yep.

#47 Sorroko

  • Members
  • 87 posts

Posted 15 June 2013 - 01:04 PM

Damn, shouldn't be too hard to add... but yet more rendering logic :P

Also does the emulator lag for you? Is it faster than CC, how much cpu does it use? (Not sure how to compare cpu usage though)

#48 Shazz

  • Members
  • 175 posts

Posted 15 June 2013 - 01:14 PM

View PostSorroko, on 15 June 2013 - 05:39 AM, said:

Yeah sure! I think it's good to collaboration, I'll upload to github in a minute. ;)
EDIT: The repo is here: https://github.com/Sorroko/cclite

So you decided to go with ccLite? Cool! Anyway, this sure looks interesting, I'm sure a lot of people including me might start using this after you've fixed the bugs with it.

#49 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 15 June 2013 - 01:15 PM

I'm actually surprised at how damn speedy it is! (Though I shouldn't be, after all, it's just lua running under more lua, haha)

#50 jesusthekiller

  • Banned
  • 562 posts
  • LocationWrocław, Poland

Posted 15 June 2013 - 01:22 PM

View PostKingdaro, on 15 June 2013 - 01:15 PM, said:

I'm aclua running under more lua

It's Luaception B)

#51 jesusthekiller

  • Banned
  • 562 posts
  • LocationWrocław, Poland

Posted 15 June 2013 - 01:24 PM

Add CTRL+V (paste) :)


Pressing arrow does not move cursor quickly


Add http API and pastebin app

#52 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 15 June 2013 - 01:34 PM

For me, clicking seems to clicking seems to register an event at the pixel to the top left of the pixel you're actually clicking. Used this program to test:

while true do
	local ev, p1, p2, p3 = os.pullEvent()
	term.clear()
	if ev == 'mouse_click' then
		local button, x, y = p1, p2, p3
		term.setCursorPos(x, y)
		term.write(tostring(button))
	end
end



#53 Sorroko

  • Members
  • 87 posts

Posted 15 June 2013 - 04:17 PM

View PostKingdaro, on 15 June 2013 - 01:34 PM, said:

For me, clicking seems to clicking seems to register an event at the pixel to the top left of the pixel you're actually clicking. Used this program to test:

while true do
	local ev, p1, p2, p3 = os.pullEvent()
	term.clear()
	if ev == 'mouse_click' then
		local button, x, y = p1, p2, p3
		term.setCursorPos(x, y)
		term.write(tostring(button))
	end
end
Your quite right, I'll fix that in the next update

copy/pasting is not possible in love :/ I'll add repeating keys when held down. However I'm not sure if HTTP api is possible yet

#54 Nuchaz

  • Members
  • 7 posts

Posted 16 June 2013 - 02:16 AM

very cool! Looks like a fun way to work on some computercraft programs when on my portable that isn't fast enough for minecraft. Downloading! :)

#55 jesusthekiller

  • Banned
  • 562 posts
  • LocationWrocław, Poland

Posted 16 June 2013 - 03:15 AM

W/o HTTP 50% of programs just won't work...

#56 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 16 June 2013 - 04:47 AM

View PostSorroko, on 15 June 2013 - 04:17 PM, said:

View PostKingdaro, on 15 June 2013 - 01:34 PM, said:

For me, clicking seems to clicking seems to register an event at the pixel to the top left of the pixel you're actually clicking. Used this program to test:

while true do
	local ev, p1, p2, p3 = os.pullEvent()
	term.clear()
	if ev == 'mouse_click' then
		local button, x, y = p1, p2, p3
		term.setCursorPos(x, y)
		term.write(tostring(button))
	end
end
Your quite right, I'll fix that in the next update

copy/pasting is not possible in love :/ I'll add repeating keys when held down. However I'm not sure if HTTP api is possible yet

It is very possible. Just edit the source of LÖVE, and add a function to read/write to the clipboard. Then register it with the Lua state.

#57 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 16 June 2013 - 04:49 AM

View PostMads, on 16 June 2013 - 04:47 AM, said:

View PostSorroko, on 15 June 2013 - 04:17 PM, said:

View PostKingdaro, on 15 June 2013 - 01:34 PM, said:

For me, clicking seems to clicking seems to register an event at the pixel to the top left of the pixel you're actually clicking. Used this program to test:

while true do
	local ev, p1, p2, p3 = os.pullEvent()
	term.clear()
	if ev == 'mouse_click' then
		local button, x, y = p1, p2, p3
		term.setCursorPos(x, y)
		term.write(tostring(button))
	end
end
Your quite right, I'll fix that in the next update

copy/pasting is not possible in love :/ I'll add repeating keys when held down. However I'm not sure if HTTP api is possible yet

It is very possible. Just edit the source of LÖVE, and add a function to read/write to the clipboard. Then register it with the Lua state.
And as for HTTP, just use Luasockets. You will of course have to write the correct requests and responses, but that's not too hard.


#58 Sorroko

  • Members
  • 87 posts

Posted 16 June 2013 - 06:30 AM

View PostMads, on 16 June 2013 - 04:49 AM, said:

-snip-
Hmm I would like to avoid distributing a custom love, and taken from the love forums:

Quote

Quote

Doesn't the language LÖve is written in for each OS have native OS commands to retrieve/send data from/to the clipboard? It's pretty standard stuff I would think.

They differ for each platform and would require pretty low-level stuff to get the needed info out of SDL too, basically, it's a whole lot of hassle for something that can break at any time.

The only alternative I could think of is using os.execute(), I'll think about it I suppose.

#59 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 16 June 2013 - 07:06 AM

View PostSorroko, on 16 June 2013 - 06:30 AM, said:

View PostMads, on 16 June 2013 - 04:49 AM, said:

-snip-
Hmm I would like to avoid distributing a custom love, and taken from the love forums:

Quote

Quote

Doesn't the language LÖve is written in for each OS have native OS commands to retrieve/send data from/to the clipboard? It's pretty standard stuff I would think.

They differ for each platform and would require pretty low-level stuff to get the needed info out of SDL too, basically, it's a whole lot of hassle for something that can break at any time.

The only alternative I could think of is using os.execute(), I'll think about it I suppose.
Well, then, HTTP support should be easy.

#60 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 16 June 2013 - 07:49 AM

View PostMads, on 16 June 2013 - 04:47 AM, said:

It is very possible. Just edit the source of LÖVE,
I'll just stop you right there because that's easier said than done. Though something does make me think that it's possible using io.popen with a special platform-specific command-line program, as I read a while ago on a tumblr post. I just haven't been able to find what that program is for anything other than OS X. I suppose I'll keep searching, because I'm curious of this too.

And yeah, HTTP support is pretty easy using luasocket.
local http = require 'socket.http'
local content = http.request('http://www.computercraft.info/')
print(content)
This prints out the content of the CC website to the console when used in LÖVE. http://w3.impa.br/~d...ocket/http.html





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users