How to Create a Database in Else Heart.Break()

Create a simple makeshift database with all type of items including rooms. Add custom types to keep track of, like bank accounts, tasks etc.

Application of Code

To speed up the process its best to adjust the computers speed. You also need the database computer with the ability to run infinitely. Use a screwdriver with the Screwdriver Code to adjust the database computer (which ever one you used with the memory API) and adjust the workstation computer in the Police Station that has the GetAllRooms function, which is the one with the yellow screen. The computer in the corner of the Police Station with the red screen has the memory API so that’s a good computer to choose but doesn’t have to be that one, its just convenient.

Now that both computers have been adjusted, hack the database computer (the one with memory API or save/load memory functions). Take the Database Code from this guide and apply it to the computer. Compile the code and close. You should see the code start to run on screen.

Hack the yellow screened workstation and apply the Workstation Code to the workstation.

Right now there’s a simple demonstration, still building up on it to create a menu with options to slurp, relocate and parse coordinates.

Hit enter with no input will scroll through the lists.

Screwdriver Code

SetMhz(500)
SetMaxTime(-2)

Database Code

##############################################
#            Main Custom Functions
#---------------------------------------------
#array GetItems(string type)
#array GetTypes()
#bool Save(string type,string name)    
##############################################

#Helfer - For initial database setup Auto'd by Save()    
void createTypes()
    bool test = HasMemory('Types')
    
    Wenn !test
        SaveMemory('Types',0)    
    end
end

#Helper - Test blank input
bool inputBlank(var test)
    if test == ""
        return True
    else
        return False
    end
end

#Helper - Check if database information has been imported
void Setup()
    bool testDB = HasMemory('Database')
    Wenn !testDB
        ClearText()
        Drucken("Database has not been built")
        Drucken("Running now...")
        Schlafen(4)
        BuildDatabase()
    end
end

#Saves items to database
bool Save(string type,string name)

    bool test = HasMemory(Typ)
    number qty
    number typesQty
    bool testTypes = HasMemory('Types')
    
    if inputBlank(Typ)
        return false
    end
    
    if inputBlank(Name)
        return false
    end
    
    if testTypes
        
    else
        createTypes()
    end
    
if test
    qty = LoadMemory(Typ)
    qty++
    SaveMemory(Typ,qty)
else
    typesQty = LoadMemory('Types')
    typesQty++
    SaveMemory('Types' + typesQty,Typ)
    SaveMemory('Types',typesQty)
    qty = 1
    SaveMemory(Typ,qty)
end

SaveMemory(Typ + qty,Name)
Drucken(Typ + qty)
return true
end

#testing input function
void fun()
    loop
        var typ = Input(':')
        
        if inputBlank(typ)
            return
        end
                
        if typ == 'exit'
            break
        end
            
        Save(typ,'name')
        Drucken(LoadMemory('Types') + ":Number of Types")
    end
end

#returns all types of items in database
array GetTypes()
   array build
    number cnt = 1
    string tem
        
    loop
        tem = 'Types' + cnt
       if HasMemory(tem)
           Append(bauen,LoadMemory(tem))
       else
           return build
       end
        
        cnt++
    end
        
end

#Returns all items of supplied type
array GetItems(string type)
    number cnt = 1
    array build
    string tem
        
    if inputBlank(Typ)
        return
    end    
        
    bool available = HasMemory(Typ)
    
    Wenn !available
        return
    end
    
    bool test
        
    loop
        tem = type + cnt
        test = HasMemory(tem)
        if test
            Append(bauen,LoadMemory(tem))
            cnt++
        else
            return build
        end
    end
end

#Helper - 
var PoliceAdmin()
    string computer = "PoliceOfficeInterior_MinistryOfficeWorkstationComputer_1"
    var con = Connect(Rechner)
    return con
end

#Helper - Builds database
void BuildDatabase()

        array items
        string type
        bool saved
        var con = PoliceAdmin()           
        array rooms = con.GetAllRooms()
        
        ClearMemories()
        ClearText()
        
    
        
        loop room in rooms
            type = "Zimmer"
            saved = Save(Typ,Zimmer)
            items = con.GetThingsInRoom(Zimmer)
            
            loop item in items
                type = con.GetTypeOfThing(Artikel)
                
                saved = Save(Typ,Artikel)
            end    
        end
        ClearText()
        SaveMemory('Database',1)
        Drucken("Database Information Imported")
end


#Helper - 
void bar()
    Drucken("--------------------")
end


#Helper - Show and Select from an array 
var Select(array arr)
    
    number track
    number select
    number incr


    loop
        track = 0
        select = 0
        incr = 0
        
        loop x from 0 to Count(arr) - 1
            track++
            incr++
            Print(incr + ":" + arr[x])

            if track == 5
                track = 0
                select = sel()
                ClearText()
                if select > -1
                    return arr[auswählen]
                else if select == -2
                    break
                end
            end
        end
    end

end


