Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - blauemauritius

Pages: 1 [2]
16
Lua / Re: loadstring - MyLib
« on: April 17, 2013, 01:57:57 am »
Thank you very much. Do you have an example? I have read the Code in your file, but i don't understand thim?

I couldn't image how does it work.

For example i have the file test.txt in the folder Mylib. In the file i have the variable Zahl=1234.

What are the steps what i have to do?

I would be grateful, if you can help me.

Thank you very much.

17
Lua / Re: loadstring - MyLib
« on: April 16, 2013, 03:04:20 pm »
Thank you. That´s what i was looking for.

Which kind of variables can i use? Can I use lists?

Which format should have the file?

18
Lua / loadstring - MyLib
« on: April 16, 2013, 02:48:34 pm »
Hello,

i have one question regarding the function loadstring. How could i use the function to load a file from the MyLib folder on my TI-nspire?

Thank you very much for your help.


19
Lua / Re: Lua 'XML' reader
« on: April 15, 2013, 12:55:21 pm »
Hello,

the code doesn't work on my TI-nspire CX CAS. I have copied the code in a txt-editor and saved the file with the name xml.lua. With TI-Nspire Scripting I have tried to insert it on my TI. The page is white only. What is wrong? Maybe someone could help me.

Thank you very much.

20
Lua / Lua-Script doesn´t work on TI-nspire CX CAS.
« on: April 15, 2013, 12:50:18 pm »
Hello,

i have written an LUA-Script. It works on pc application but not on TI-nspire CX CAS. I got a message regarding char(24) in line 1.

Does anyone know what could be wrong?

Thank you very much.


21
Lua / Re: Lua - nspire - page/documents
« on: June 30, 2012, 03:57:40 pm »
Thank you. I will try it.

22
Lua / Lua - nspire - page/documents
« on: June 30, 2012, 03:31:30 pm »
Hello,

i want to program following with lua on my nspire: I have a main page (1.1) and a menu with two options. If i select option 1, i will have three other pages (1.2 , 1.3 , 1.4). If i select option 2, i will have two other pages (1.2 , 1.3).

My questions are: Is it possible to create or add a new page with lua? Or is it possible with lua to delete the content of a page?

Thank you very much.

Blauemauritius

23
Lua / Re: [Howto] Check if a key is pressed down (more or less)
« on: June 03, 2012, 02:39:48 pm »
Excuse me. This is the code which i have tested.

MasterKey = class()

function MasterKey:init(eventInterval, firstEventInterval)
    self.keyDown = false
    self.eventInterval = eventInterval or 200
    self.firstEventInterval = firstEventInterval or 750
    self.time = {firstEvent = 0, lastEvent = 0}
end

function MasterKey:keyEvent(timeNow)
    local timeNow = timeNow or timer.getMilliSecCounter()
    if not self.keyDown then
        self.time.firstEvent = timeNow
    end
    self.time.lastEvent = timeNow
    self.keyDown = true
end

function MasterKey:updateStatus(timeNow)
    local timeNow = timeNow or timer.getMilliSecCounter()
    self.keyDown = timeNow - self.time.firstEvent < self.firstEventInterval
                or timeNow - self.time.lastEvent < self.eventInterval
end

function MasterKey:isDown()
    return self.keyDown
end

Keys = class()

function Keys:init(keys, eventInterval)
    self.keys = {}
    for i = 1, #keys do
        self.keys[keys] = {keyDown = false, timeLastEvent = 0}
    end
    self.eventInterval = eventInterval or 200
end

function Keys:keyEvent(key, timeNow)
    self.keys[nobbc].timeLastEvent = timeNow or timer.getMilliSecCounter()
end

function Keys:updateStatus(key, masterKey)
    if masterKey.keyDown then
        if not self.keys[nobbc].keyDown
       and masterKey.time.lastEvent - self.keys[nobbc].timeLastEvent
         < self.eventInterval then
            for key, value in pairs(self.keys) do
                self.keys[nobbc].keyDown = false
            end
            self.keys[nobbc].keyDown = true
        end
    else
        self.keys[nobbc].keyDown = false
    end
end

function Keys:isDown(key)
    return self.keys[nobbc].keyDown
end

function on.tabKey()
    tab:keyEvent()
end

function on.charIn(c)
    if c == "x" then
        keys:keyEvent("x")
    elseif c == "y" then
        keys:keyEvent("y")
    elseif c == "z" then
        keys:keyEvent("z")
    end
end

function on.timer()
    platform.window:invalidate()
end

function on.create()
    timer.start(0.01)
end

tab = MasterKey()
keys = Keys({"x", "y", "z"})
function on.paint(gc)
    tab:updateStatus()
    keys:updateStatus("x", tab)
    keys:updateStatus("y", tab)
    keys:updateStatus("z", tab)
    gc:drawString("'x' key down: " .. tostring(keys:isDown("x")), 0, 0, "top")
    gc:drawString("'y' key down: " .. tostring(keys:isDown("y")), 0, 20, "top")
    gc:drawString("'z' key down: " .. tostring(keys:isDown("z")), 0, 40, "top")
end

24
Lua / Re: [Howto] Check if a key is pressed down (more or less)
« on: June 03, 2012, 02:36:35 pm »
I got the message im nspire: 54:attempt tp index field '?' (a nil value)

25
Lua / Re: [Howto] Check if a key is pressed down (more or less)
« on: June 03, 2012, 02:22:31 pm »
it doesn't work.:-(

Pages: 1 [2]