• Log in or sign up for an account here: https://www.sythe.org/login

[C# program] Charm & kill counter!

Yenthe666

Guru

Banned
Joined
Apr 10, 2011
Sythe Gold
0
Messages
1,013
Hey guys,

I had to study for my exam of c#, but I got bored, so for the fun of it I made a little charm counter.
Everytime you click on one of the buttons it will add a charm to the counter.
Total kills button will tell you how many kills you have made, you will need to click everytime after a kill.

If you close the file the programme will automaticly write away the info about your charms / kills count! :)
(this is to an .txt file)
pics:
applook.jpg


charmcounter.jpg


virus-Check.jpg



It might not look like much, but for a beginning programmer its not too bad?
Leave me some comments with your thoughts guys!

NOTE: if you download this. Its a ZIP, unzip it and keep the .exe file within a folder. Your .txt file will be added in the same folder when you exit the application.
Download link:
http://www.2shared.com/file/b_S0xiLf/Yenthe666s_Charm_Counter.html

TO MODS: Let me know if this is not allowed, if I should post more pics, more proof, or anything.
I hope I did it all well! :P

Source code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace Charm_counter
{
public partial class Form1 : Form
{
private int _goldCharms = 0;
private int _greenCharms = 0;
private int _crimsonCharms = 0;
private int _blueCharms = 0;
private int _totalKills = 0;

public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
label1.ForeColor = Color.Red;
this.Font = new Font("verdana", 12, FontStyle.Bold);
this.Text = "Charm drop rates - Total monsters killed: " + _totalKills;
this.ControlBox = false;
buttonExit.Text = "Close App";
labelTotalKills.ForeColor = Color.Red;
labelTotalKills.Text = "TOTAL KILLS: " + _totalKills;
this.BackColor = Color.FromArgb(210, 210,210);
this.BackgroundImage = Properties.Resources.Background;
this.Icon = Properties.Resources.favicon;

// alles transparant
label1.BackColor = Color.Transparent;
labelTotalKills.BackColor = Color.Transparent;
pictureBoxBlueCharm.BackColor = Color.Transparent;
pictureBoxCrimsonCharm.BackColor = Color.Transparent;
pictureBoxGoldCharm.BackColor = Color.Transparent;
pictureBoxGreenCharm.BackColor = Color.Transparent;
labelGold.BackColor = Color.Transparent;
labelGreen.BackColor = Color.Transparent;
labelCrimsonCharms.BackColor = Color.Transparent;
labelBlueCharms.BackColor = Color.Transparent;

// forecolor van labels
labelGold.ForeColor = Color.White;
labelCrimsonCharms.ForeColor = Color.White;
labelGreen.ForeColor = Color.White;
labelBlueCharms.ForeColor = Color.White;
buttonAddBlue.ForeColor = Color.White;
buttonAddCrimson.ForeColor = Color.White;
buttonAddGold.ForeColor = Color.White;
buttonAddGreen.ForeColor = Color.White;

// gold charms
pictureBoxGoldCharm.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxGoldCharm.Image = Properties.Resources.gold;
pictureBoxGoldCharm.Left = 5;
buttonAddGold.Text = "Gold charm";
buttonAddGold.BackColor = Color.Gold;
buttonAddGold.Left = 105;
buttonAddGold.Height = 30;
buttonAddGold.Width = 90;

// green charms
pictureBoxGreenCharm.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxGreenCharm.Image = Properties.Resources.green;
buttonAddGreen.Left = 310;
buttonAddGreen.Text = "Green charm";
buttonAddGreen.BackColor = Color.Green;
buttonAddGreen.Height = 30;
buttonAddGreen.Width = 90;

// crimson charms
pictureBoxCrimsonCharm.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxCrimsonCharm.Image = Properties.Resources.crimson;
pictureBoxCrimsonCharm.Left = -5;
buttonAddCrimson.Text = "Crimson charm";
buttonAddCrimson.BackColor = Color.Red;
buttonAddCrimson.Left = 105;
buttonAddCrimson.Height = 30;
buttonAddCrimson.Width = 90;

// blue charms
pictureBoxBlueCharm.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxBlueCharm.Image = Properties.Resources.blue;
buttonAddBlue.Left = 310;
buttonAddBlue.Text = "Blue";
buttonAddBlue.BackColor = Color.Blue;
buttonAddBlue.Height = 30;
buttonAddBlue.Width = 90;
}

private void buttonAddGold_Click(object sender, EventArgs e)
{
_goldCharms++;
labelGold.Text = "Total Gold Charms: " + _goldCharms;
labelGreen.Text = "Total Green Charms: " + _greenCharms;
labelCrimsonCharms.Text = "Total Crimson Charms: " + _crimsonCharms;
labelBlueCharms.Text = "Total Blue Charms: " + _blueCharms;
}

private void buttonAddCrimson_Click(object sender, EventArgs e)
{
_crimsonCharms++;
labelGold.Text = "Total Gold Charms: " + _goldCharms;
labelGreen.Text = "Total Green Charms: " + _greenCharms;
labelCrimsonCharms.Text = "Total Crimson Charms: " + _crimsonCharms;
labelBlueCharms.Text = "Total Blue Charms: " + _blueCharms;
}

private void buttonAddGreen_Click(object sender, EventArgs e)
{
_greenCharms++;
labelGold.Text = "Total Gold Charms: " + _goldCharms;
labelGreen.Text = "Total Green Charms: " + _greenCharms;
labelCrimsonCharms.Text = "Total Crimson Charms: " + _crimsonCharms;
labelBlueCharms.Text = "Total Blue Charms: " + _blueCharms;
}

private void buttonAddBlue_Click(object sender, EventArgs e)
{
_blueCharms++;
labelGold.Text = "Total Gold Charms: " + _goldCharms;
labelGreen.Text = "Total Green Charms: " + _greenCharms;
labelCrimsonCharms.Text = "Total Crimson Charms: " + _crimsonCharms;
labelBlueCharms.Text = "Total Blue Charms: " + _blueCharms;
}

private void buttonExit_Click(object sender, EventArgs e)
{
DialogResult antwoord;
antwoord = MessageBox.Show("Are you sure you want to close the programme?", "Close?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (antwoord == System.Windows.Forms.DialogResult.Yes)
{

StreamWriter streamSchrijf = new StreamWriter("charmcounter.txt", true);
streamSchrijf.WriteLine(labelGold.Text + Environment.NewLine + labelGreen.Text + Environment.NewLine + labelCrimsonCharms.Text + Environment.NewLine + labelBlueCharms.Text + Environment.NewLine + labelTotalKills.Text + Environment.NewLine + DateTime.Now.ToLongDateString() + " - " + DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second + Environment.NewLine);
streamSchrijf.Close();
streamSchrijf.Dispose();

Application.Exit();
}
}

private void buttonTotalKills_Click(object sender, EventArgs e)
{
_totalKills++;
labelTotalKills.Text = "TOTAL KILLS: " + _totalKills;
this.Text = "Charm drop rates - Total monsters killed: " + _totalKills;
}
}
}
 
