SHOW:
|
|
- or go back to the newest paste.
| 1 | filename = "adminsuccess.txt" | |
| 2 | userfile = "usersuccess.txt" | |
| 3 | local adminpassword = "testpassword" | |
| 4 | local username = "test" | |
| 5 | local userpassword = "user" | |
| 6 | ||
| 7 | function import(ID, name) | |
| 8 | local pastebinID = ID | |
| 9 | local scriptFileName = name .. ".lua" -- Change this to the desired filename | |
| 10 | ||
| 11 | -- Download the script from Pastebin | |
| 12 | local response = http.get("https://pastebin.com/raw/" .. pastebinID)
| |
| 13 | ||
| 14 | -- Check if the download was successful | |
| 15 | if response then | |
| 16 | -- Read the contents of the script | |
| 17 | local scriptContent = response.readAll() | |
| 18 | response.close() | |
| 19 | ||
| 20 | -- Open a file on the turtle's file system and write the script content to it | |
| 21 | local file = fs.open(scriptFileName, "w") | |
| 22 | file.write(scriptContent) | |
| 23 | file.close() | |
| 24 | else | |
| 25 | print("Failed to download script from Pastebin")
| |
| 26 | end | |
| 27 | end | |
| 28 | ||
| 29 | function adminPassword() | |
| 30 | local file = fs.open(filename, "w") | |
| 31 | file.write(adminpassword) | |
| 32 | - | import("FCCHNgHS", "rentSmartMiningTurtle")
|
| 32 | + | |
| 33 | - | import("hV6x6tNr", "smartManualQuarry")
|
| 33 | + | |
| 34 | ||
| 35 | function userLogin() | |
| 36 | - | os.loadAPI("rentSmartMiningTurtle.lua")
|
| 36 | + | local file = fs.open(userfile, "w") |
| 37 | - | os.shutdown() |
| 37 | + | file.writeLine(username) |
| 38 | file.writeLine(userpassword) | |
| 39 | file.close() | |
| 40 | end | |
| 41 | ||
| 42 | import("xj3hy4Rk", "phone")
| |
| 43 | import("7Gtn3S6W", "text")
| |
| 44 | os.pullEvent = os.pullEventRaw | |
| 45 | adminPassword() | |
| 46 | userLogin() | |
| 47 | os.loadAPI("text.lua")
| |
| 48 | os.loadAPI("phone.lua")
| |
| 49 | if phone.getExitCode() ~= 1 then | |
| 50 | os.shutdown() | |
| 51 | end |