Jump to content


CoolisTheName007's Content

There have been 297 items by CoolisTheName007 (Search limited from 30-March 23)


By content type

See this member's


Sort by                Order  

#123532 debug.traceback in CC! Traceback with file extracts!

Posted by CoolisTheName007 on 04 June 2013 - 10:34 AM in APIs and Utilities

View Postrobhol, on 04 June 2013 - 08:53 AM, said:

Tried using this today... failed.
Fixed a table access, was debug.tracebackError and not debug.traceback. Should work now, but can't really test. I'm kinda of done with CC.



#117147 [1.4.5] NPaintPro

Posted by CoolisTheName007 on 11 May 2013 - 06:47 PM in Programs

View Posttonkku107, on 10 May 2013 - 04:49 AM, said:

Can you write in the picture?
Use Text Mode (see OP)



#111842 [1.4.5] NPaintPro

Posted by CoolisTheName007 on 19 April 2013 - 11:23 AM in Programs

Used NpaintPro for making editable ruleboards. The server owner's seems happy about them!
This is how it looks(freshly installed):
Posted Image
Basically, startup script starts npaint in the monitor, and a running a function parallely to sleep and queue a key event makes sure the init screen of npaint is bypassed. Dirty, but quick!



#108427 Idea Exchange

Posted by CoolisTheName007 on 10 April 2013 - 06:48 AM in General

View PostEngineer, on 27 March 2013 - 12:58 PM, said:

Im currently developing an IDE. I am going to try to add code snippets. Will it ever finish? Uuhmm maybee? If I decide to quit the project I will post the unfinished project somewhere on the forums.
Well, if getting tracebacks improves the IDE, you might like this: http://www.computerc...__fromsearch__1



#108426 debug.traceback in CC! Traceback with file extracts!

Posted by CoolisTheName007 on 10 April 2013 - 06:46 AM in APIs and Utilities

Bumping for bugfixes, a step_print function (press key for next page), with the help of one of Kingdaroo's functions, and advanced examples, where errors not caused by error calls (e.g. a=''..{}) can still trigger a traceback, by using xpcall, except for overflow errors, in which case hell breaks loo... I mean, the computer crashes.



#106737 debug.traceback in CC! Traceback with file extracts!

Posted by CoolisTheName007 on 06 April 2013 - 06:05 AM in APIs and Utilities

View PostKilobyte, on 05 April 2013 - 10:36 PM, said:

Might use it in my OS (modified though, with credts ofc) if you are ok with it. was looking for something like this :D

I'm ok with it!



#100709 debug.traceback in CC! Traceback with file extracts!

Posted by CoolisTheName007 on 23 March 2013 - 03:39 PM in APIs and Utilities

View PostTheOriginalBIT, on 23 March 2013 - 03:18 PM, said:

cool cool. thanks. NeverCast and I implemented a way of doing this for cctube. it was not very complicated but required a lot of work from us. but I like our little logger :)
So, you basically had to do for every function/process you wanted logged, do something like ok, err=pcall(f,...) and save the errr somewhere, then error again? Or did you had the same idea, using pcall(error,'',level)?



#100699 debug.traceback in CC! Traceback with file extracts!

Posted by CoolisTheName007 on 23 March 2013 - 03:15 PM in APIs and Utilities

View PostTheOriginalBIT, on 23 March 2013 - 03:06 PM, said:

Fell like making the traceback more of a, well, real traceback?
Done, not exactly as you wanted (that would imply parsing Lua code, e.g. one line , function calls in chains, x,y,z=a(), b(),c(), doesn't seems trivial, but, then again, it's pretty late for me. EDIT see? missed a parenthesis)



#100687 debug.traceback in CC! Traceback with file extracts!

Posted by CoolisTheName007 on 23 March 2013 - 03:02 PM in APIs and Utilities

Bumping for extraction of code surrounding error and calling functions from files and a ...screenshot!



#100603 debug.traceback in CC! Traceback with file extracts!

Posted by CoolisTheName007 on 23 March 2013 - 09:25 AM in APIs and Utilities

Bumping for something incredible.



#100589 TurtleSim - A turtle simulator sort of thing made in love2d!

Posted by CoolisTheName007 on 23 March 2013 - 08:37 AM in General

View Posttiin57, on 23 March 2013 - 12:03 AM, said:

View Postds84182, on 22 March 2013 - 04:06 PM, said:

Can... Can I steal this and make a full turtle emulator?
No. I'm working on a full turtle emulator in Java. So you don't get to do this. :3
If you manage to include debugging tools in it (maybe harder in java than in Lua), that would be something new too.



#100258 Github repository cloner

Posted by CoolisTheName007 on 22 March 2013 - 12:54 PM in APIs and Utilities