Not to bash on you or anything but I dont get it. Can't you just see how many charms are in your inventory?
 
@Edward: I hear you.
But some people like to see how many charms they get from a monster.
So they randomly begin killing, and this would be the counter for the number of kills you did.
(you wouldn't have to toggle the charms if you wouldn't want to, you could keep up the charmcount yourself too)

Edit: and if I had more time I'd love to code extra futures
 
Just post the source?
Much safer.
 
Sorry this seems too sketchy for anyone to use.

EDITED:
Ah it's just a clicker counter. Thought it was a program that could "detect" rs actions.

Still be careful when downloading programs. I would follow the suggestions and get it verified as safe
 
I decompiled it. As far as I can tell, it's safe.

If you'd still like a better checkup, this is the full source code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace Charm_counter
{
public partial class Form1 : Form
{
private int _goldCharms = 0;
private int _greenCharms = 0;
private int _crimsonCharms = 0;
private int _blueCharms = 0;
private int _totalKills = 0;

public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
label1.ForeColor = Color.Red;
this.Font = new Font("verdana", 12, FontStyle.Bold);
this.Text = "Charm drop rates - Total monsters killed: " + _totalKills;
this.ControlBox = false;
buttonExit.Text = "Close App";
labelTotalKills.ForeColor = Color.Red;
labelTotalKills.Text = "TOTAL KILLS: " + _totalKills;
this.BackColor = Color.FromArgb(210, 210,210);
this.BackgroundImage = Properties.Resources.Background;
this.Icon = Properties.Resources.favicon;

// alles transparant
label1.BackColor = Color.Transparent;
labelTotalKills.BackColor = Color.Transparent;
pictureBoxBlueCharm.BackColor = Color.Transparent;
pictureBoxCrimsonCharm.BackColor = Color.Transparent;
pictureBoxGoldCharm.BackColor = Color.Transparent;
pictureBoxGreenCharm.BackColor = Color.Transparent;
labelGold.BackColor = Color.Transparent;
labelGreen.BackColor = Color.Transparent;
labelCrimsonCharms.BackColor = Color.Transparent;
labelBlueCharms.BackColor = Color.Transparent;

// forecolor van labels
labelGold.ForeColor = Color.White;
labelCrimsonCharms.ForeColor = Color.White;
labelGreen.ForeColor = Color.White;
labelBlueCharms.ForeColor = Color.White;
buttonAddBlue.ForeColor = Color.White;
buttonAddCrimson.ForeColor = Color.White;
buttonAddGold.ForeColor = Color.White;
buttonAddGreen.ForeColor = Color.White;

// gold charms
pictureBoxGoldCharm.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxGoldCharm.Image = Properties.Resources.gold;
pictureBoxGoldCharm.Left = 5;
buttonAddGold.Text = "Gold charm";
buttonAddGold.BackColor = Color.Gold;
buttonAddGold.Left = 105;
buttonAddGold.Height = 30;
buttonAddGold.Width = 90;

// green charms
pictureBoxGreenCharm.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxGreenCharm.Image = Properties.Resources.green;
buttonAddGreen.Left = 310;
buttonAddGreen.Text = "Green charm";
buttonAddGreen.BackColor = Color.Green;
buttonAddGreen.Height = 30;
buttonAddGreen.Width = 90;

// crimson charms
pictureBoxCrimsonCharm.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxCrimsonCharm.Image = Properties.Resources.crimson;
pictureBoxCrimsonCharm.Left = -5;
buttonAddCrimson.Text = "Crimson charm";
buttonAddCrimson.BackColor = Color.Red;
buttonAddCrimson.Left = 105;
buttonAddCrimson.Height = 30;
buttonAddCrimson.Width = 90;

// blue charms
pictureBoxBlueCharm.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxBlueCharm.Image = Properties.Resources.blue;
buttonAddBlue.Left = 310;
buttonAddBlue.Text = "Blue";
buttonAddBlue.BackColor = Color.Blue;
buttonAddBlue.Height = 30;
buttonAddBlue.Width = 90;
}

private void buttonAddGold_Click(object sender, EventArgs e)
{
_goldCharms++;
labelGold.Text = "Total Gold Charms: " + _goldCharms;
labelGreen.Text = "Total Green Charms: " + _greenCharms;
labelCrimsonCharms.Text = "Total Crimson Charms: " + _crimsonCharms;
labelBlueCharms.Text = "Total Blue Charms: " + _blueCharms;
}

private void buttonAddCrimson_Click(object sender, EventArgs e)
{
_crimsonCharms++;
labelGold.Text = "Total Gold Charms: " + _goldCharms;
labelGreen.Text = "Total Green Charms: " + _greenCharms;
labelCrimsonCharms.Text = "Total Crimson Charms: " + _crimsonCharms;
labelBlueCharms.Text = "Total Blue Charms: " + _blueCharms;
}

private void buttonAddGreen_Click(object sender, EventArgs e)
{
_greenCharms++;
labelGold.Text = "Total Gold Charms: " + _goldCharms;
labelGreen.Text = "Total Green Charms: " + _greenCharms;
labelCrimsonCharms.Text = "Total Crimson Charms: " + _crimsonCharms;
labelBlueCharms.Text = "Total Blue Charms: " + _blueCharms;
}

private void buttonAddBlue_Click(object sender, EventArgs e)
{
_blueCharms++;
labelGold.Text = "Total Gold Charms: " + _goldCharms;
labelGreen.Text = "Total Green Charms: " + _greenCharms;
labelCrimsonCharms.Text = "Total Crimson Charms: " + _crimsonCharms;
labelBlueCharms.Text = "Total Blue Charms: " + _blueCharms;
}

private void buttonExit_Click(object sender, EventArgs e)
{
DialogResult antwoord;
antwoord = MessageBox.Show("Are you sure you want to close the programme?", "Close?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (antwoord == System.Windows.Forms.DialogResult.Yes)
{

StreamWriter streamSchrijf = new StreamWriter("charmcounter.txt", true);
streamSchrijf.WriteLine(labelGold.Text + Environment.NewLine + labelGreen.Text + Environment.NewLine + labelCrimsonCharms.Text + Environment.NewLine + labelBlueCharms.Text + Environment.NewLine + labelTotalKills.Text + Environment.NewLine + DateTime.Now.ToLongDateString() + " - " + DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second + Environment.NewLine);
streamSchrijf.Close();
streamSchrijf.Dispose();

Application.Exit();
}
}

private void buttonTotalKills_Click(object sender, EventArgs e)
{
_totalKills++;
labelTotalKills.Text = "TOTAL KILLS: " + _totalKills;
this.Text = "Charm drop rates - Total monsters killed: " + _totalKills;
}
}
}
 
Cool little project you made there :) As you advance your coding knowledge, do you plan on designing and building more applications for RS?
 
Cool little project you made there :) As you advance your coding knowledge, do you plan on designing and building more applications for RS?

Thanks Zerker!
I'd sure love to make more applications around RS :)
Both 'fair' and cheating ones actually!

@99lighting: could you explain me a bit more about 'hooking a key'? I'm new into this, but I bet you have a pretty good idea ;)
 
would be cool to add in a monster option so it averages the charms per monster
 
would be cool to add in a monster option so it averages the charms per monster

Hehe yep I might be coding that tommorow if I have some spare time ;)
something like:
Give in a name: ---YOURNAMEHERE---- ADD IT

after you give in a name (of a monster) all the text will pop out of the screen, your monster name will be added into the program.

Closing the program will give you (in a .txt file) the monster name, charms counter per kind, average of the charms, and the date! :)

Hope this works out as easy as typing this.
Edit: already began a bit of it! Thanks for your feedback too :)
 
If you could figure out how to get it to read for you, that would be something. I only suggest this because rswiki already has pretty accurate charm percentages. But well done on having RS contribute to your education. :D
 
Runescape Gamblingrunescape gambling
Back
Top