So. We all know that a file named startup will override the one on the computer. I'm wondering if there's any way to bypass this? Like, make the startup file on the computer run regardless of the startup file on the disk.
Thanks - Mackan
Bypass disk override?
Started by Mackan90096, May 20 2015 10:31 AM
9 replies to this topic
#1
Posted 20 May 2015 - 10:31 AM
#2
Posted 20 May 2015 - 10:51 AM
There's no ingame way, but you (or the server owner in multiplayer) can edit the computercraft rom to prevent it.
#3
Posted 20 May 2015 - 11:00 AM
A disk with a higher "priority" could be used to with a startup script to run the computer's startup script. The highest "priority" disk drive is the top as it is the first place checked for a startup.
#4
Posted 20 May 2015 - 11:28 AM
Depending on what version of ComputerCraft you are using contrary to popular belief all but the newest versions you can actually bypass disk/startup files. The string metatable is exposed in older versions of the mod and when you edit this it remains until the server restarts or someone else changes the metatable. There is a section just before disk/startup is run that uses gsub which will run your metatable program effectively bypassing the disk if you make it do that.
Please note this would be slightly hackish and dirty code but if we are being honest since most modpacks aren't fully up to date yet, yes it is possible
Please note this would be slightly hackish and dirty code but if we are being honest since most modpacks aren't fully up to date yet, yes it is possible
Edited by HDeffo, 20 May 2015 - 11:29 AM.
#5
Posted 20 May 2015 - 01:19 PM
flaghacker, on 20 May 2015 - 10:51 AM, said:
There's no ingame way, but you (or the server owner in multiplayer) can edit the computercraft rom to prevent it.
For most new versions you no longer edit the jar to make changes. Instead the new method is to put a resource pack in a resource pack folder in the server files, and it will automatically use whatever you put in the resource pack to overwrite the original (with the exception of the bios). In order to prevent disk startup the program you would want to modify is /rom/startup
Edited by valithor, 20 May 2015 - 01:20 PM.
#7
#8
Posted 20 May 2015 - 08:35 PM
HDeffo, on 20 May 2015 - 11:28 AM, said:
Depending on what version of ComputerCraft you are using contrary to popular belief all but the newest versions you can actually bypass disk/startup files. The string metatable is exposed in older versions of the mod and when you edit this it remains until the server restarts or someone else changes the metatable. There is a section just before disk/startup is run that uses gsub which will run your metatable program effectively bypassing the disk if you make it do that.
Please note this would be slightly hackish and dirty code but if we are being honest since most modpacks aren't fully up to date yet, yes it is possible
Please note this would be slightly hackish and dirty code but if we are being honest since most modpacks aren't fully up to date yet, yes it is possible
#9
Posted 20 May 2015 - 10:51 PM
The only way to not call the __index metamethod would be to use rawget. string.sub, str:sub, string["sub"] will all call the __index metamathod. (This is, of course, assuming they are already indexes - setting an index would trigger __newindex).
#10
Posted 21 May 2015 - 01:18 AM
It isn't a matter of me being almost right. I actually use this method on a server I run for cross computer communication so I know it works.
@avavrins: that's a different function and not what triggers my code. The function that triggers it is :gsub although I don't know in which program it is is I only know it somehow happens only if __index is a function and not a table and happens before disk/startup.
@KingofGamesYami: the string table and the string metatable are two different tables calling one will not trigger the other. The metatable exists within each string and exists within that string. The string table is a table of functions within the global table _G. In standard computercraft string.len() does not call str:len() and visa versa. My code takes advantage of this and makes it so str:len() DOES call string.len() but this still doesn't occur the way so there isn't a loop.
@avavrins: that's a different function and not what triggers my code. The function that triggers it is :gsub although I don't know in which program it is is I only know it somehow happens only if __index is a function and not a table and happens before disk/startup.
@KingofGamesYami: the string table and the string metatable are two different tables calling one will not trigger the other. The metatable exists within each string and exists within that string. The string table is a table of functions within the global table _G. In standard computercraft string.len() does not call str:len() and visa versa. My code takes advantage of this and makes it so str:len() DOES call string.len() but this still doesn't occur the way so there isn't a loop.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











