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

Gladox114

Members
  • Content Count

    21
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Gladox114

  1. But what if I want to read the third line? do I need to:

    --

    file:read("*l")

    file:read("*l")

    x = file:read("*l")

    --

    or can i type the number somewhere somehow?

     

    edit: Marked a section where I replaced all "write" with "read" because I'm stupid

  2. Quote

    file:write(newIP)

    That should write to the first line or to a new line?

     

    IP = file:read(1)?

     

    What is with multiple settings? How should i use the write function then?

    Can you give me an example how someone uses such system?

     

     

  3. I want to make an application that creates a file named "config.txt" and read/write to it but i am hanging on creating the file. Can't find how to create the file.

     

     

    My Project: Github_Project_Line85

    I want to save the IP that the user writes in and after rebooting it should stay. (Line 85)

    I want to make a check system with the config.txt and then load the variable into it.

    It's using the GUI API from MineOS

     

  4. I didn't edit the init.lua and im not sure what i need to edit.

     

    Owner: Gladox114

    Name: Gladox114.robot

    Last error: bad argument #1 (number expected, got string)

    Number of connected components: 6/12

    Component name: computer

    Address: 02bc007a-42e2-44cb-9f9c-480a27239814

    Unbenannt.PNG.1d65267104037211eafd248d8393aeee.PNGUnbenannt2.PNG.a343498fb80180a7e78b11d4887b0991.PNG

  5. I tried it and it didn't work. And yeah i overlooked that ^^

    I tried it with items = {} and it didn't worked. And I want to load the itemList.cfg and tried it with os.execute("itemList.cfg") and the same error

     

    edit: The ME_Controller didnt had energy so my working code didnt worked too but now both are doing great

     

     

  6. I was building on the AE2Stock code and i wanted the items list separate from the code itself to edit it while its running but however the storedItem[1].size is nil by executing my newer version of AE2Stock. So i need help

    The working older version: https://pastebin.com/c1B0L0Pi

    The New Version i need help with: https://pastebin.com/Tb4KWszT and the list https://pastebin.com/ZiPbChT2

     

    Maybe you'll need my function drawText(text,SecondGPUProxy): https://pastebin.com/S5uMbMBT

     

     

  7. I think its working but its not starting directly so i would maybe start it ones before timer starts it "loopDelay" later.

     

    Quote
    
    
    loop()
    event.timer(loopDelay, loop, math.huge)

     

     

    I appreciate it and thx for helping me

  8. Quote

    Ok, for your code, you want a program that does a gpu set using a string or a number as input? And if it is a string, you want to replace all \n with ""?

    Yeah for now i just wanted to go a line down if the string contains "\n" in it.    its cheap ik

    27 minutes ago, CptMercury said:

    if type(str) == "number" then str = tonumber(str)

    I am not allowed to use numbers in gpu.set() but i want so i need to convert however the number to a string.tonumber() converts a string with a number like "10" in to a number like 10. The opposite what i need and i thought that string.format() does the opposite.

     

  9. When i am in the Lua section and want to use the string.format("%g",num) it works like it should but in my code drawtext not...

    I want to use gpu.set(x,y,string) but my problem is that i want sometime numbers as strings but i don't know how to convert them properly

    info who is wondering whats drawText()            

    drawText(print, gpu proxy) is my function that prints something on my second screen with a second graphics card to multi-task

    1f98ee56e8459549a2f7fa6ff8eabb70.png.a4b9145ae8cb9851691e6d9ce4c1e1f4.png

    98cfaa8a9f57c1dc1a0f7e7d64ffa5cb.png.14980e55f2a73c0c7aac812365e7b116.png

    13f15018142c0368502f5e26a0678b88.png.b10f69dd8e0ed0c4ffd0d6204f821bba.png

  10. The gpu.copy() is a little bit bugged i would say or i use it wrong

     

     

    local c = require("component")
    local gpu2 = c.proxy(c.get("009"))
    gpu2.setBackground(0xCC0000) -- setting background to red
    local x,y = gpu2.getResolution()
    gpu2.fill(1,1,x,y," ")       -- fill the whole screen red
    gpu2.setBackground(0x000000) -- setting background to black
    gpu2.fill(1,1,x,y/2," ")     -- fill the top half screen black
    os.sleep(2)
    gpu2.copy(1,y/2,x,y/2,1,1)   -- copy the red half bottom to the half top
    print(y/2) -- just to check if i calculate something wrong
    os.sleep(2)

     

    And it doesn't work at all as you can see in the picture...

    I maybe need some examples and tutorials for this.

    Desktop Screenshot 2019.03.13 - 21.32.18.01.png

  11. I know that "not nil" is wrong but how to test if the input is a nummber and do something when input is a nummber.

     

    read = io.read()
    if string.match(read, "(%d+)") == not nil then
    -- do something
    end

     

  12. I know that "not nil" is wrong but how to test if the input is a nummber and do something when input is a nummber.

     

    read = io.read()
    if string.match(read, "(%d+)") == not nil then
    -- do something
    end

     

  13. Warning: Maybe its a bad english.

     

    I dont know why this dont work.

    I want to test if a specific word is written in to the "line" and it dosnt work.

    Quote
    
    line = io.read()
    
    if line == "y" or "Y" then
    print("its Yes")
    elseif line == "n" or "N" then
    print("its No")
    end
    

     

×
×
  • Create New...

Important Information

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