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

    1. Announcements

      OpenComputers official announcements.

      122
      posts
    2. Feedback

      Tell us what you think.

      400
      posts
    3. IRC

      #OC channel discussion
      irc.esper.net #oc

      25
      posts
  2. Code Central

    1. Support

      Ask for support from the OpenComputers community

      3979
      posts
    2. Showcase

      Showcase what you have created for OC. No 'malware' or other junk!

      2775
      posts
    3. Tutorials

      Help other users out. Please no 'false tutorials'

      125
      posts
  3. Addons & More

    1. Addons Mods

      Show off your OC addons mods

      228
      posts
    2. Architectures

      Discussions for Architectures

      176
      posts
    3. OpenEngineering Task Force

      Discussion board for the OETF documents

      91
      posts
  4. General

    1. Lounge

      Just lounge around or have an open discussion.

      328
      posts
    2. Forum Games

      Fight boredom!

      66
      posts
    3. Showcase

      Show off your creations! (not for your programs)

      136
      posts
    4. Servers

      A place to advertise your servers

      147
      posts
  5. Archives

    1. Public Archives

      OpenComputers public archive forum

      8
      posts
  • Forum Upkeep

    In order to keep the forums updated with improvements and security fixes, we need to pay for a subscription.

    Currently, this is: $25/6-months for the forums itself and $10/6-months for the Theme (totalling $35 USD/6-months).

    You're not obligated to donate anything, but anything you do donate will be much appreciated. :)

    Donate Sidebar by DevFuse
  • Topics

  • Posts

    • You want a progress bar for the file transfer via modems? There is no built-in method available, so you need custom scripts for this. My approach would start with calculating the file's size and transmitting it to the receiving computer. Then the file is split into packets and transferred; by the size of the arriving packets the progress can easily be calculated. The remaining question is how to split the file. You could either send line by line or send a fixed number of bytes. Depending on your choice, the calculation method for the file size will vary. Number of lines: local n = 0 -- number of your lines for _ in io.lines("path/to/file") do n = n + 1 end Number of bytes: -- Method 1: local function filesize (file) local pos = file:seek() local size = file:seek("end") file:seek("set", pos) return size end -- open file and call function with file local f = assert(io.open("path/to/file")) local n = filesize(f) -- Method 2: local f = assert(io.open("path/to/file")) local data = f:read("*all") local size = #data The only thing you then need is a way to display the progress, either by simply printing the percentage or by drawing a more or less detailed progress bar. I hope in correctly interpreted your question and this gets you started. Feel free to ask if you need further assistance.
    • Is possible to copy files in openos with percent progress output? Require for big files copy with low speed over network card. Probably im first who ask this
    • c) You go back You go back to the room you started in. The bed is gone! Do you a) Sleep on the floor b) Check if a phone is in your pocket c) Run through the hallway d) Try to punch through the *room*'s wall  
    • Well, you can use “not“, which will do exactly what you‘re trying to do. if not (val > x and val < y) then -- do stuff end But: - not greater than is the same as less than (actually less or equal <=) - not less then is the same as greater than (greater or equal) It would look like this: if val <= x and val >= y then -- do stuff end    
    • I am working on a button system for a program I'm making, and i need help with identifying if a value is NOT greater than or less than something. The thing is, there is no operator that checks if something is not greater/less than, as there is only ~=, >=, and <=.
  • Popular Contributors

    Nobody has received reputation this week.

×
×
  • Create New...

Important Information

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