From 3464d64107ae4a20fe81144ad45599324da40b68 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 19:14:13 -0600 Subject: [PATCH 01/50] Create find-strat.node.js A nodeJS file that will use SQLite to find strats stored in a database. --- find-strat.node.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 find-strat.node.js diff --git a/find-strat.node.js b/find-strat.node.js new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/find-strat.node.js @@ -0,0 +1 @@ + From a4098bf0d40fbca62b4be7d574dd346d53486733 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 19:18:13 -0600 Subject: [PATCH 02/50] Create strats.csv --- data/strats.csv | 1 + 1 file changed, 1 insertion(+) create mode 100644 data/strats.csv diff --git a/data/strats.csv b/data/strats.csv new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/data/strats.csv @@ -0,0 +1 @@ + From c0d10caba4691acbaea3e22c55d3441a55ed9086 Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 19:21:18 -0600 Subject: [PATCH 03/50] Update strats.csv --- data/strats.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/strats.csv b/data/strats.csv index 8b13789..cdddade 100644 --- a/data/strats.csv +++ b/data/strats.csv @@ -1 +1,2 @@ - +1,Test +2,test From 9b7e3f592eb6e9dfc7b3fca30815b8d811c590cf Mon Sep 17 00:00:00 2001 From: Amrit <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 19:22:07 -0600 Subject: [PATCH 04/50] Added header header can be used as template --- data/strats.csv | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/strats.csv b/data/strats.csv index cdddade..b706f47 100644 --- a/data/strats.csv +++ b/data/strats.csv @@ -1,2 +1 @@ -1,Test -2,test +id,strat From 52e04700e487c2a11fea56f03499219ebb15b3c5 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 20:22:02 -0600 Subject: [PATCH 05/50] Removed python find strat file --- find-strat.py | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 find-strat.py diff --git a/find-strat.py b/find-strat.py deleted file mode 100644 index 5c2b867..0000000 --- a/find-strat.py +++ /dev/null @@ -1,14 +0,0 @@ -import sys -import random -import json - -filePath = "../data/strats.txt" -count = len(open(filePath).readlines( )) -lineNum = randint(1, count) -lines = [0] -with open(filePath) as strats_file: - while strats_file.readline(): - lines.append(strats_file.tell()) - strats_file.seek(lines[lineNum]) - line = strats_file.readline() -return line From e7a2c6235adcae50ac75cc6ca4cf587b0a520c49 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 20:23:28 -0600 Subject: [PATCH 06/50] renamed strats to strats-table more descriptive. This wil be a csv file that contains the data. It will be imported every time the sqlite3-node find strat command fires. --- data/{strats.csv => strats-table.csv} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename data/{strats.csv => strats-table.csv} (100%) diff --git a/data/strats.csv b/data/strats-table.csv similarity index 100% rename from data/strats.csv rename to data/strats-table.csv From 84c08a48d9c531d23d011aed40a195d22fd9636f Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 20:24:01 -0600 Subject: [PATCH 07/50] Transfered strats from text file to table (csv) file --- data/strats-table.csv | 3 +++ data/strats.txt | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 data/strats.txt diff --git a/data/strats-table.csv b/data/strats-table.csv index b706f47..c74f915 100644 --- a/data/strats-table.csv +++ b/data/strats-table.csv @@ -1 +1,4 @@ id,strat +1,Use a pistol while crouching the entire game. If dual pistols are avalible, use dual pistols. +2,Kill using only melee attacks and grenades (throwable weapons) +3,Fire your gun until there is only one round in the current clip. Start every battle this way. \ No newline at end of file diff --git a/data/strats.txt b/data/strats.txt deleted file mode 100644 index f6a31f6..0000000 --- a/data/strats.txt +++ /dev/null @@ -1,3 +0,0 @@ -Use a pistol while crouching the entire game. If dual pistols are avalible, use dual pistols. -Kill using only melee attacks and grenades (throwable weapons) -Fire your gun until there is only one round in the current clip. Start every battle this way. \ No newline at end of file From bfcb7c08093f3876469b2bbf7a0585ec790340d7 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 20:24:16 -0600 Subject: [PATCH 08/50] create strats database file --- data/strats.db | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 data/strats.db diff --git a/data/strats.db b/data/strats.db new file mode 100644 index 0000000..e69de29 From 0246820e023ae12416f3027b4f9c74f0ee14582b Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 20:25:37 -0600 Subject: [PATCH 09/50] Added sqlite3-node file skeleton This skeleton includes the open and close connection statements, import statements, and the wrapper for the database queries. --- find-strat.node.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/find-strat.node.js b/find-strat.node.js index 8b13789..0f0d97c 100644 --- a/find-strat.node.js +++ b/find-strat.node.js @@ -1 +1,18 @@ +const sqlite3 = require('sqlite3'); +let db = new sqlite3.Database('./data/strats.db', sqlite3.OPEN_READONLY, (err) => { + if (err) { + console.error(err); + } + console.log("Connected to the Strats Database") +}); +db.serialize(() => { + // Database queries go here +}) + +db.close((err) => { + if (err) { + console.error(err.message); + } + console.log('Disconnected from the Strats Database'); +}); \ No newline at end of file From d2b7384e1e7b067baa3de272aa6269c3b5b52bf2 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 23:14:36 -0600 Subject: [PATCH 10/50] Rename strats table to strats --- data/{strats-table.csv => strats.csv} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename data/{strats-table.csv => strats.csv} (100%) diff --git a/data/strats-table.csv b/data/strats.csv similarity index 100% rename from data/strats-table.csv rename to data/strats.csv From 1b460ae4fd558b2e3921ddfc97990490a241b2b7 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 23:14:49 -0600 Subject: [PATCH 11/50] delete strats database --- data/strats.db | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 data/strats.db diff --git a/data/strats.db b/data/strats.db deleted file mode 100644 index e69de29..0000000 From 4aa3dd5fd7185716d597fe06ae2763c24df4578a Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 23:15:20 -0600 Subject: [PATCH 12/50] renamed find-strat to fetch (module revived modules --- find-strat.node.js | 18 ------------------ modules/Fetch.js | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 find-strat.node.js create mode 100644 modules/Fetch.js diff --git a/find-strat.node.js b/find-strat.node.js deleted file mode 100644 index 0f0d97c..0000000 --- a/find-strat.node.js +++ /dev/null @@ -1,18 +0,0 @@ -const sqlite3 = require('sqlite3'); -let db = new sqlite3.Database('./data/strats.db', sqlite3.OPEN_READONLY, (err) => { - if (err) { - console.error(err); - } - console.log("Connected to the Strats Database") -}); - -db.serialize(() => { - // Database queries go here -}) - -db.close((err) => { - if (err) { - console.error(err.message); - } - console.log('Disconnected from the Strats Database'); -}); \ No newline at end of file diff --git a/modules/Fetch.js b/modules/Fetch.js new file mode 100644 index 0000000..4d35900 --- /dev/null +++ b/modules/Fetch.js @@ -0,0 +1,19 @@ +module.exports.fetchStrat = (id) => { + const sqlite3 = require('sqlite3'); + let db = new sqlite3.Database(':memory:', sqlite3.OPEN_READONLY, (err) => { + if (err) { + console.error(err); + } + console.log("Connected to the Strats Database") + }); + db.serialize(() => { + // Database queries go here + }) + + db.close((err) => { + if (err) { + console.error(err.message); + } + console.log('Disconnected from the Strats Database'); + }); +} \ No newline at end of file From 050dfa9cba909f3f1f2934af909726abda742093 Mon Sep 17 00:00:00 2001 From: Spaceface16518 <33424649+Spaceface16518@users.noreply.github.com> Date: Thu, 11 Jan 2018 23:15:34 -0600 Subject: [PATCH 13/50] Added support for write module --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index e365a9d..8e1e5ee 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@ -
+