Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Tarkov-Discord-Chatbot/ScavBosses.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
50 lines (37 sloc)
1.54 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
def DisplayDatabase(filename): | |
connection = sqlite3.connect(filename) | |
mycursor = connection.cursor() | |
filedata = mycursor.execute("SELECT * FROM scavbosses") | |
tablecontent = filedata.fetchall() | |
for i in range(len(tablecontent)): | |
print(tablecontent[i]) | |
connection.commit() | |
connection.close() | |
def Createtable(filename): | |
cnn = sqlite3.connect(filename) | |
mycursor = cnn.cursor() | |
# create table | |
sql_new_table = ("""CREATE TABLE scavbosses | |
(Name text, | |
NumberOfMinions text, | |
Armour, | |
Weapon TEXT, | |
LootableItems TEXT)""") | |
mycursor.execute(sql_new_table) | |
cnn.commit() | |
mycursor.close() | |
def AddRow(filename): | |
cnn = sqlite3.connect(filename) | |
mycursor = cnn.cursor() | |
# create table | |
#mycursor.execute("""INSERT INTO scavbosses VALUES ('Killa','0', '6b13 assult', '5.45 Rpk', 'Red Card')""") | |
#mycursor.execute("""INSERT INTO scavbosses VALUES ('Glukhar','6', 'taktical tv armoured rig', 'ASh-12 12.7x55 assault rifle', 'Red Card')""") | |
#mycursor.execute("""INSERT INTO scavbosses VALUES ('Sanitar','2', 'None', 'OP-SKS, VSS', 'blue key card')""") | |
#mycursor.execute("""INSERT INTO scavbosses VALUES ('Shturman','2', 'None', 'AK-105 5.45x39','blue key card')""") | |
#mycursor.execute("""INSERT INTO scavbosses VALUES ('Reshala','4', 'None', 'AK-101 5.56x45','Golden TT')""") | |
cnn.commit() | |
mycursor.close() | |
#Createtable("scavbosses.db") | |
#DisplayDatabase("scavbosses.db") | |
#AddRow("scavbosses.db") |