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.

      395
      posts
    3. IRC

      #OC channel discussion
      irc.esper.net #oc

      25
      posts
  2. Code Central

    1. Support

      Ask for support from the OpenComputers community

      3919
      posts
    2. Showcase

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

      2742
      posts
    3. Tutorials

      Help other users out. Please no 'false tutorials'

      124
      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

      89
      posts
  4. General

    1. Lounge

      Just lounge around or have an open discussion.

      327
      posts
    2. Forum Games

      Fight boredom!

      62
      posts
    3. Showcase

      Show off your creations! (not for your programs)

      133
      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

    • I thought you wanted to make your own OS (DEVOS). Why do you need to install OpenOS for that? Thank you for clarifying that my guess of your knowledge about operating systems was correct.
    • you can also use vt100 codes for color io.write("\27[31m", "hello ", "\27[33m", "world", "\27[m")  
    • This was exactly what I was looking for. Thanks for your help.
    • Ok, as promised, here is a more advanced function. Instead of giving it one string and specify its color, you mark parts of the string and specify foreground (and also background) color by using a xml/html like syntax. If you want to change on part of the string, put it between <color fg=hex, bg=hex>your string goes here</color>. Hex is the color code starting with 0x (like 0xFFFFFF). You don't have to specify both, background and foreground, just set the color you like to change; if you set both, use a comma (,) as delimiter. local component = require "component" local term = require "term" ------------------------------------------------------------------------------- local gpu = component.gpu local adWrite = {} function adWrite.write(s) local cbg, cfg = gpu.getBackground(), gpu.getForeground() local i = 1 s:gsub('()<color(.-)>(.-)</color>()', function(i1, tag, content, i2) local bg, fg if not i1 then return end term.write(s:sub(i, i1-1)) tag = tag:gsub('%s', "") -- remove whites paces for colortype, color in tag:gmatch '([bfg][bfg])=(0[xX]%x+)' do if colortype == "bg" and color then bg = tonumber(color) elseif colortype == "fg" and color then fg = tonumber(color) end end if bg and bg ~= cbg then gpu.setBackground(bg) end if fg and fg ~= color then gpu.setForeground(fg) end term.write(content) gpu.setBackground(cbg) gpu.setForeground(cfg) i = i2 end) if i <= #s then term.write(s:sub(i, #s)) end end ------------------------------------------------------------------------------- return adWrite Here is an example:  
    • yes I do via some P2p tunels bus otherwise yes
  • Popular Contributors

×
×
  • Create New...

Important Information

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