using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Newtonsoft.Json;
using System.Net;
using System.Web;
using System.IO;
namespace Steam_Trading_Calculator
{
public partial class Form1 : Form
{
int skinValue;
double keyPrice;
double skinOP;
double keyValue;
double sellValue;
double profit;
double pKeys;
double keyProfit;
double keyStockValue;
double value90;
double key90;
string inputString;
public Form1()
{
InitializeComponent();
}
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
}
private void SCP() {
using (WebClient webClient = new System.Net.WebClient())
{
string json = webClient.DownloadString("http://c...content-available-to-author-only...k.tf/api/IGetMarketPrices/v1/?key=REPLACEDKEY4REDDIT&appid=730");
Form1 form = JsonConvert.DeserializeObject<Form1>(json);
test.Text = form.response;
}
}
private void label1_Click(object sender, EventArgs e)
{
}
private void inputText_TextChanged(object sender, EventArgs e)
{
Values(skinValue);
}
private void inputText_KeyPress(object sender, KeyPressEventArgs e) {
if (Char.IsControl(e.KeyChar)) return;
}
private void Values(int skinValue) {
//http://s...content-available-to-author-only...y.com/market/priceoverview/?currency=3&appid=730&market_hash_name=
//Better option: http://c...content-available-to-author-only...k.tf/api/IGetMarketPrices/v1/?key=563c1b92dea9e9ed0c7f7676&appid=730
//Add this to the beginning of a market listing.
string inputString = this.inputText.Text;
if (this.inputText.Text.Length > 0)
{
if (this.inputText.Text.Length < 10)
{
skinValue = int.Parse(inputText.Text);
double skinDouble = Convert.ToDouble(skinValue);
// MessageBox.Show(skinValue.ToString());
skinOP = skinDouble * 0.80;
// MessageBox.Show(skinOP.ToString());
marketValue.Text = "$" + skinOP.ToString();
marketValue.Visible = true;
keyStockValue = skinValue / 2.5;
kStockValue.Text = Math.Ceiling(keyStockValue).ToString() + "k";
keyValue = skinOP / 2.5;
kValue.Text = Math.Round(keyValue).ToString() + "k";
sellValue = skinValue * .85;
sValue.Text = "$" + sellValue.ToString();
profit = sellValue - skinOP;
pValue.Text = "$" + profit.ToString();
pKeys = sellValue / 2.5;
pKeyValue.Text = Math.Floor(pKeys).ToString() + "k";
keyProfit = pKeys - keyValue;
kProfitValue.Text = Math.Floor(keyProfit).ToString() + "k";
value90 = skinValue * .90;
mValue90.Text = "$" + value90.ToString();
key90 = value90 / 2.5;
kValue90.Text = Math.Floor(key90).ToString() + "k";
SCP();
}
}
}
private void retrieveInput_Click(object sender, EventArgs e)
{
// MessageBox.Show(skinValue.ToString());
Values(skinValue);
}
private void label123_Click(object sender, EventArgs e)
{
}
private void label6_Click(object sender, EventArgs e)
{
}
private void pValue_Click(object sender, EventArgs e)
{
}
private void sValue_Click(object sender, EventArgs e)
{
}
private void pKeyValue_Click(object sender, EventArgs e)
{
}
private void profitLabel_Click(object sender, EventArgs e)
{
}
private void label5_Click(object sender, EventArgs e)
{
}
private void kValue_Click(object sender, EventArgs e)
{
}
private void label4_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
inputText.Text = "";
}
}
}