Jump to content


whatsfast's Content

There have been 33 items by whatsfast (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#55317 [Question]Writing onto a file

Posted by whatsfast on 29 November 2012 - 04:56 PM in Ask a Pro

Whenever I write onto a file it deletes what is before.

mailbody = fs.open(to, "w")
   mail = fs.open(to, "w")
   mail.writeLine("FromId: " .. id)
   mail.writeLine("FromName: " .. name)
   mail.writeLine("To: " .. to)
   mail.write(message..table.concat(mailbody,',\n'))
   mail.close()



#55316 Detecting Input From Bundled Cables

Posted by whatsfast on 29 November 2012 - 04:51 PM in Ask a Pro

Simplify his above:

function readinput()
if yellowin = rs.testBundledInput("back", colors.yellow) then
 rs.setBundledOutput("back", colors.black)
else
 rs.setBundledOutput("back", 0)
end
sleep(.1)
end



#55271 [Question]How do you turn a table into text.

Posted by whatsfast on 29 November 2012 - 01:30 PM in Ask a Pro

Whenever I print a table it comes up with table:something. How do I turn the table into text or a string?



#54836 [Question]How to close a running program.

Posted by whatsfast on 28 November 2012 - 02:31 AM in Ask a Pro

Well I will try my best later today to try and code the cc sensors and do a bunch of stuff with it. Is there like a api or documentation ccsensors?



#54781 [Question]How to close a running program.

Posted by whatsfast on 27 November 2012 - 04:09 PM in Ask a Pro

Also can you give the code for the detecting of everything around the world like chest opened and stuff. Also I though that maybe you could have a basic server that reads the url. given from a client. And then sends back text of like a webpage or something. And the text could be saved in a file on the computer or I could have another computer as the website. Il think about this tomorrow.



#54779 [Question]How to close a running program.

Posted by whatsfast on 27 November 2012 - 04:06 PM in Ask a Pro

Well I will pick on this idea tomorrow.



#54777 [Question]How to close a running program.

Posted by whatsfast on 27 November 2012 - 04:03 PM in Ask a Pro

Question :P in the terms of would be a good idea?



#54774 [Question]How to close a running program.

Posted by whatsfast on 27 November 2012 - 03:59 PM in Ask a Pro

Screw that though about how it works. Just researched a bit.

My second question is that having your own internet would allow people to search useful stuff/random stuff. And everything would be compatible.



#54772 [Question]How to close a running program.

Posted by whatsfast on 27 November 2012 - 03:57 PM in Ask a Pro

Right now im on tekkit build. So maybe it will work. If tekkit would update to the advanced computers, I probably doubt I will use them because I like the feel and usage of the normal computers. It kinda sound stupid but there a lot simpler is what I like. I just rehearsed coroutines and I kinda now understand them.The only problem is how would you detect a chest opening and for example the amount of items took out? That seems kinda complex in my opinion. Like how would you do it and what detects it? A computer or a turtle?



#54768 [Question]How to close a running program.

Posted by whatsfast on 27 November 2012 - 03:48 PM in Ask a Pro

I like the idea of a status updater for everything. Nice idea. If I know how coroutines work. NO. Never heard. I have no idea even how to detect a if an item is taken out let alone a if a chest is open. You have some crazy ideas. I guess I could try to make one and then post it on the forums. But I will need some help. Also how does a internet sound? Also what would I put on the internet.....like a moving nyan cat :P



#54749 [Question]How to close a running program.

Posted by whatsfast on 27 November 2012 - 02:00 PM in Ask a Pro

WOW. I am definitely going to do that. The system works perfectly. My next job is to add more scripts. I got a login, programs, and planned email and notification servers. What else do you think I should add?

Lights and controlling stuff like that will be in a another system/building.



#54743 [Question]How to close a running program.

Posted by whatsfast on 27 November 2012 - 01:41 PM in Ask a Pro

I see thanks.



#54740 [Question]How to close a running program.

Posted by whatsfast on 27 November 2012 - 01:31 PM in Ask a Pro

Ok it helped me with the error thanks KaoS. But one more question. It may be a bit off topic to this specific post but how would you print for example a time in your program but have it update all the time so its like a clock?



#54731 [Question]How to close a running program.

Posted by whatsfast on 27 November 2012 - 01:06 PM in Ask a Pro

Ya I considered saving it but this will be on a server. Is there a way to stop a program?



#54725 [Question]How to close a running program.

Posted by whatsfast on 27 November 2012 - 12:55 PM in Ask a Pro

I am trying to run a program that gets a code from another computer and then runs that code. Whenever I run the code it gives me the bios:26:Attempt to write to global. My guess is that the programs are intefering with each other. So my question is how would I have the program I don't need any more to stop?



#54653 Running a program sent from another computer?

Posted by whatsfast on 27 November 2012 - 10:03 AM in Ask a Pro

View PostLyqyd, on 26 November 2012 - 05:13 PM, said:

No, you still have the same problem I told you about several posts ago. You have to declare your variables before you use them. How the hell is it supposed to know what the value of loginclient is before you've told it what the value is? Of course it sends nil.
Wow. I can't believe I didn't notice that! Thank you so much. And I apologize for being so stupid. The biggest error can come from the smallest mistakes. So far it works.



#54438 Running a program sent from another computer?

Posted by whatsfast on 26 November 2012 - 05:10 PM in Ask a Pro

Can anyone help or is this a unfixable problem?



#54411 Running a program sent from another computer?

Posted by whatsfast on 26 November 2012 - 03:02 PM in Ask a Pro

It turns out when I do print(message) it says nil. The client is ok because the ID goes through fine. Heres the server code for sending:
Spoiler



#54396 Running a program sent from another computer?

Posted by whatsfast on 26 November 2012 - 02:29 PM in Ask a Pro

Ok I did that and no errors but the program isnt starting.

<p> </p>
<div>local function ldstrng(message)</div>
<div> local tmpfnc,rslt = loadstring(message)</div>
<div> if tmpfnc then _,rslt = pcall(message) end</div>
<div>  return rslt end</div>



#54380 Running a program sent from another computer?

Posted by whatsfast on 26 November 2012 - 02:09 PM in Ask a Pro

Can anyone help?



#54371 Running a program sent from another computer?

Posted by whatsfast on 26 November 2012 - 01:45 PM in Ask a Pro

That brings me back to my first problem. Whenever I send the code. It goes through all fine until the line loadstring(message) ()
It give me the error client:15: attempted to call nil. This is whenever I try to send a string.



#54360 Running a program sent from another computer?

Posted by whatsfast on 26 November 2012 - 01:33 PM in Ask a Pro

Where it asks for file path if it the computer folder or is the hard drive path. Or is it something completely different?



#54345 Running a program sent from another computer?

Posted by whatsfast on 26 November 2012 - 12:55 PM in Ask a Pro

Im trying to make it so that the program is being accessed from another computer not through a file. What you just did here will help me in the future for when I make a email system so it won't go to waste. But still my question isn't answered. How would I make it so that a string with the program is sent to another computer "the client" and then run on that one without any saving on the client side and they can't see anything. I want this because I have a server and I cant have people accessing my files and getting into my system. I got everything. The only problem I have is making a string run like a program and the code note being accessible. for that program.



#54332 Running a program sent from another computer?

Posted by whatsfast on 26 November 2012 - 11:49 AM in Ask a Pro

I tried but it doesn't work. Can anyone else help me? It says im trying to call nil.

Code:
loadstring(message) ()



#54312 Running a program sent from another computer?

Posted by whatsfast on 26 November 2012 - 10:16 AM in Ask a Pro

So when I do loadString(msg1) () it should load my string and start it or should I add like a shell.run() and a bunch of stuff?

line 124 btw