Jump to content




[1.48] dotbot 1.1 (simple text/file reader)

computer lua utility

7 replies to this topic

Poll: dotbot poll

Do you think dotbot is a useful program?

You cannot see the results of the poll until you have voted. Please login and cast your vote to see the results of this poll.

What new features would you like to see?

You cannot see the results of the poll until you have voted. Please login and cast your vote to see the results of this poll.
Vote Guests cannot vote

#1 InputUsername

  • Members
  • 231 posts
  • LocationThe Netherlands

Posted 03 January 2013 - 04:50 AM

Posted Image

dotbot 1.1 - © 2013 InputUsername

nevermind the name, it doesn't make sense :)


Updated to 1.1! See the changelog and known bugs sections for more information.
Because of some fixes and changes to the installer you'll have to re-download and then run it.


What is dotbot?
dotbot is a simple text/file reading program. You can use it to read any file on regular and advanced computers. Monitor and turtle support will be added in a future version.

How do I use dotbot?
To use dotbot, simply run it. When you don't provide any parameters you'll get more information on how to use the program.

Features:
Spoiler

Images:
Spoiler

How can I get it?
You simply download the installer from one of the links below and then run it.
The
Spoiler

Known bugs:
Spoiler

Changelog:
Spoiler

Planned features:
Spoiler



* How to enable the http-API
Spoiler


Thanks for reading!
Please, if you find any bugs (in either the program or the post) or things you would like to see/change in the program, tell me! Constructive criticism is appreciated, but if you don't like the program, for the love of god, provide a reason.

#2 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 03 January 2013 - 06:01 AM

Regarding the bugs you have:

1) Here is a simple function you can use to download something from Pastebin without having to use pastebin get ...
local function download(code, path)
for i = 1, 3 do
  local response = http.get("http://pastebin.com/raw.php?i=" .. code)
  if response then
   local data = response.readAll()
   response.close()
   local f = io.open(path, "w")
   if f then
    f:write(data)
    f:close()
   else return false end
   return true
  end
end
return false
end

2) The access denied error when deleting the dotfiles folder is usually because a file in it has been opened in read-only mode (the "r" mode in fs/io.open), and has not been closed - leaving it to be only readable. Look through your code and make sure that you close any files that you open. After looking at your code, I noticed that you haven't closed the mainFile variable. Once you've finished editing it, make sure you call mainFile.close().

You probably can't delete the dotfiles folder because you were testing the feature where if you input no arguments, it opens the help file in the dotfiles folder. Then, you exit the application and try and delete the dotfiles folder - but you can't because the help file is in read-only mode because you haven't closed the mainFile variable (which was the help file in the dotfiles folder).

You can read more about opening/closing files here.

Hope this can help :D

#3 InputUsername

  • Members
  • 231 posts
  • LocationThe Netherlands

Posted 03 January 2013 - 06:07 AM

Thanks! I'll fix the bugs tomorrow! I do feel kind of stupid about the second one. Anyway thanks for the help!

#4 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 03 January 2013 - 06:29 AM

What makes me want to use this script instead of the default "edit" script? I see no advantages over it.

#5 InputUsername

  • Members
  • 231 posts
  • LocationThe Netherlands

Posted 03 January 2013 - 09:23 AM

View PostSammich Lord, on 03 January 2013 - 06:29 AM, said:

What makes me want to use this script instead of the default "edit" script? I see no advantages over it.

Readability? Edit is good for programs but not really for regular text files.
Ease of use?
Some other things I can't come up with right now?

And at least be glad I made this instead of a door lock or an 'OS' :)

#6 Left4Cake

  • Members
  • 272 posts
  • LocationEarth

Posted 03 January 2013 - 10:10 AM

View PostSammich Lord, on 03 January 2013 - 06:29 AM, said:

What makes me want to use this script instead of the default "edit" script? I see no advantages over it.

two words,

Word Wrap.

#7 InputUsername

  • Members
  • 231 posts
  • LocationThe Netherlands

Posted 04 January 2013 - 04:52 AM

View PostLeft4Cake, on 03 January 2013 - 10:10 AM, said:

View PostSammich Lord, on 03 January 2013 - 06:29 AM, said:

What makes me want to use this script instead of the default "edit" script? I see no advantages over it.

two words,

Word Wrap.

Exactly! Word wrapping will be added soon.

By the way, sorry for bumping but the program has been updated to 1.1. There were some changes to the installer, therefore you'll have to re-dowload it.

#8 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 04 January 2013 - 05:12 AM

Regarding the word wraping:

In the bios.lua of CC, the write function is defined, with word wrapping. It can help you in making yours. Here is a commented version, sort of explaining it. Note that copy and pasting this should work pretty well (just adapt the variables to meet your needs).
Spoiler

Also, suggestion - can you add the ability to scroll through the program using the up and down arrow keys (in an advanced terminal)?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users