Come creare un database in Else Heart.Break()

Crea un semplice database improvvisato con tutti i tipi di elementi, comprese le stanze. Aggiungi tipi personalizzati di cui tenere traccia, come i conti bancari, compiti ecc.

Applicazione del Codice

Per accelerare il processo è meglio regolare la velocità del computer. È inoltre necessario un computer con database in grado di funzionare all'infinito. Utilizzare un cacciavite con il codice cacciavite per regolare il computer del database (quale hai utilizzato con l'API di memoria) e regolare il computer della stazione di polizia che ha la funzione GetAllRooms, che è quello con lo schermo giallo. Il computer nell'angolo della stazione di polizia con lo schermo rosso ha l'API di memoria, quindi è un buon computer da scegliere ma non deve essere necessariamente quello, è semplicemente conveniente.

Ora che entrambi i computer sono stati modificati, hackerare il computer del database (quello con API di memoria o funzioni di salvataggio/caricamento della memoria). Prendi il codice del database da questa guida e applicalo al computer. Compila il codice e chiudi. Dovresti vedere il codice iniziare a essere eseguito sullo schermo.

Hackera la workstation con lo schermo giallo e applica il codice della workstation alla workstation.

In questo momento c'è una semplice dimostrazione, ci sto ancora lavorando per creare un menu con opzioni da bere, riposizionare e analizzare le coordinate.

Premi Invio senza alcun input per scorrere gli elenchi.

Codice cacciavite

ImpostaMhz(500)
SetMaxTime(-2)

Codice della banca dati

##############################################
#            Principali funzioni personalizzate
#---------------------------------------------
#matrice GetItems(tipo di stringa)
#matrice GetTypes()
#bool Salva(tipo di stringa,nome della stringa)    
##############################################

#Aiutante - Per la configurazione iniziale del database, eseguita automaticamente dal salvataggio()    
void createTypes()
    test bool = HasMemory('Tipi')
    
    Se !test
        SaveMemory('Tipi',0)    
    end
end

#Helper - Test blank input
bool inputBlank(era una prova)
    se prova == ""
        return True
    else
        return False
    end
end

#Helper - Check if database information has been imported
void Setup()
    bool testDB = HasMemory('Banca dati')
    Se !testDB
        ClearText()
        Stampa("Il database non è stato creato")
        Stampa("In esecuzione adesso...")
        Sonno(4)
        CostruisciDatabase()
    end
end

#Saves items to database
bool Save(tipo di stringa,nome della stringa)

    test bool = HasMemory(genere)
    number qty
    number typesQty
    bool testTypes = HasMemory('Tipi')
    
    se inputBlank(genere)
        return false
    end
    
    if inputBlank(nome)
        return false
    end
    
    if testTypes
        
    else
        createTypes()
    end
    
if test
    qty = LoadMemory(genere)
    qty++
    SaveMemory(genere,quantità)
else
    typesQty = LoadMemory('Tipi')
    typesQty++
    SaveMemory('Tipi' + tipiQtà,genere)
    Salva memoria('Tipi',tipiQtà)
    quantità = 1
    Salva memoria(genere,quantità)
end

SaveMemory(genere + quantità,nome)
Stampa(genere + quantità)
return true
end

#testing input function
void fun()
    loop
        var typ = Input(':')
        
        se inputBlank(tip)
            return
        end
                
        if typ == 'exit'
            break
        end
            
        Save(tip,'nome')
        Stampa(Carica memoria('Tipi') + ":Numero di tipi")
    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)
           Aggiungere(costruire,Carica memoria(tem))
       else
           return build
       end
        
        cnt++
    end
        
end

#Returns all items of supplied type
array GetItems(tipo di stringa)
    numero cnt = 1
    array build
    string tem
        
    if inputBlank(genere)
        return
    end    
        
    bool available = HasMemory(genere)
    
    Se !available
        return
    end
    
    bool test
        
    loop
        tem = type + cnt
        test = HasMemory(tem)
        if test
            Append(costruire,Carica memoria(tem))
            cnt++
        else
            return build
        end
    end
end

#Helper - 
era amministratore della polizia()
    stringa computer = "PoliceOfficeInterior_MinistryOfficeWorkstationComputer_1"
    var con = Connetti(computer)
    return con
end

#Helper - Builds database
void BuildDatabase()

        array items
        string type
        bool saved
        var con = PoliceAdmin()           
        stanze dell'array = con.GetAllRooms()
        
        Cancella ricordi()
        Testo chiaro()
        
    
        
        loop room in rooms
            type = "camera"
            salvato = Salva(genere,camera)
            elementi = con.GetThingsInRoom(camera)
            
            loop item in items
                type = con.GetTypeOfThing(elemento)
                
                salvato = Salva(genere,elemento)
            end    
        end
        ClearText()
        Salva memoria('Banca dati',1)
        Stampa("Informazioni sul database importate")
end


#Helper - 
barra del vuoto()
    Stampa("--------------------")