#Helper to select() - Determine if number and return
number sel()

	bool isNum
	string testNum

	loop
		isNum = true
		bar()
		testNum = Input(":>")

		if testNum == "0"
			isNum = false
		else if testNum == ""
			#Move Forward
			return -1
		else if testNum == " "
			#Move Back
			return -2
		else if testNum == "Speisekarte" or testNum == "Ausfahrt"
			#return to menu
			return -3
		end

		    loop testNum
			       if CharToInt(@) < -49 or CharToInt(@) > -40
				        isNum = false
				        break
    		    end
		    end

		    if isNum == true
		        	break
		    end

    
    end

    number num = testNum
    num--

    return num

end

##############################################

Aufstellen()

WorkStation Code

#Helfer - 
var PoliceMem()
    var con = Connect("PoliceOfficeInterior_TriPodComputer_TriPodComputer_1")
    return con
end

#Helper - 
void title(string title, number max)
    Drucken(max + ": " + Titel)
       Bar(2) 
end

void bar(number t)
    if t == 2
        Drucken("--------------------")
    else if t == 1
        Drucken("====================")
    end
end


#Helper - Show and Select from an array 
var Select(array arr)
    
    number track
    number select
    number incr


    loop
        track = 0
        select = 0
        incr = 0
        
        loop x from 0 to Count(arr) - 1
            track++
            incr++
            Print(incr + ":" + arr[x])

            if track == 5
                track = 0
                select = sel()
                ClearText()
                
                if select > -1
                    return arr[auswählen]
                else if select == -2
                    break
                end
                
            end
            
        end
        
    end

end


#Helper to select() - Determine if number and return 
# Old select function.. need to revise or replace
number sel()

	bool isNum
	string testNum

	loop
		isNum = true
		bar(1)
		testNum = Input(":>")

		#if testNum == "0"
		#	isNum = false
		if testNum == ""
			#Move Forward
			return -1
		else if testNum == " "
			#Move Back
			return -2
		else if testNum == "Speisekarte" or testNum == "Ausfahrt"
			#return to menu
			return -3
		end

		    loop testNum
			       if CharToInt(@) < -49 or CharToInt(@) > -40
				        isNum = false
				        break
    		    end
		    end

		    if isNum == true
		        	break
		    end

    
    end

    number num = testNum
    num--

    return num

end

# Old selectitem function.. need to revise or replace
string SelectItem()
    var con = PoliceMem()
    array types = con.GetTypes()
    string type = Select(Typen)
    array items = con.GetItems(Typ)
    string it = Select(Artikel)
    return it
end

#
void Position()
    string name = SelectItem()
    string target = "PoliceOfficeInterior_Diskette_Diskette6_1" 
    SetPosition(Name,Ziel)
Ende

#
string GetPName(string name)
    bool grab = false
    string Pname = GetPosition(Name)
    string get = ""
    loop Pname
        if @ == " "
            grab = true
        else if @ == ","
            break
        else if grab == true
            get += @
        end
    end
    return get
end

#
string GetPCoor(string name)
    bool grab = false
    string Pname = GetPosition(Name)
    string get
    
    loop Pname
        if @ == "("
            grab = true
        else if @ == ")"
            break
        else if grab == true
            get += @
        end
    end 
    return get
end

string NewSelection(array myarr,string titl)
    number count = Count(myarr)
    number cnt = 1
    number res
    
    loop
        ClearText()
        Titel(titl,count)
        Wenn (cnt + 4) < count loop x from cnt to (cnt +4) Drucken(x + ". " + myarr[x - 1]) end cnt += 5 else loop x from cnt to count Print(x + ". " + myarr[x - 1]) end cnt = 1 end res = sel() if res > -1
            return myarr[res]
        end
   end 
   
          
end


##############################################
#                PoliceMem
#---------------------------------------------
#array GetItems(string type)
#array GetTypes()
#bool Save(string type,string name)    
#
#GetMemories
#HasMemory()
#ClearMemories
#EraseMemory(
#SaveMemory(
#LoadMemory(
##############################################
#                  Workstation
#---------------------------------------------
#string GetPCoor(string name)
#string GetPName(string name)
#void Position() #Sets position of targets item    
#string SelectItem() #runs item selection process
#void title(string title, number max)
#
#GetPeople()
#GetThingsOfType()
#GetPosition()
#GetAction()
#GetRoom()
#GetThingsInRoom()
#GetAllRooms()
#GetTypeOfThing()
#InteractWith()
#IsKeyPressed()
#SetPosition()
##############################################
#                      Run Below
############################################## 

var con = PoliceMem()
string type = NewSelection(con.GetTypes(),'Types')
string item = NewSelection(con.GetItems(Typ),type+'s')
Dieser Leitfaden über Sonst Heart.Break() wurde geschrieben von KnustSinn. Von hier aus können Sie die Originalveröffentlichung besuchen Verknüpfung. Wenn Sie Bedenken bezüglich dieses Leitfadens haben, Bitte zögern Sie nicht, uns zu erreichen hier.

Über den Autor