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

Molinko

Members
  • Content Count

    446
  • Joined

  • Last visited

  • Days Won

    34

Molinko last won the day on May 28

Molinko had the most liked content!

2 Followers

About Molinko

  • Rank
    Leading Member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

2297 profile views
  1. Molinko

    Text box

    Bummer.. I guess because user input is not strictly a file it's not behaving the way I expected.. perhaps you'll have to roll your own user input with event.pull..
  2. Molinko

    Text box

    I could be wrong about io.read... perhaps post your code so I can see what's going on.
  3. Molinko

    Text box

    Io.read should yield the thread until enter is hit or the arg to it is satisfied ie after 2 characters. setCursorBlink will only set the blink mode of the cursor
  4. Molinko

    Text box

    To limit the number of characters read you can pass a number to io.read. i.e `io.read(2)` As for the cursor blinking and overwriting your input box you can either make your input box larger or turn the cursor blinking off with `term.setCursorBlink(false)`
  5. Molinko

    Touch input

    The lib you're looking for are cursor.lua & full_cursor.lua but I'm not sure these will do what you're seeking to accomplish I just remember hearing about them... Also my example was done in a way that it could be modified to control the windows(and thus the cursors) of other processes. If you just want to access the current processes window it may be simpler with the tty lib. local tty = require "tty" local event = require "event" local kb = require "keyboard" local window = tty.window local handle = event.listen("touch", function(_, _, x, y) window.x = x window.y = y print "HI" end) while true do local ev = { event.pull("key", nil, nil, kb.keys.q) } event.cancel(handle) break end
  6. Molinko

    Touch input

    Was this any help? I forgot, but there is actually a cursor library in the later versions of openos that you might want to check out.. I haven't used it and I'm not familiar with it at all but that might be a better solution.
  7. Molinko

    Touch input

    okay so its a bit tricky cause i dont know what exactly you're trying to pull but ill give it a shot... local term = require "term" local kb = require "keyboard" local event = require "event" local process = require "process" local component = require "component" local window = term.internal.open() -- # creates a full screen window. optionally provide (dx, dy, width, height) term.bind(component.gpu, window) -- # bind the primary gpu to the window we made local proc = process.info() -- # get an instance of this process' details local handle = event.listen("touch", function(_, _, x, y) -- # this is basically your 'cursor' function proc.data.window.x = x proc.data.window.y = y print "HI" -- # click around to see the effect end) while true do local ev = {event.pull("key")} if ev[4] == kb.keys.q then break end -- # quit the loop and basically the program end event.cancel(handle) -- # clear the event listener This example can be modified to control the window of another process as well. I hope this can get you started. Ask away if this isn't very clear....
  8. Molinko

    Touch input

    Each process in openos has its own instance of a cursor. It's stored in the window property of a process I believe.. try assigning to the processes window cursor as term.setCursor will only set the cursor of the process calling it... I can't test any code ATM so you may have some exploring to do
  9. Molinko

    Touch input

    Are you trying to move the cursor of another program like 'edit' or something?? I'm a bit lost. Perhaps post all your code
  10. Molinko

    Touch input

    Are you using term.setCursor??
  11. I'm not super familiar with AE but I think you need an export bus and a robot or drone with an inventory controller
  12. If event.listen is after a continuous loop then it wont be called until that block is finished. To use event.listen it should be called before the loop starts. Note: the loop will have to yield somehow via either event.pull or os.sleep or computer.pullSignal. while (some_condition) do doSomething(data) os.sleep(5) doSomethingElse(more, data) end event.listen('some_event', listener) -- # this will not run until `some_condition` above returns false or there is an error event.listen('some_event', listener) while (some_condition) do doSomething(data) os.sleep(5) -- # if an event named `some_event` happens during this sleep call above then the listener will execute doSomethingElse(more, data) end background stuff.. local thread = require 'thread' local event = require 'event' local bg_proc = thread.create(function() print 'starting background thread..' while true do local ev = event.pull 'key' print 'somebody pressed something!' end end) print 'starting main loop' local i = 0 while true do i = i + 1 print('count is ' .. tostring(i)) os.sleep(1) end
  13. How big is the serialized table and what kind of values are in the table? Are there recursive entries or functions in the table?
×
×
  • Create New...

Important Information

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