Computer/Turtle Craft Scripts (Share & Request)

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • FTB will be shutting down this forum by the end of July. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Milaha

New Member
Jul 29, 2019
310
0
0
Here's a question. If I have a few turtles and I want them all to execute the same program, is there a way for me to have that program stored in a central location, and on startup of the turtles they grab it and execute it?

I have 19 melee turtles all in a line, and as I adjust their startup code, I'd be nice to update it in a single place and all the turtles update

I see you figured out a solution, but I implemented something similar for fetching from pastebin which is imho even easier. I actually put it on all of my computers/turtles as 'reload' so that I can easily upload new revisions to pastebin and then fetch them down to the computer. On my melee turles and the like it is set as 'startup' instead obviously. You need to register a pastebin account for full functionality though, so that you can edit the same file and keep the access code the same.


Code:
pbinCode = '<pastebincodehere>'
progName = '<programnamehere>'
 
if fs.exists(progName)==true then
        fs.delete(progName)
end
shell.run("pastebin", "get "..pbinCode..' '..progName)
shell.run(progName)
 

SReject

New Member
Jul 29, 2019
433
0
0
I see you figured out a solution, but I implemented something similar for fetching from pastebin which is imho even easier. I actually put it on all of my computers/turtles as 'reload' so that I can easily upload new revisions to pastebin and then fetch them down to the computer. On my melee turles and the like it is set as 'startup' instead obviously. You need to register a pastebin account for full functionality though, so that you can edit the same file and keep the access code the same.


Code:
pbinCode = '<pastebincodehere>'
progName = '<programnamehere>'
 
if fs.exists(progName)==true then
        fs.delete(progName)
end
shell.run("pastebin", "get "..pbinCode..' '..progName)
shell.run(progName)

The pastebin idea is nice, but not all servers support it. And... each time you pastebin get it creates a file.
 

SReject

New Member
Jul 29, 2019
433
0
0
I updated my script-a-roo; just bug fixes. What I'd like to add to is make the executed code none blocking(a background process) so that I could add a "update" command so anytime the control's turtle script is altered I can tell the turtles to update
 

Milaha

New Member
Jul 29, 2019
310
0
0
The pastebin idea is nice, but not all servers support it. And... each time you pastebin get it creates a file.
What do you mean by creates a file? Do you mean that it does not support updating a program, but rather simply creating one? If so, you will note I delete the old program if it exists as part of the program. if you mean an actual file on the server... I am looking through my server's world files now, and am not seeing anything of the like (I have executed prob close to 100 pastebin gets at this point). Could you point me to where they are if so, I should prob clear them out.
 

Abdiel

New Member
Jul 29, 2019
1,062
0
0
The built-in pastebin command will error out if the file already exists. There is no "overwrite" switch. Therefore to update a file, you have to first delete it, then pastebin get. A trivial annoyance, but present.

All my programs have a custom autoupdater that runs at startup, and downloads new files from dropbox, which is synchronized with one of my work folders. Therefore as soon as I'm done coding, I can simply restart any computer/turtle, or wait for it to unload, and the new code is there - without even having to go through pastebin.
 

Mattdnmc

New Member
Jul 29, 2019
2
0
0
I was thinking about creating a banking system and i need some guidance on how to do it, i know there is a login/ password server script on the cc wiki so that parts done, now how would i get it to retain the number, add/ subract a number ( based on item id with interactive sorter) from the value and retain that info. Any help will be appreciated
 

Mattdnmc

New Member
Jul 29, 2019
2
0
0
I updated my script-a-roo; just bug fixes. What I'd like to add to is make the executed code none blocking(a background process) so that I could add a "update" command so anytime the control's turtle script is altered I can tell the turtles to update
Well what about cc-get