gfisnum,gdisplaystr,gbinop,gax,gbx,MAXDISP,gfnotexit=0,"","+","0","1",24,1 acolor={2628095,1015567,986895,12632256} kbd={{"Off",2628095},{"C",2628095},{" 0 then if #gdisplaystr == 1 then displaystr( "0", 6052991 ) end gdisplaystr=gdisplaystr:sub(1, #gdisplaystr-1) if #gdisplaystr > 0 then displaystr( gdisplaystr, 6052991 ) end end elseif rowcol == 18 then if #gdisplaystr > 0 then if gdisplaystr:sub(1,1) == "-" then gdisplaystr=gdisplaystr:sub(2, #gdisplaystr) elseif #gdisplaystr < ( MAXDISP - 1 ) then gdisplaystr = "-"..gdisplaystr end displaystr( gdisplaystr, 6052991 ) end elseif (rowcol==3) or (rowcol==7) or (rowcol==11) or (rowcol==15) then gbinop,gax,gfisnum = kbd[rowcol+1][1], tonumber(gdisplaystr), 0 elseif (rowcol==19) then if gfisnum == 1 then gbx, gfisnum = tonumber(gdisplaystr), 0 end if gbinop == "+" then gax=gax+gbx elseif gbinop == "-" then gax=gax-gbx elseif gbinop == "*" then gax=gax*gbx elseif gbinop == "/" then gax=gax/gbx end gdisplaystr=tostring(gax) displaystr( gdisplaystr, 6052991 ) end end while gfnotexit == 1 do local button=-1 local x=-1 local y=-1 local line = io.read() if line == "drawapp" then print("Fo 0 611 3\nFo 2 140 3") print("F 0 16777215\nFR 0 0 0 10000 10000\nB 0 12632256") for i=0,19 do print( "F 0 10526880\nFR 0 "..((i%4)*2000+220).." "..((i//4)*1200+1220).." "..((i%4)*2000+2080).." "..((i//4)*1200+2280)) print( "F 0 986895\nR 0 "..((i%4)*2000+200).." "..((i//4)*1200+1200).." "..((i%4)*2000+2100).." "..((i//4)*1200+2300)) print( "F 0 "..kbd[i+1][2]) print( "C$ 0 "..((i%4)*2000+1100).." "..((i//4)*1200+1700).."\""..kbd[i+1][1].."\"") end print( "F 0 16711935\nC$ 0 5000 800 \"Lua cloud app\"") print( "F 2 255" ); print( "C$ 2 5000 7200\"Corrie Zucker Technologies LLC.\"" ) print( "C$ 2 5000 7340\"d/b/a CZ Technologies\"\nZ " ) displaystr( "0", 6052991 ) else local buttonxy="" local i=1 for buttonxy in string.gmatch(line.." ", "-?%w+") do if i == 1 then button=tonumber(buttonxy) elseif i == 2 then x=tonumber(buttonxy) elseif i == 3 then y=tonumber(buttonxy) end i=i+1 end end if ( x >= 0 ) then row,col = ((y-1200)//1200), ((x-200)//2000) if ( row >= 0 ) and ( row < 5 ) and ( col >= 0 ) and ( col < 4 ) then keytoexe(row*4+col) end elseif ( x == -2 ) then if ( button == 79 ) or ( button == 111 ) then keytoexe( 0 ) end if ( button == 99 ) or ( button == 67 ) then keytoexe( 1 ) end if ( button == 99 ) or ( button == 67 ) then keytoexe( 1 ) end if button == 8 then keytoexe( 2 ) end if button == 42 then keytoexe( 3 ) end if button == 55 then keytoexe( 4 ) end if button == 56 then keytoexe( 5 ) end if button == 57 then keytoexe( 6 ) end if button == 47 then keytoexe( 7 ) end if button == 52 then keytoexe( 8 ) end if button == 53 then keytoexe( 9 ) end if button == 54 then keytoexe( 10 ) end if button == 43 then keytoexe( 11 ) end if button == 49 then keytoexe( 12 ) end if button == 50 then keytoexe( 13 ) end if button == 51 then keytoexe( 14 ) end if button == 45 then keytoexe( 15 ) end if button == 48 then keytoexe( 16 ) end if button == 46 then keytoexe( 17 ) end if ( button == 105 ) or ( button == 73 ) then keytoexe( 18 ) end if button == 61 then keytoexe( 19 ) end elseif ( x == -4 ) then print( "Rz "..button.." "..y ) elseif ( x == -5 ) then print( "Mv "..button.." "..y ) -- elseif ( x == -98 ) then sleep(y) end end