Ummm... That's not a runtime.... I mean, it's 400 lines of code that does nothing, no offense. But heres what i did to it, you can look continue working on it to make it better.
REM Project: TAC Engine
REM Created: 8/11/2006 2:18:02 AM
REM
REM ***** Main Source File *****
REM
`Allow files to be opened through Windows!!!
extern$=cl$()
msgbox extern$,0,0
if file exist(extern$)=0
msgbox "ERROR! Can not load file '"+extern$+"'..."+chr$(13)+"Try reinstalling the program.",3,0
`exit prompt "ERROR","There was an error openning a file."
end
endif
dim State(150) : `Checks the state (It acts as an in-game variable
dim Level(100) : `There are 100 levels
dim Area(800) : `There are 800 available areas within the levels
open to read 1,extern$
repeat
`Set up all the keywords
KW_PRINT$="print"
KW_INPUT$="input"
KW_LOADSOUND$="loadsound"
KW_PLAYSOUND$="playsound"
KW_SETDEPTH$="setdepth"
KW_COLRED$="set color to red"
KW_COLGRN$="set color to green"
KW_COLBLU$="set color to blue"
KW_COLYLW$="set color to yellow"
KW_COLCYN$="set color to cyan"
KW_COLVLT$="set color to purple"
KW_COLMNO$="set color to mono"
KW_CLS$="cls"
KW_PAUSE$="pause"
KW_CHECKSTATE$="state->event"
KW_SETSTATE$="state->set"
KW_SETROOM$="room->set->area"
KW_SETLEVEL$="room->set->level"
KW_SETROOMCAPTION$="room->set->caption"
KW_CHECKROOM$="room->event->level"
KW_CHECKAREA$="room->event->area"
KW_EXECSCRIPT$="exec"
`Read from the file, and then make the reads case-sensitive
read string 1,normal$
cmd$=lower$(normal$)
`Check for keywords
gosub _CheckEvents
until file end(1)=1
close file 1
ink rgb(255,255,255),0
print "dbuser2006+'s code here! Enjoy it!"
print "Press any key to continue..."
end
_CheckEvents:
`Check if it is time to display text to the screen
if left$(cmd$,len(KW_PRINT$))=KW_PRINT$
print right$(normal$,len(normal$)-(len(KW_PRINT$)+1))
endif
`Check if it is time to ask the player for input
if left$(cmd$,len(KW_INPUT$))=KW_INPUT$
input right$(normal$,len(normal$)-(len(KW_INPUT$)+1)),playerinput$
endif
`Check if the screen needs to be cleared
if cmd$=KW_CLS$ then cls
`Check if the brightness value needs to be changed
if left$(cmd$,len(KW_SETDEPTH$))=KW_SETDEPTH$
dep$=right$(normal$,len(normal$)-(len(KW_SETDEPTH$)+1))
dep=val(dep$)
if dep<1 then dep=1
if dep>255 then dep=255
endif
`Check if a color needs to be set (Based on a brightness value)
if cmd$=KW_COLRED$ then ink rgb(dep,0,0),0
if cmd$=KW_COLGRN$ then ink rgb(0,dep,0),0
if cmd$=KW_COLBLU$ then ink rgb(0,0,dep),0
if cmd$=KW_COLYLW$ then ink rgb(dep,dep,0),0
if cmd$=KW_COLCYN$ then ink rgb(0,dep,dep),0
if cmd$=KW_COLCYN$ then ink rgb(dep,0,dep),0
if cmd$=KW_COLMNO$ then ink rgb(dep,dep,dep),0
`Check if it is time to end the software
if cmd$=KW_END$ then end
`Check if the game has been paused
if cmd$=KW_PAUSE$
get image 1,0,0,screen width(),screen height(),1
center text screen width()/2,(screen height()/2)-10,"PAUSED"
suspend for key
paste image 1,0,0
endif
`Set a state that the user demands
if cmd$=KW_SETSTATE$
CurrentStateRead=val(right$(normal$,len(normal$)-(len(KW_SETSTATE$)+1)))
if CurrentStateRead<0 then CurrentStateRead=0
if CurrentStateRead>149 then CurrentStateRead=149
endif
`Check if a script is executed
if left$(cmd$,len(KW_EXECSCRIPT$))=KW_EXECSCRIPT$
close file 1
script$=right$(normal$,len(normal$)-(len(KW_EXECSCRIPT$)+1))
if file exist(script$)=1
open to read 1,script$
else
ink rgb(0,0,0),rgb(255,255,255)
set text opaque
print "There was an error reading from the script!"
print "The program will now end..."
print ""
print "Press any key to terminate..."
suspend for key
end
endif
endif
return
You will need to add in the if statements.