Jump to content




I might just be an idiot...?


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

#1 SomeoneJimmy

  • New Members
  • 2 posts

Posted 26 January 2016 - 05:00 AM

I'm not completely new, but I stepped away from minecraft for a bit and now I came back to it. So I'm trying to semi-automate some gourmaryllis (from the botania mod). I've got the script for the main part of the program down, but for some reason I can't seem to work out this statement. I usually like to run programs and then have it ask me if I want to clear the screen because I usually have some text print so I can see a bit of progression.

So here's what I have for the clear screen bit:

print("Looks like that's it.  Clear?")
print("Hit 1 for yes, 2 for no.")
local e = read()
if e == 1 then
  print("Ok then. clearing screen!")
  sleep(1)
  term.clear()
else
  print("You don't want to clear that mess?  Ok...")
end

The problem is whenever I type in 1, it still goes and prints, "You don't want to clear that mess? Ok..." I tested it out by replacing e with 1 so it reads, "1 == 1", and it works. So any idea on what I did wrong?

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 26 January 2016 - 05:02 AM

read() returns a string.

if e == "1" then


#3 SomeoneJimmy

  • New Members
  • 2 posts

Posted 26 January 2016 - 06:40 AM

Ah, ok. Yeah that would make more sense. Thanks for answering anyways.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users