View PostSammich Lord, on 22 March 2013 - 05:01 AM, said:

If the script just grabs it from raw.github.com then it doesn't make a request for the API, it just requests the URL. I haven't checked to see how it works though.
I've checked the code I had for getting github stuff and it made a request for the repository contents for each directory path, and then it queried /raw.
I suppose a safe way to do things is to somehow avoid rechecking each repository path.



#100255 debug.traceback in CC! Traceback with file extracts!

Posted by CoolisTheName007 on 22 March 2013 - 12:49 PM in APIs and Utilities

View Posturielsalis, on 22 March 2013 - 12:25 PM, said:

I have a program that do this, i dont remember in where section of the fomus only remember the title, debugger :)
Hum, yours does not makes a traceback over the called functions, that is, if someone gets an error in function a called from function b, your log won't show that b called a. That's what my script does.



#100175 debug.traceback in CC! Traceback with file extracts!

Posted by CoolisTheName007 on 22 March 2013 - 10:17 AM in APIs and Utilities

Ever needed a full traceback in CC, telling you not only that test:35 throwed an error, but which function had called that one, from which file, and even see what code errored without having to open the file? Fear no more!

Example:
This code
os.loadAPI'debug' --or dofile'debug'
debug.override()

local function c()
  error('a')
end
local function b()
  c()
end
local function a()
  b()
end
gives, give or take the paths:

Posted Image

(the * counts the nested calls to the error-ing function in a line)

That's it! The functions used are available in the debug table. See 'Mor'e Examples' for it.
You can, for instance, get only the traceback string without throwing an error using debug.traceback(),
and print text one page at a time using debug.step_print(text).


Code
pastebin get YWwLUUpk debug
or here: http://pastebin.com/YWwLUUpk

Mor'e advanced examples:
Spoiler

External functions used: Kingdaroo's wrap text function, found somewhere. Thanks.

Changelog:
?-separated traceback from error function.
?-file extracts
24/03/13 - toerror function for pcall produced errors (only one level of trace depth).
09/04/13 - now an api, overrides are optional, xpcall is great for catching errors not throwed by error(), but java vm overflows are not catched by it. pcall seems to do fine, but won't get the traceback. My opinion? xpcall, for tracebacks in almost all ocasions.

Future:
Special shell that opens/closes editor based on the error line automatically?

Dev:
xpcall(function() local f,e=loadstring('1\n1') end,print) prints an error message, but returns true. I.e., the error handler is called, but the execution of the function continues.



#99970 Turtle Swarm Quarry v0.3 and master/module APIs

Posted by CoolisTheName007 on 22 March 2013 - 03:31 AM in Turtle Programs

In Module API
A little bit of pony magic is used to calculate how should it turn
lol



#98217 gitget - An updater for ComputerCraft scripts stored on a github.com

Posted by CoolisTheName007 on 17 March 2013 - 01:17 PM in Programs

 Yopu, on 17 March 2013 - 12:35 PM, said:

I'm currently using SmartGit and my commits are pushed up in seconds. I not really working on anything big at the moment. Just single file stuff.
I've been delaying setting it up, but this seems one more reason to do it for good. Thanks.



#98175 gitget - An updater for ComputerCraft scripts stored on a github.com

Posted by CoolisTheName007 on 17 March 2013 - 12:00 PM in Programs

Hum, to me the problem with github for small scripts has been that pushing commits is slow. But maybe I'm doing it the wrong way. How much time does it take your git shell to push a commit to a remote? Plus, I always have to enter git add -A, git commit, git push, but maybe there's a macro for that.

Btw, just finished a python script that recursively minifies an entire directory using LuaSrcDiet (locals get replaced by smaller locals, comments stripped, ect) and then packs everything in auto-extracting lua-file. I had to to that because I'm using github for doing an os and their api limits requests to 60 per hour, and one file get = one request, so for many files, like in my case, the downloader I found wouldn't do, neither will this one, I suppose.



#98072 Github repository cloner

Posted by CoolisTheName007 on 17 March 2013 - 06:42 AM in APIs and Utilities

View PostEric, on 10 January 2013 - 09:15 AM, said:

Word of warning - github puts a limit on API requests (60 per hour, I think) - you may have problems cloning repositories with a large number of files and folders, particularly if github treats all users on a server as the same client.

Ah. That's useful to know. Wished I hadn't spent one hour looking for an answer....
Guess I'll have to write something to package everything in one file, and then un-package itself. Or see if dropbox behaves the same way.



#97768 [MC 1.7.10 | CC 1.65] OpenCCSensors

Posted by CoolisTheName007 on 16 March 2013 - 11:38 AM in Peripherals and Turtle Upgrades

View PostWatchful11, on 16 March 2013 - 10:22 AM, said:

