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 - Jens_K

Pages: 1 [2] 3 4 ... 13
16
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: December 08, 2014, 03:53:50 pm »
@LDStudios: Yes, I sent an email to the ticalc staff on the 28th November, pointing out that I want to replace the old file and participate on POTY, but I still didn't get an answer... Seems like they were busy

17
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: December 08, 2014, 01:46:54 pm »
Ok, it's now finally on ticalc.org, although it seems like I was too late for POTY  :/

@mdr1: Thanks for the reports (I don't have acces to OS 3.1, so I can't debug it)! I think I know how to fix the menu; if you have acces to the code via the student software you can fix it like this: Put "createMenu()" somewhere in the end of the code, to call it during initialization. I will also fix this in the next update.
The other problem with the start menu is more difficult to solve, because I don't have much information about it and right now I can't think of any possible cause... Does this error only occur on this dialogue? What about using [tab] or other arrow keys?

PS: I now have updated the first post with current screenshots, current version and stuff.  ;)

18
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: November 27, 2014, 02:39:13 pm »
Ok, here it is: Version 2.0 is finished!
I really don't have much time lately due to last-schoolyear-before-a-levels-related-stuff, but I definitely wanted to finish it before the end of ticalcs nomination november, so maybe I rushed this final release a bit... Anyways, here's the changelog:

New:
- New tool to change indentation width of your code (especially useful when copy&pasting code from/to other editors)
- You can now enter commands during runtime by pressing enter on a console app (which imo is a really cool feature)
- The editor will restore its saved state (including code and cursorposition)

Improvements:
- Rearranged menu so that it's more clear
- The advanced lua/physics guide is now on page 1.4 of the main file (it is still not finished)

Fixes:
- Setmetatable function now returns the new table properly
- Full module support (previous fix didn't work)
- Initalization functions (like on.resize and on.activate) are called more accurately (metatable event handlers are now only called once) and are crash-protected on OS 3.1
- various bugfixes due to code revision

Code Cleanup:
- A new settings loading/storing module manages settings now
- More comments
- Revised some older parts of the code

The attached archive contains both JSE files for OS 3.1 and OS>3.1, controls pictures of both Nspire layouts and a readme.txt
PS: I will upload it to ticalc.org and update the first post of this topic with a full v2.0 changelog as soon as I have the time for it  ;)

19
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: October 27, 2014, 05:15:58 pm »
@Adriweb: Thank you for keeping the ti-planet article updated; I would do it myself if I could speak french  ;) . Oh and I noticed that you apparently mistakenly translated and pasted the post of the older beta 1 version...


@LDStudios: You're right, I thought it would be bigger; I'll include it in the main file next update. I have to leave it on a seperate page from the other guide page though, because I already used all available toolbox items on this page and I can't dynamically change the menu's content on OS 3.1

20
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: October 26, 2014, 04:06:47 pm »
Hello! We're getting close to the final release; here's the 2nd beta release of JSE v2.0 :D ! This time I also attached the current (unfinished) state of the advanced Lua and physics api guide ;)

New:
- Autocompletion Settings (menu=>"File"=>"Settings"=>"Autocompletion Settings"):
  - You can now add own entries to the autocompletion list
  - If not disabled, after running your script, all global variable names are added to the autocomplete menu (Thanks CinusMinus for the idea!)
- Custom pattern are now colored in the set order
  - patterns are movable in the hierarchy list with + and -
- Advanced Lua Guide Loader on page 1.4
- User Script page now can print the value of an entered global value after a runtime error and after stopping the script
- Double click on a alphanumeric word to select it
  - Triple click on a sequence of non-space-characters to select it
- New Dialogue added, which asks for the calculator layout and then shows all character shortcut buttons

Improvements:
- Setting the apilevel in a script had caused bugs; it's now protected
- Vastly improved unicode-mode speed
- Improved method to reset global environment (some strange behaviours may be fixed now)
- console app now also uses the custom color-set of the editor
- Monitored variables will now be unmoitored after stopping the script
- Disabled rendering code as background for some dialogues to improve performance (only on handheld)
- Rewritten character-centering algorithm => unicode characters are now correctly monospaced

Other changes:
- User Script Page auto-registered menu is now enbled by default
- User Script Page now warns you if your script is ready but it's not focused
- Various fixes and performance improvements

