read-eval-print

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
Forum rules
This is a sub-forum for things specific to MicroMacro.

This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Post Reply
Message
Author
runus
Posts: 4
Joined: Wed Sep 09, 2009 1:15 pm

read-eval-print

#1 Post by runus » Tue Sep 15, 2009 6:29 am

Hello,

in real life I do programm Python. I especially enjoy that interactive console there, which allows me to easily check the effects of singular commands.

is there something similiar to MicroMacro / LUA ?

That is, instead of script/myscriptname.lua I want to be able to enter

printf ("Hello there %s", 200)

and get Hello there 200...

(and later on import singular classes files like rom/classes/player.lua, instantiate my player class and try RomScript("whatever") on the console.

Best wishes,

R.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: read-eval-print

#2 Post by Administrator » Tue Sep 15, 2009 6:46 am

If you're looking at programming in just Lua, you can download luac Windows binaries from LuaForge. If you are using a different platform, you should compile it yourself (it's very easy under Unix-like OSs!). luac is the basic Lua compiler/interpreter that comes with the Lua library source, so you need to specify to build that extra (read the documentation on this).

If you want to take advantage of MicroMacro functions as well, you can still do that, too. In the 1.0 betas, you can use the 'exec' command by typing in this:

Code: Select all

exec printf("Hello %s\n", "World!");
The only real drawback is you need to keep typing 'exec' in before each line you want to run.

User avatar
Sirmabus
Posts: 7
Joined: Mon Sep 08, 2008 10:07 am

Re: read-eval-print

#3 Post by Sirmabus » Fri Sep 18, 2009 7:45 am

Make a script, you can call it "toconsole.lua" or something, with this single line:

Code: Select all

debug.debug()
And run that to put yourself at an interactive console.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests