Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

22
LINES

< > BotCompany Repo | #203 // Editor with commands

Rendition of first frame

Lua code - GUI

1  
get("#185")
2  
3  
function lineAbove()
4  
  return lines[curY] or ''
5  
end
6  
7  
function userFunction(line)
8  
  return "Hello.\n"
9  
end
10  
11  
function extensions(hook)
12  
  if hook == 'processEvents1' then
13  
    if inputEvents then
14  
      for _, e in ipairs(inputEvents) do
15  
        if e[1] == 'keyTyped' and e.keyChar == '\n' and userFunction then
16  
          local s = userFunction(lineAbove())
17  
          if s ~= nil then insertText(s) end
18  
        end
19  
      end
20  
    end
21  
  end
22  
end

show applet  test run  test run with input  download  show line numbers   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Image recognition results

Recognizer Recognition Result Visualize Recalc
#308 470 [visualize]

Snippet ID: #203
Snippet name: Editor with commands
Eternal ID of this version: #203/1
Text MD5: 48cdeebfd37e1ff1871cabecb8c35457
Author: stefan
Category: editors
Type: Lua code - GUI
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2014-01-22 21:21:53
Source code size: 470 bytes / 22 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 809 / 290
Referenced in: [show references]