About the advanced Lua Guide:
- It includes basic functions and libraries, directly parsed from http://www.lua.org/manual/5.1/manual.html
- It also includes the Phsysics part of the TI-Nspire Lua Scripting API Reference Guide (work in progress!)
- The file can view its content by itself and its content can be viewed with the Advanced Lua Guide Loader on page 1.4 of JSE
- To install it, place it in the MyLib-folder (don't rename it) and then refresh libraries (doc=>6)


I didn't have much time to debug this time, so it may includes some bugs; so as always: please report bugs and other oddities ;)

21
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: October 08, 2014, 03:55:37 pm »
Thanks for the feedback!


@pierrotdu18: Yes, I thought about this option too. In fact, there is already a rudimentary option like this implemented (add ",overwrite=true" to an entry in the variable in jse.patterns), but it overwrites other coloration in any case, even inside strings. I will improve the custom syntax feature in future releases and add stuff like stuff like priority and hierarchies!  ;)  Btw: I saw your new sublime version on ti-planet; nice job! :)

22
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: October 07, 2014, 12:59:10 pm »

Hi!
Sorry for the late update, I didn't have much time lately; but finally here is the 1st beta release of JSE v2.0!


Improvemetns:
- Custom syntax coloration!
  - you can now add new word groups and lua patterns and set their display color
  - I added some example entries which you can of course modify and remove
- Scripts are now split into (max. 26) parts with maximum saveble length (65528 chars)
  ==> Scripts can now have up to 1.7 million characters!
  (this feature took very long, because many features like saving, loading, deleting, renaming and transferring have to be able to process parts now)
  - "Export via Clipboard"-dialogue added to easier export long scripts via the limited clipboard storage
- Fully functional unicode support
  - everything (syntax coloring, find function, etc.) now works correctly in unicode mode (it's just a bit slower)
  - Added dialogue, asking for unicode mode when entering a non-ascii-character
  - UTF-8-sequence-bytes in not-unicode-mode are now represented by "□"
- Autosave function ("File"=>"Settings"): Saves current code in some events
- Textboxes now have a movable cursor and support paste
- If the on-table gets overwritten during initialization, the programm throws an error
- Added "Tipps & Tricks"-dialogue which shows some useful keycombinations, newcomers might not know


Fixes:
- Fixed (hopefully) all undo & redo bugs
- Modules (like "physics") are now usable more than 1 time :P


Other changes & improvements:
- "Insert"-menu now only offers to insert statements (use the autocomplete menu for eveything else)
- You can now reset the console via menu=>Delete=>Delete all
- Increased undo history depth from 10 to 20 states
- Pressing a letter button on listboxes makes it select the first item starting with this letter
- Rearranged main menu a bit to make it more handy


Now that all major bugs are fixed and most main features of v2.0 are implemented, I declare the beta stage, so feel free to report all bugs and strange behaviours of JSE! I will of course continue to work on it until I have finished all things on my todo-list ;)

23
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: August 24, 2014, 07:22:39 am »

After vacation, gamescom and eye surgery I finally have time to work again! So here's the 5th alpha release of v2.0!

New:
- settings menu
  - adjustable amount of spaces per indent
  - activatable unicode mode (replaces some string functions by their unicode representive)
  - activatable autoregistered menu (OS>3.1) on user script page which offers to:
    - stop and restart current script
    - pause and resume current script
    - show/hide ipad keyboard
- shift++/shift+- now lets you scroll pagewise through your script
- insert saved files (menu=>"File"=>"Insert") (to insert saved headers and other stuff) *lazy solution :P *

Improvements:
- rewrote some safety functions
  - You can do everything with the "on"-table now; the user script page wont crash, even on OS 3.1!
  - eventhandling with on's metatable is now possible with nearly no restrictions and crashes
  - still "on" is only for eventhandling. For table library functions, it acts like an empty table!
  - don't write on=yourTable, do setmetatable(on,{_index=yourTable}) instead!
- improved dialogues (default cursor, customizable color, click outside = escape key)
- the editor now registeres an error handler on OS>3.1 so that it shouldn't crash
- the editor now searches for saved files instead of remembering them => less lost files

Fixes:
- print function now handles nil values correctly
- recalling saved settings now works
- added table and coroutine libraries to autocompletion list
- fixed that some scriptnames (e.g. starting with letter "e") were not possible


Here's also my current todo-list:
Spoiler For todo:
fix undo bugs
more error details
better unicode mode (ufind function needed)
customizable "insert"/autocomplete function
customizable syntax highlighting
unlimited code length (It's currently limited by the maximum length of saveable strings (65528 chars))
advanced lua&api guide
empty tns/script loader (in search of better name :P )
autosave (on.save,on.destroy,run)

As always, please report any bugs you find! ;)

24
Community Contests / Re: Code Golf Contest #4
« on: August 11, 2014, 12:04:50 pm »
I got 93 by doing it char by char ^^
Not sure if I am after deadline though...

How? O.O
Well I was too late... Anyways, heres my code:
Code: [Select]
n=0
function on.charIn(c)n=n+(tonumber(c)and-c or c:byte())..""print((n:gsub(".","%1\n")))end

25
Community Contests / Re: Code Golf Contest #4
« on: August 11, 2014, 07:29:50 am »
I got 93 by doing it char by char ^^
Not sure if I am after deadline though...

