Jump to content


L0NE's Content

There have been 2 items by L0NE (Search limited from 11-July 19)


By content type

See this member's

Sort by                Order  

#266017 I am completely lost! Need help fixing this neat program

Posted by L0NE on 01 April 2017 - 03:37 PM in Ask a Pro

Well that makes things more clear....i will try to fix it now by knowing this and get back on this post if i need some further help. Thank you for your time :D



#266007 I am completely lost! Need help fixing this neat program

Posted by L0NE on 01 April 2017 - 10:16 AM in Ask a Pro

Okay so to get started I would like to say I am very new to this forum, i just started my own server and i have been playing with my friends. I am not new to programming and thats why i am so frustrated i can't fix this, it just doesn't get in my head...and i still have to learn better syntax of Lua.

So what is program about:

The program is almost like a universal wireless control for a "base". You have 2 pieces of code, one for clients and one for lets say server, or a mainframe.
The client one is a standalone computer that is connected to redstone....could be multiple of standalone ones because the server ties them together.
The server is a computer that makes a montior screen, user makes his own buttons and the program is supposed to turn on/off on monitorclick the specific computer redstone signal

What is the problem:

1. ) I am sure there will be more problems since this is the one that showed at almost startup, but i couldn't get through it so i don't know what waits for me next.
On startup it runs, I press the "+" on cursor pos 1,1 so i can add a button, i add one, and i press on the left corner of the button which is supposed to call a function to changebox i think, so i can assign a standalone computer to that button. Then I get a attemt to call nil on :104

		repeat
  :104			  term.restore()
				local w, h = term.getSize()
		until w == 51 and h == 19

I am not familiar with Lua, but i have read that restore is a Lua function? So that can't be call nil in my opinion

2. )

even if i don't click on the left of the button to edit it...but i just create a button and reboot the program...it gives me on line :90 table expected, got nil....i have looked and looked, nothing crossed my mind

:90 for id,b in pairs(box) do
				drawBox(b,id)
		end

If there is any way you could help me i would appreciate it :D
The full codes and pastebin:

Server:
https://pastebin.com/faNYCykU
Client:
https://pastebin.com/m8MmwvX7


Here is the full code for server:

Spoiler


Full code client:

Spoiler