From 4b36068d2cbc5b07815affb3b62e040cebee118e Mon Sep 17 00:00:00 2001 From: amelia Date: Wed, 22 Jun 2022 19:00:05 -0500 Subject: general updates --- index.html | 39 ++++++++++++++++++++++++++++----------- server.ts | 4 ++-- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index 4584299..cdd6ad9 100644 --- a/index.html +++ b/index.html @@ -291,17 +291,30 @@ transform:scale(0.7); x[0].hidden = !x[0].hidden } - function roll(item) { + async function fight() { + var inv = getCookie('inv'); + inv = JSON.parse(inv) + var storage = getCookie('storage'); + storage = JSON.parse(storage) + let team = [inv[0], inv[1], inv[2], inv[3], inv[4]] + let opp = [roll(0,true), roll(0,true), roll(0,true), roll(0,true), roll(0,true)] + + + } + function roll(item, opp=false) { fetch(file) .then(response => { return response.json(); }) .then(data => { - + if(!opp){ var bank = getCookie('bank'); + } else { + var bank = 999999999999999999 + } var inv = getCookie('inv'); var arr = JSON.parse(inv); - if (data.crates[item].price <= getCookie('bank')) { + if (data.crates[item].price <= bank) { //console.log(data.crates[item].contents[Math.floor(Math.random()*data.crates[item].contents.length)]) var x = document.getElementById("popup"); if (x.style.display != "block") { //anti spam check thingy @@ -318,7 +331,7 @@ transform:scale(0.7); } x.style.background = (data.crates[item].contents[select].color) - + if(!opp){ createCookie('bank', bank - data.crates[item].price); console.log(chance) data.crates[item].contents[select]['storage'] = false @@ -326,12 +339,12 @@ transform:scale(0.7); arr.push(data.crates[item].contents[select]) createCookie('inv', JSON.stringify(arr)); - + } setTimeout(function () {document.getElementById("popup").style.display = "none";}, 500); } - + } else { var x = document.getElementById("popup"); if (x.style.display != "block") { //anti spam check thingy @@ -353,8 +366,9 @@ transform:scale(0.7); }) .then(data => { - var intervalID = window.setInterval(myCallback, 500); - function myCallback() { + + var intervalID = window.setInterval(udate, 500); + function udate() { updateInv() x = document.getElementsByClassName("shiny") @@ -383,7 +397,7 @@ transform:scale(0.7); headTitle.appendChild(setFavicon); console.log("favicon set") } - document.write("
\ + document.write("
\
_______________________
.-'~~~-.

\
_____________________
.'o oOOOo`.

\
____________________
:~~~-.oOo o`.

\ @@ -392,7 +406,7 @@ transform:scale(0.7);
_______________________
.' ;
-- `.o.'

\
______________________
,' ;
~~--'~

\
______________________
'; ;

\ -
_______\|/__________\\;_\\//___\|/________
") +
_______\|/__________\\;_\\//___\|/________
") //yeah i stacked a bold and a stong tag, fight me setFavicons('https://raw.githubusercontent.com/squiresgrant/Antheia/main/icon.ico'); var bank = getCookie('bank'); @@ -438,7 +452,7 @@ setFavicons('https://raw.githubusercontent.com/squiresgrant/Antheia/main/icon.ic x[0].hidden = true //x[i].outerText="\ncontents: [ ... ]
"; - + document.write("
") // document.write("") @@ -448,6 +462,9 @@ setFavicons('https://raw.githubusercontent.com/squiresgrant/Antheia/main/icon.ic } document.body.style.backgroundColor = BgColor; + //centered button + document.write("
") + document.write("
") return (0) }).then((open) => { var number = 5; //just for an example diff --git a/server.ts b/server.ts index 4907371..05807cd 100644 --- a/server.ts +++ b/server.ts @@ -1,7 +1,7 @@ var fs = require('fs'); var express = require('express'); var app = express(); -const PORT = 8008 || process.env.PORT;; +const PORT = 8008 || process.env.PORT; fs.readFile('./index.html', function (err:any, html:any) { app.listen(PORT, function () { console.log('listening! http://localhost:' + PORT); @@ -11,4 +11,4 @@ app.get('/', function (req:any, res:any) { }) app.get('/crates.json', function (req:any, res:any) { res.sendFile('crates.json', {root: __dirname }) -})}) \ No newline at end of file +})}); \ No newline at end of file -- cgit v1.2.3