I'll test the new version and let you know if it fixed my problem. In my case there was nothing around the sensor, it was on a flat world, so just grass and bedrock.
Bedrock? Maybe that is the problem....I'll check soon.



#97373 rGUI - Easy-to-use GUI library [public alpha/beta]

Posted by CoolisTheName007 on 15 March 2013 - 10:25 AM in APIs and Utilities

For anyone with difficulties finding the download button, it's on the right side of the overview page.
One thing I think you could improve is avoiding resuming the computer's coroutine every 0.05 seconds.



#96063 [MC 1.7.10 | CC 1.65] OpenCCSensors

Posted by CoolisTheName007 on 11 March 2013 - 11:12 PM in Peripherals and Turtle Upgrades

View PostKye_Duo, on 11 March 2013 - 11:49 AM, said:

View PostWatchful11, on 11 March 2013 - 11:39 AM, said:

Got a bug to report.

If redpower is installed, the Sonic Sensor card mk4 returns a "ocs_error" after being called with getTargets. Well, technically the event it throws has "ocs_error" in the first field and the 3rd field is nil, but you know what I mean. This does not happen without redpower. I have tested a few other sensor cards, including lower levels of Sonic Sensor, and they work fine, but I haven't checked all of them.
Reproduced with,
Forge 6.6.2.534
Computercraft 1.5
OpenCCsensors 0.1.4
Redpower 2.0pr6

Apparently, computercraft error handling fails silently on a error message of nil. So whatever program you are running just terminates without an error in this case. I would recommend adding a condition in waitForResponse() for nil events.
I too am using RP2 and was getting that behavior out of the sonic sensors....I didn't think to test it without RP2...though with us all the levels do this...

I'll look into it asap. A world save would also help.



#95047 Advanced Mining Turtle - Ore Quarry

Posted by CoolisTheName007 on 09 March 2013 - 02:12 PM in Turtle Programs

I like the program for the originality in leaving unwanted layers undigged. Here's a version which makes sure that if fuel runs out, the turtle is at the dock. http://pastebin.com/aHW8xdGj
It is based off an old version of the original.



#94710 ubolt - never loose sight of a mining turtle on server restart

Posted by CoolisTheName007 on 09 March 2013 - 01:08 AM in Turtle Programs

Ever started a mining program, only to for the server to restart/the chunk being reloaded, and then you had to descend to the bowels of the earth in an epic adventure to find said robot? Yes? Fear no more!

Just get ubolt from

pastebin get bVmtbdsm
( http://pastebin.com/bVmtbdsm )

Run ubolt, and then any turtle program.
When the mining turtle restarts next, it will return approximately to the height where it was when ubolt was run, mining it's way through if necessary.
For instance, works flawlessly with
http://www.computerc...tle-ore-quarry/

Code:
Spoiler

For advanced users:
Spoiler



#90736 [MC 1.7.10 | CC 1.65] OpenCCSensors

Posted by CoolisTheName007 on 24 February 2013 - 09:39 AM in Peripherals and Turtle Upgrades

View PostKye_Duo, on 24 February 2013 - 02:53 AM, said:

snip
So it works outside sensorview?

View Posttabs, on 24 February 2013 - 07:22 AM, said:

snip
The fact that something is being printed continually to the console may be the problem? Perhaps someone has forgot to delete a OCSLog call.



#90486 [MC 1.7.10 | CC 1.65] OpenCCSensors

Posted by CoolisTheName007 on 23 February 2013 - 12:17 PM in Peripherals and Turtle Upgrades

View PostKye_Duo, on 23 February 2013 - 05:49 AM, said:

I have a few questions regarding the sonic sensor
1. I can't get it to work with the sensorview program, is this a bug or can it not work with that program?
2. Can it detect liquids through a block or two? I'm trying to help setup a sensor that can detect when its safe to raise a piston that is being used to create a pit under a lava fall to prevent the lava from spreading all over the place and lava is notorious for not taking the same amount of time to completely drop from the ceiling once the fall has been shut off.
I made the sonic sensor card, so:
About 1. : the sonic sensor has many targets (all blocks visible, for a certain definition of 'visible'); sensorview call getTargetsDetails for each, which results in no new intel, but each call takes a tick, so there should be some lag. That's my first attempt at an explanation.
About 2: due to the compact way I implemented it, diagonals are always visible (e.g. (1,1,1) ). So you could check for those, e.g.: wrapped_sensor.getTargetDetails()['1,1,1'] , and still the sensor wouldn't be touching lava. But they are lava-resistant, right? So I guess you want the sensor to be invisible.
It is interesting to let them have a certain see-through power, more than the accidental one, maybe based on the sensor upgrade level.
Also, what do you think about distinguishing between lava and water?