end


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


    loop
        track = 0
        seleziona = 0
        incremento = 0
        
        loop x da 0 contare(arr) - 1
            track++
            incr++
            Print(increm + ":" + arr[X])

            se traccia == 5
                traccia = 0
                seleziona = sel()
                Testo chiaro()
                se selezionato > -1
                    ritorno arr[Selezionare]
                altrimenti se seleziona == -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 = Ingresso(":>")

		se Numtest == "0"
			isNum = false
		else if testNum == ""
			#Move Forward
			return -1
		altrimenti se testNum == " "
			#Move Back
			return -2
		altrimenti se testNum == "menù" o testNum == "Uscita"
			#return to menu
			return -3
		end

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

		    if isNum == true
		        	break
		    end

    
    end

    number num = testNum
    num--

    return num

end

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

Impostare()

Codice della stazione di lavoro

#Aiutante - 
era PoliceMem()
    var con = Connetti("PoliceOfficeInterior_TriPodComputer_TriPodComputer_1")
    return con
end

#Helper - 
titolo nullo(titolo della stringa, numero massimo)
    Stampa(max + ": " + titolo)
       sbarra(2) 
end

void bar(numero t)
    se t == 2
        Stampa("--------------------")
    altrimenti se t == 1
        Stampa("====================")
    end
end


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


    loop
        track = 0
        seleziona = 0
        incremento = 0
        
        loop x da 0 contare(arr) - 1
            track++
            incr++
            Print(increm + ":" + arr[X])

            se traccia == 5
                traccia = 0
                seleziona = sel()
                Testo chiaro()
                
                se selezionato > -1
                    ritorno arr[Selezionare]
                altrimenti se seleziona == -2
                    break
                end
                
            end
            
        end
        
    end

end


#Helper to select() - Determina se numero e restituisci 
# Vecchia funzione di selezione.. need to revise or replace
number sel()

	bool isNum
	string testNum

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

		#se Numtest == "0"
		#	isNum = false
		if testNum == ""
			#Move Forward
			return -1
		altrimenti se testNum == " "
			#Move Back
			return -2
		altrimenti se testNum == "menù" o testNum == "Uscita"
			#return to menu
			return -3
		end

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

		    if isNum == true
		        	break
		    end

    
    end

    number num = testNum
    num--

    return num

end

# Vecchia funzione di selezione dell'elemento.. need to revise or replace
string SelectItem()
    var con = PoliceMem()
    tipi di array = con.GetTypes()
    tipo stringa = Seleziona(tipi)
    elementi dell'array = con.GetItems(genere)
    stringalo = Seleziona(Oggetti)
    return it
end

#
Posizione nulla()
    nome stringa = SelectItem()
    destinazione stringa = "PoliceOfficeInterior_Diskette_Diskette6_1" 
    Imposta posizione(nome,bersaglio)
FINE

#
stringa GetPName(nome della stringa)
    bool grab = false
    string Pname = GetPosition(nome)
    stringa ottieni = ""
    loop Pname
        if @ == " "
            grab = true
        else if @ == ","
            break
        else if grab == true
            get += @
        end
    end
    return get
end

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

string NewSelection(array myarr,titolo della stringa)
    conteggio dei numeri = conteggio(mirra)
    numero cnt = 1
    number res
    
    loop
        ClearText()
        titolo(titolo,contare)
        Se (cnt + 4) < contare il ciclo x da cnt a (cnt +4) Stampa(X + ". " + mirra[X - 1]) fine cnt += 5 altrimenti esegue il ciclo di x da cnt a count Stampa(X + ". " + mirra[X - 1]) fine cnt = 1 fine res = sel() se ris > -1
            ritorna myarr[ris]
        end
   end 
   
          
end


##############################################
#                PoliceMem
#---------------------------------------------
#matrice GetItems(tipo di stringa)
#matrice GetTypes()
#bool Salva(tipo di stringa,nome della stringa)    
#
#GetMemories
#HasMemory()
#ClearMemories
#EraseMemory(
#Salva memoria(
#Carica memoria(
##############################################
#                  Stazione di lavoro
#---------------------------------------------
#stringa GetPCoor(nome della stringa)
#stringa GetPName(nome della stringa)
#Posizione nulla() #Sets position of targets item    
#string SelectItem() #runs item selection process
#void title(titolo della stringa, numero massimo)
#
#Ottieni persone()
#OttieniCoseOfType()
#OttieniPosizione()
#OttieniAzione()
#GetRoom()
#Ottieni cose in camera()
#Ottieni tutte le stanze()
#Ottienitipodicosa()
#Interagire con()
#È il tasto premuto()
#Imposta posizione()
##############################################
#                      Corri sotto
############################################## 

var con = PoliceMem()
tipo stringa = NuovaSelezione(con.GetTypes(),'Tipi')
elemento stringa = Nuova selezione(con.GetItems(genere),digitare+')
Questa guida su Altro Heart.Break() è stato scritto da Mente spezzata. Puoi visitare la pubblicazione originale da questo collegamento. In caso di dubbi su questa guida, per favore non esitate a contattarci qui.

Circa l'autore