Jump to content




Need Help With Debugging Program.


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

#1 TheeIntrepidGamer

  • Members
  • 12 posts
  • LocationUnited States

Posted 20 November 2013 - 03:57 PM

This program I've been working on for a day or two now has been going smooth until one, or two bugs came about. It's supposed to be a configurable locking program for doors/computers alike. The whole program works fine if I try to lock a computer, but if I try to lock a door the program won't pick up that I'm trying to lock the door. It won't say that it's a locked door, instead I've put in an 'else' where it says 'debug menu', which means it isn't recognizing that I've selected it to lock a 'door' which is specified in the 'PassLockFiles/DoT' file. I've tried changing variable names, and have added 'else' statements to the ends of all my 'if' statements to try, and work out where the bug is, but I've had no luck. I've overlooked this code for 2 days now trying to find these bugs. It would be of great help if someone could assist me in finding them. :)

I will post some screenshots, and the code below.

Pastebin:
http://pastebin.com/umqCpkmH
(Some of the spacing near the bottom got messed up due to me copying the code over
from Notepad++ to pastebin.)

Spoiler

Screenshots


Spoiler



#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 20 November 2013 - 04:21 PM

readAll is a one-shot thing, you can't check it again without closing the file handle and opening it again. Instead, you should put the contents of the file into a variable and check that variable to see if it contains "door" or "term".

#3 TheeIntrepidGamer

  • Members
  • 12 posts
  • LocationUnited States

Posted 20 November 2013 - 08:19 PM

Thanks, I'll get to work on fixing that.

EDIT: It's working great now, thanks. :D

Edited by Firestorm002, 20 November 2013 - 08:57 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users