Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

Missingno50

Members
  • Content Count

    4
  • Joined

  • Last visited

About Missingno50

  • Rank
    Junior Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. So I'm writing a library meant to help with the keycodes, and so far, everything else works just fine. However, for some strange reason, my program throws this exception. "machine:744: bad argument #1 to 'load' (function expected, got nil)" This offending code seems to be keycode.lua. --Keycodes version 1.0 function main() trick.print("This program is meant to be run on startup only.") trick.res() end do _G.keycodes = { 2 = "1", 3 = "2", 4 = "3", 5 = "4", 6 = "5", 7 = "6", 8 = "7", 9 = "8", 10 = "9", 11 = "0", 12 = "-", 13 = "=", 15 = " ", 16 = "Q", 17 = "W", 18 = "E", 19 = "R", 20 = "T", 21 = "Y", 22 = "U", 23 = "I", 24 = "O", 25 = "P", 26 = "[", 27 = "]", 30 = "A", 31 = "S", 32 = "D", 33 = "F", 34 = "G", 35 = "H", 36 = "J", 37 = "K", 38 = "L", 39 = ";", 40 = "'", 41 = "`", 43 = "\", 44 = "Z", 45 = "X", 46 = "C", 47 = "V", 48 = "B", 49 = "N", 50 = "M", 51 = ",", 52 = ".", 53 = "/", 54 = "", 55 = "*", 57 = " " } end function trick.convert(key) return keycodes[key] end However, I don't quite see the issue. What's wrong with my code?
  2. Figured it out myself. All I needed to do was the following. run = load(function) run() I feel really stupid for overlooking the load function earlier.
  3. So, let's say I want the function trick.setscr from graphics.lua. I've already loaded it with my copied 1:1 load file from OpenOS' init.lua under the variable system[4]. I want to call functions loaded into this array. How do I do this?
  4. So, here's the gist of what I'm doing. I want to read all of the filesystems, and have written this bit of code. (The computer.address comes into play in a moment.) for a,n in component.list("filesystem", false) do pri(0,0,a) end pri(0,0,computer.address()) Pri just happens to be what I named my print command, past outputting on the screen it has no bearing on my code. My computer is simple enough, creative case that houses all tier 1 parts and no hard drive. And that's where the problem comes. So, of course it reports back the floppy disk it's reading from(145), and reports back the computer's address(cd9), but it also reports something before the floppy disk, 8a8cec5-3ebf-4b81-b78e-caf4a4c3f767. Its placement is always random too although that might just be how the filesystem API works rather than anything to do with it. And if I add a hard drive(hypothetically, 638), it properly reports 638 but still has 8a8cec5 in that list. And that's not even the computer address like I initially thought! It doesn't match any components really, but the computer address is cd9, which is definitely different from 8a8. I'm very confused and this frustrates me since this program revolves around you being able to pick a filesystem to use. Does anyone know what is causing this?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.