
Changing The Output
#1
Posted 20 January 2013 - 03:22 PM
as a gag I would like to make my CP300 to print texts in response to calculations: so if I type for example "5+8"+EXE then the CP should not only give the correct result but also a comment (e.g. "That was easy!"). It would be great if this comment would be chosen by random from a list or so. Does anyone have an idea how this could be achieved? Many thanks in advance!
#2
Posted 20 January 2013 - 04:17 PM
What programming language are you planning on using for this?
#3
Posted 20 January 2013 - 05:02 PM
I don't have the slightest idea what programming language I ought to use for this problem - in any case I hoped that either everything needed to do this is already inside the CP (using its basic) or that there already exists an addin that would do something like the thing I thought of. Do you think it is actually possible to write such a program without having to delve into too deep depths of the system?
#4
Posted 20 January 2013 - 05:08 PM
I think you can get CPLua, and then from there it should be pretty straightforward.
Lua would let you store all your answers in a list, and then have one randomly extracted.
You may have to write your own UI, or maybe not, I'm not sure what the CPLua has in default libs as far as that goes. But it shouldn't be too difficult.
#5
Posted 20 January 2013 - 05:37 PM
#6
Posted 20 January 2013 - 06:48 PM

#8
Posted 23 January 2013 - 08:55 AM
#9
Posted 23 January 2013 - 05:43 PM
You are right learning Lua seems to be not too difficult. However: I don't have the slightest idea of how I could achieve what I had in mind. If every result from the CP is to be "commented on", so to speak, then I would have to make changes in the OS of the CP or would have to write a program that runs in the background of the CP that ckecks whether a calculation was made and then makes an additional output. Both seems very hard to me because the source code of the CP should be available (and I have to understand it!).
Ohhh, ok.
So you want to intercept the run-mat (is that what its called on classpad?) mode prompt. I thought you juust wanted to make a program that took user input and gave a result.
As far as I know, what you want to do is difficult without extensive os modding.
#10
Posted 23 January 2013 - 06:04 PM

#11
Posted 23 January 2013 - 06:07 PM

#12
Posted 24 January 2013 - 08:19 PM
To acomplish this task, if you want this to be done in Main (aka RunMat on fx), you really should make your alternative Main program from scratch; as the source code is not available and there isn't any mechanism to hook into its internals.
CPLua (http://community.cas...forum/61-cplua/) is the language you should use on ClassPad if you want to write any serious program for CP (because of fast execution, graphics, all good functions and classes, etc). With the current functionality level of CPLua, it is possible to write a Main-like add-in fully imitating its UI and functionality.
CPLua already exposes most UI, CAS and other functions of claspad to the user and can compete wiht the sdk. Actually CP sdk already has classes for programming most aspects of the ClassPad. So no need to syscalls and other difficulties as in the fx series.
Altough you mentioned your idea as a "gag", this has been discussed before, for "serious"

#13
Posted 24 January 2013 - 08:32 PM
Why did you know SimonLothar? He's at the German forum, and not here.Yeah, but it would take even they a long time to figure out how to intercept the OS prompt. SimonLothar was only just recently able to figure out how to do a complete syscall based input line.
#14
Posted 24 January 2013 - 08:38 PM
Why did you know SimonLothar? He's at the German forum, and not here.
Actually, he's all over the place, but he doesn't seem to be very active anywhere except the german forums. He is on cassiopeia occasionally though.

#15
Posted 25 January 2013 - 06:47 AM

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users