26
TI-Nspire / Re: [Lua] Worms Clone
« on: August 03, 2014, 07:16:23 pm »
occasionally parts of the screen go blank
I think this is a problem with the 3.6 emulator. I think setting EMULATOR=true in my code should fix it (only suggested when actually using it on the emulator!)


I believe I don't have many things to say about the code layout, at least from what I quickly saw it looks well indented and pretty clear to read (classes and good (enough) seperation from code and paint :) )
Thanks, I think I'm getting better with object-oriented programming. Although other parts of the code are very bad (intro is completely hardcoded :P)


What editor did you use, btw ?
I still use the Student Software Editor          *Jens runs

(I may have a few optimizations, for example, you already make good things, like localizing things etc., but here is a mistake :
Code: [Select]
function Player:tick(del)
    local floor,abs=math.floor,math.abs
...
The point of localizing the math functions is to not having Lua access the math table. Here it's still being accessed at each tick :P You could simply put the local out of the function :)
Sure, what you do is already better than nothing since the local version will be used for the loops calculations, but anyway, let's go all the way :D
(and localize every math functions you use, btw, it can't be bad.)
I understand, but wouldn't those variables be localized on a lower level, so that everytime when I call them on a higher level,  they have to be loaded into the ligher level which takes time? Or do the different levels make no difference? What about just writing
Code: [Select]
local math=math at the beginning of the script, would then all math functions be as fast accessible as if I localize them individually?
And btw. I noticed that the localizing itself takes time, so if you call a math function only once, it seems be faster not to localize it.

Also, I see you declare functions within the paint function... why ? I suppose you can just put them somewhere else (and add parameters if needed), so they just get defined once, that'll speed things up.

I was just lazy here ^^ I'll change that!

But thanks for looking through the code and giving useful advices! :)  I still have much to learn!

27
TI-Nspire / [Lua] Worms Clone
« on: August 03, 2014, 02:48:49 pm »
Why no script editor update lately? Because I'm also working on a new project: A Worms clone for the Nspire!
The game is far from finished but the attached little tech-demo is already playable: Me and some friends successfully wasted some of the last lessons before holidays blowing each other up  ;)
Because of minimalistic frame updates it runs increadibly fast and smooth even on calc!
It also has a completely overdone intro animation!

But as said, this is a very early tech-demo lacking all the fancy weapons and other features like wind, custom spawn points, heal- and weapon boxes etc.; right now there are only 3 maps, a bazooka-like weapon and (sometimes wacky) character physics.

Read the "Help" page for controls!

28
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: July 22, 2014, 09:38:01 am »
The 'fixed' file when launched has the following error: "40: attempt to call global 'getTableAsStrings' (a nil value)".


Ok, fixed. NOW it should work...  ::)

29
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: July 21, 2014, 12:05:50 pm »
What's the problem? Does it not open, does it crash or does the menu not work?

It seems you added JSE 2.0A4 3.1 but neither does it works. When I try to open it, the OS says the device has to be updated to open it.
Indeed, I had a problem registering my platform.withGC fallback function on apilevel="1.0", so I just disabled it and forgot to reenable it later, sorry!
Download the OS 3.1 version again to get the fixed file!
Thanks for the report!

Why does the unicode involve such performance issues?
Splitting a string in its characters and mind UTF-8 encoded unicode characters is a bit difficult. The Nspire API offers a special string.usub function for that, but it's slower than the normal string.sub function. Now after much optimizing, this wouldn't have a big impact anymore; I could switch it back, but there is  another problem: Most functions of the string library doesn't have a unicode equivalent, so I have to use the normal ascii-only functions. Using unicode characters at rendering, but using ascii-functions for editing leads to confusion results: I had this setup for v1.0 and there you can see offset cursor positions other weird behaviours when using unicode characters.

30
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: July 20, 2014, 09:45:19 am »
On JSE 2.0A3 3.1, the multi-lines commentaries don't work:
Code: [Select]
--[[
A commentary
on several lines.
]]
It works, but the editor doesn't mark it correctly.

JSE 2.0A4 doesn't work on 3.1.
What's the problem? Does it not open, does it crash or does the menu not work?

It would be great to enable thanks to ndless to create a real Lua application with this program, like this editor is one.
I don't have ndless installed and I don't want to install it. But it's even possible with lua: A file where you can paste your code in and from then on it directly executes it everytime you open the file. It would handle exactly like a normal program with the given code. The only difference would be, that the file has a small script included, which loads the code from the memory.

EDIT: Special characters like "é", "è" and "à" don't work.
Yes, I switched back from rendering unicode characters to only ascii characters because of performance issues. Although they look strange in the editor, lua still handles them correctly.

Pages: 1 [2] 3 4 ... 13