Advertisement
Dekowta

Mock Lua Test

Jul 28th, 2012
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  1. i = 21
  2. f = 32.123
  3. b = true
  4. s = "Text\n"
  5.  
  6. table = {1002, 261, 87, 21}
  7.  
  8.  
  9. function InitaliseTest()
  10.     io.write("LUA SCRIPT: Initalise Test File \n");
  11.  
  12.     io.write("LUA SCRIPT: Printing variables\n")
  13.     io.write(string.format("LUA SCRIPT: i = %d\n", i))
  14.     io.write(string.format("LUA SCRIPT: f = %f\n", f))
  15.     io.write(string.format("LUA SCRIPT: b = %s\n", tostring(b)))
  16.     io.write(string.format("LUA SCRIPT: s = %s\n", s))
  17.  
  18.     io.write("LUA SCRIPT: Calling Test Function\n")
  19.     TestFunction(i, f, b, s)
  20.    
  21.     io.write(string.format("LUA SCRIPT: table: 1 = %s, 2 = %s, 3 = %s, 4 = %s\n", tostring(table[1]), tostring(table[2]), tostring(table[3]) , tostring(table[4])))
  22.    
  23.     io.write("LUA SCRIPT: Calling Test Table with table and return t\n")
  24.     t = TestTable(table)
  25.    
  26.     io.write(string.format("LUA SCRIPT: t:     1 = %s, 2 = %s, 3 = %s, 4 = %s\n", tostring(t[1]), tostring(t[2]), tostring(t[3]) , tostring(t[4])))
  27.    
  28.     io.write(string.format("LUA SCRIPT: Added Event Lua_Update = %d with %s\n", Events.Lua_Update.value, tostring(hello)))
  29.     AddEvent(Events.Lua_Update, hello);
  30. end
  31.  
  32. function main()
  33.     --[[TestFunction(i, f, b, s)]]--
  34. end
  35.  
  36. run = false;
  37.  
  38. function hello()
  39.     if run == false then
  40.         io.write("LUA SCRIPT: Hello World (function hello)\n")
  41.         run = true
  42.     end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement