Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/script_engine/src/lib/script_engine/luascript1.lua @ 7657

Last change on this file since 7657 was 7656, checked in by bensch, 18 years ago

lua-scripts added (this is temporary)

File size: 867 bytes
Line 
1
2-- Tests the parameter passing, using and returning
3function this.divideMe (this, count)
4   trace ("In divideMe...");
5   return count / 30
6end
7
8-- Tests lua calling lua functions
9function this.luaCallMe ()
10   trace( "luaCallMe" )
11end
12
13-- Tests lua calling lua functions
14function object.luaCallMe ()
15   trace( "luaCallMe" )
16end
17
18function this.luaCallMeToo (this)
19   this:hello1 ()
20end
21
22-- Main test routing
23function this.CountAndCall (this, i)
24   --this:luaCallMe ()
25   --this:luaCallMeToo ()
26   object:printNameTwo ()
27   object:printHello ()
28
29   --trace ("CountAndCall")
30
31   while  (i <= 4) do
32     -- this:hello1 ()
33      --this:hello2 (i,i*2)
34      i = i+1
35   end
36
37  -- trace ("Hello, debug world!")
38end
39
40-- Tests the C-Api returning values to lua
41function this.returnToMe (this, i)
42   trace ("returnToMe")
43   x = this:hello3 (i)
44   io.write ("returnToMe ", x)
45end
Note: See TracBrowser for help on using the repository browser.