Jump to content




user friendly to do list


  • You cannot reply to this topic
12 replies to this topic

#1 Beaus1966

  • Members
  • 10 posts

Posted 27 June 2013 - 04:13 PM

When I want to edit my to do list I need to edit the program and then reboot, I made the to do list I an just looking for a separate program that will ask questions like what line and then you can edit the line then when you are done it will automatically reboot.

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 27 June 2013 - 08:52 PM

Split into new topic.

Please post your existing code and any error messages you receive while running it.

#3 Zudo

  • Members
  • 800 posts
  • LocationUK

Posted 28 June 2013 - 01:59 AM

I was bored, and feeling kind. If you wanted to save the to-do list in a file try something like this:

if not fs.exists("todo") then
handle = fs.open("todo", "w")
handle.writeLine("{}")
handle.close()
end

handle = fs.open("todo", "r")
todo = textutils.unserialize(handle.readLine())
handle.close()

term.clear()
term.setCursorPos(1,1)
print("To-do list")
print("Please enter the item number in the to-do list")
n = tonumber(read())
if type(n) == "nil" then term.clear() term.setCursorPos(1,1) error("That was not a number", 0) end
term.clear()
term.setCursorPos(1,1)
if not todo[n] then
 print("Current value: nil" )
 print("Please enter the new value")
 new = read()
 todo[n] = new
else
 print("Current value: " .. todo[n] )
 print("Please enter the new value")
 new = read()
 todo[n] = new
end

handle = fs.open("todo", "w")
handle.writeLine(textutils.serialize(todo))
handle.close()

You might get bad responses if you ask for people to make you programs in this forum. :)

#4 Beaus1966

  • Members
  • 10 posts

Posted 28 June 2013 - 07:42 AM

Thanks, ZodoHackz I will try that, is that everything or just the editor?


#5 Beaus1966

  • Members
  • 10 posts

Posted 28 June 2013 - 07:44 AM

No error messages, paste bin code will be posted shortly

Code is: KeQMhB6M

#6 Beaus1966

  • Members
  • 10 posts

Posted 28 June 2013 - 08:15 AM

ZodoHackz i get an error message, attempt to concatenate string and nil

#7 Zudo

  • Members
  • 800 posts
  • LocationUK

Posted 28 June 2013 - 11:12 AM

View PostBeaus1966, on 28 June 2013 - 08:15 AM, said:

ZodoHackz i get an error message attempt to concatenate string and nil

I know, I will edit it!
EDIT: done!

#8 Beaus1966

  • Members
  • 10 posts

Posted 28 June 2013 - 04:39 PM

You edited the code a couple posts above? And what do I name the programs(s)?


#9 oWave

  • Members
  • 23 posts

Posted 28 June 2013 - 04:48 PM

How about 'ToDo'?

#10 Beaus1966

  • Members
  • 10 posts

Posted 28 June 2013 - 08:41 PM

Sorry but is that the displayer to the monitor and the editor. Or is it just the editor????




Thanks for your time

#11 Tjakka5

  • Members
  • 256 posts

Posted 28 June 2013 - 11:51 PM

You might want to have a look at my Todo program then, it has a simple editor that could get you started.

pastebin.com/vFaHf7K



#12 Beaus1966

  • Members
  • 10 posts

Posted 29 June 2013 - 08:57 AM

Thanks I will check it out!


Did you enter the code wrong???

#13 Beaus1966

  • Members
  • 10 posts

Posted 29 June 2013 - 10:29 AM

i read up on lua and made one!!!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users