Jump to content



Photo

My Lua Programs


  • Please log in to reply
7 replies to this topic

#1 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 08 April 2006 - 10:29 AM

As everyone asked for a "My Lua Programs" that would allow to run Lua programs, I created it. :) I used a screenshot of MyPrograms, so that it would be very similar to MyPrograms. Here is the result:

Posted Image

The scrollbar and the buttons work exactly like in C++, and this doesn't slow the programs. The only problem is that New and Settings use the Console window :( as Orwell didn't make the "ui" package yet, and I made no file name verification, so this can raise errors. Anyway, I'm rather satisfied of my work. :rolleyes:

Download My Lua Programs 0.30 Beta


EDIT:
Normally, in "Settings", if you leave a field empty, it uses the old value. But Orwell modified the input() function in CPLua 0.8 RC4, so that you must enter something (I modified the program. Now you have to enter 0 to use old or default values). Can you add a parameter which allows to enter nothing?


Oops, I forgot to put the "readme" file in the .rar. :blush: I'll add it later ;)

How to use MyLuaPrograms?

-Run MyLuaPrg\MyLuaPrg with CPLua (version 0.8RC3 or higher)

-Create a new shortcut by clicking on the "New" button:
  -Enter the name of the shortcut, its target folder, its target file and its icon file
  -If you enter 0 for the icon, a default icon will be used
  -An icon is a 45*28 PICT file. You can use the "main\icon" picture to make your own icon
  -The icon is saved in the "MyLuaPrg\shortcut" file, so you can delete your icon file after creating the shortcut

-Modify a shortcut by clicking on the "Settings" button
  -Select the shortcut you want to modify (notice that you can't use the scrollbar, but this will be implemented in future releases;) ):
  -Enter the information for the shortcut, like in "New"
  -If you enter 0 in a field, the old value will be used

-Delete a shortcut by clicking on the "Delete" button. Select the shortcut you want to delete

-Move a shortcut by clicking on the "Move" button. Select the shortcut you want to move, and the location you want to move it

-Quit by clicking on "My Lua Programs"

/!\ If you quit using "Break", the shortcuts newly created will be lost
/!\ Don't delete "font", "cpfont" and "mlpRsrc". These are resource files used by My Lua Programs
/!\ There is no name verification. So if a file name is invalid, the program will raise an error and the data will be lost. In some cases, the program can detect a bad target file. So the shortcut will be created but you can't run it.

-All shortcut data is stored in the "MyLuaPrg\shortcut" file.


Changes in future versions:

+ Maybe a clock instead of the "My Lua Program" title
+ Create or modify a shortcut in a dialog box, like MyPrograms
+ Organize shortcuts in different categories (Games, Tools, Math, ...)

I'm waiting for the "ui" package (maybe in CPLua 0.9) to perform all these changes.


Have fun! :)


#2 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 08 April 2006 - 10:50 AM

Nice work! :D

Some comments about your post:

and I made no file name verification

There is now a function io.check() to check if a name is valid. You may also use file:exists() to ensure that the file really exists ;)

Can you add a parameter which allows to enter nothing?

Hmm, the problem is that there already is an optional parameter :P Maybe I will allow something like input("", 0) to accept null input :rolleyes:

So if a file name is invalid, the program will raise an error and the data will be lost.

You should consider using pcall() or xpcall() :) These functions can run another function (like doscript()) in protected mode, to catch their possible errors; so it won't break your program ^_^
Edit: Wah! i just found a fatal exception error <_< Let me fix this first...
Edit2: Done. :)

Maybe a clock instead of the "My Lua Program" title
It is already possible with gettime() :P It would be less easy (perhaps even impossible) with th "ui" package however :(

#3 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 08 April 2006 - 11:56 AM

Edit: Wah! i just found a fatal exception error <_< Let me fix this first...


In CPLua or in My Lua Programs? :huh:

Thanks for pcall() and xpcall(). I completely forgot them. :blush:

I've just make a program that dumps all the name of the tables and functions in the environment. It could be useful if I forget some functions :) It simply uses table.foreach. If someone find this useful I will upload it.

#4 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 08 April 2006 - 09:35 PM

OK, I've just finished the dialog box for "New" and "Edit" :D But, as making combo boxes is very hard, I made simple spin buttons to select the file and folder name. I should finish the implementation tomorrow. :)

#5 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 09 April 2006 - 01:39 PM

No comments? :(

#6 omegavirus

omegavirus

    Casio Freak

  • Members
  • PipPipPipPip
  • 150 posts
  • Gender:Male
  • Location:Morelia, M?xico

  • Calculators:
    ClassPad 300

Posted 10 April 2006 - 01:13 AM

I like My Lua Programs it realy helps to locate your programs very fast :nod:

by the way tilt maze is still in development? i used and i did not find any bug, i hope the CAPS team finish the editor as fast as you can :)

#7 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 10 April 2006 - 06:57 PM

??? Where did you find TiltMaze? I made it, but I never released it! :huh: The C++ program you found on the French was just a test, I'll release the Lua program soon ;)

#8 Tchernoben

Tchernoben

    Casio Fan

  • Members
  • PipPip
  • 42 posts
  • Location:Nice
  • Interests:Calculators, Pc, mangas, warhammer.

  • Calculators:
    Classpad 300
    Ti 89 Titanium

Posted 10 April 2006 - 06:59 PM

It would be great to integrate such usefull tool into CPLua :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users