Last Updated: July 23rd, 2002
[mad]
archive="game.mad"
width=320
height=240
safevideo=1
window=1
variablename = 0local variablenametable = {} 
 --tell lua that this is a table
table.name = 0
--here name is a local variable in the table 'table'x, y = player_x, player_yif (variable==1) then
   variable=2 
 elseif (variable==2) then 
    variable=1 
 else 
   variable=1
 end while (variable < 50) do 
   variable = variable + 1 
 end 
variable < 50" and the code to be executed is variable = variable + 1.
Assuming that 'variable' has been initialized to 0, this loop will execute the code 50 times until it stops.
variable = GetKeyState(KEY_A)variable = GetKey()variable = GetKeyWait()
   mousex = GetMouseX()
   mousey = GetMouseY()
   isleftbuttondown = GetMouseBtn(1)
   if (isleftbuttondown) then
     -- yes, the left mouse button is down
   end
   SetMasterVolume(digital, midi, mp3)
   chirp = NewSound()
   chirp:LoadWav("chirp.wav")
    -- or for MP3's use chirp:LoadMp3("chirp.mp3")
    -- or for Streaming Mp3's use chirp:LoadMp3Stream("chirp.mp3")
   chirp:Play(0)
   DeleteSound("chirp")
   theme = NewMusic()
   theme:LoadMidi("theme.mid")
    -- or for MP3's use theme:LoadMp3("theme.mp3")
    -- or for Streaming Mp3's use theme:LoadMp3Stream("theme.mp3")
   theme:Play(0)
   DeleteMusic("theme")
SetSceneArchive(filename)
SetObjectArchive(filename)
SetGUIArchive(filename)
SetMusicArchive(filename)
SetSoundArchive(filename)
   FPS = 1000 / ( 10ms * speed )
   scenename = NewScene()
   scenename:SetScript("scenename.lua")
   scenename:Load("scenename.scn")
   scenename:Run()
   scenename:SetFilename("scenename.scn")
   value = scenename:GetWascValue(x,y)
   x,y = scenename:GetWalkablePosition()
   scenename:Load()
   scenename:Load()
   scenename:Unload()
   ret = scenename:IsLoaded()
   hero = NewObj()
   hero:LoadAnimation("hero.anm", "southstill", 0)
   hero:SetScene(albion_s5, 100, 200)
   hero:SetSize(48, 64)
   hero:SetSpeed(3, 1)
   hero:SetFlags(OBJFLAG_ISCHARACTER + OBJFLAG_ISEGO + OBJFLAG_8WAYANIM)
   hero:Show()
   function f_hero_look()
      MsgBox("Looks like a hero!")
   end
   
   hero:BindAction(OBJACTION_LOOK, "f_hero_look")
BindDefaultAction(OBJACTION_*,"function")
| Sub-Anim Number | Graphic's Description | 
| 0 | background texture for the windows | 
| 1 | top window border | 
| 2 | bottom window border | 
| 3 | left window border | 
| 4 | right window border | 
| 5 | top-left window corner | 
| 6 | top-right window corner | 
| 7 | bottom-left window corner | 
| 8 | bottom-right window corner | 
heroinfo = {name = "unknown hero", class = "fighter", hp=150, mhp=150, mp=0,
str=50, int=10, agi=10, luck=10, gold=10, silver=10 }