Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iHP - HP Washing Calculation Program
#1
iHP SUPPORT MOVED TO MY WEBSITE

http://uneasydan.com/2009/04/28/ihp-hp-w...alculator/
Reply
#2
Great...now make it work for other classes.
Reply
#3
Pirate pl0x
Reply
#4
works for warriors, bowmens, and thieves o_O
Reply
#5
god Wrote:works for warriors, bowmens, and thieves o_O

pirates are people too
Reply
#6
god Wrote:works for warriors, bowmens, and thieves o_O

Yeah, Pirates is what I meant. Rolleyes
Reply
#7
If you have the formula, post it here and i can put it in, or you can just implement it yourself, if you know vb Smile
Reply
#8
Fuck your rapidshit. lolVB. Reading Source. afk.
Code:
If cmbClass.Text = "Thief(2nd)" Then
  txtWashable.Text = txtCurMP.Text - txtMP.Text
  txtWashable.Text = txtWashable.Text / 12
  txtAfter.Text = 20 * txtWashable.Text + txtCurHP.Text

ElseIf cmbClass.Text = "Thief(3rd/4th)" Then
  txtWashable.Text = txtCurMP.Text - txtMP.Text
  txtWashable.Text = txtWashable.Text / 12
  txtAfter.Text = 20 * txtWashable.Text + txtCurHP.Text

These are the same thing, you don't have to put them into two separate conditions.
same with
Code:
ElseIf cmbClass.Text = "Fighter" Then
  txtWashable.Text = txtCurMP.Text - txtMP.Text
  txtWashable.Text = txtWashable.Text / 4
  txtAfter.Text = 50 * txtWashable.Text + txtCurHP.Text

ElseIf cmbClass.Text = "Spearman/DK" Then
  txtWashable.Text = txtCurMP.Text - txtMP.Text
  txtWashable.Text = txtWashable.Text / 4
  txtAfter.Text = 50 * txtWashable.Text + txtCurHP.Text

I'm pretty sure, but not 100%, that the syntax would be
Code:
If cmbClass.Text = "Thief(2nd)" OR cmbClass.Text = "Thief(3rd/4th)" Then
  txtWashable.Text = txtCurMP.Text - txtMP.Text
  txtWashable.Text = txtWashable.Text / 12
  txtAfter.Text = 20 * txtWashable.Text + txtCurHP.Text

I haven't touched VB in four years.
Reply
#9
i haven't either...i just downloaded it again last night to write this program because i was too lazy to keep calculating how much mp i needed to wash lol

oh and, ive done all that because im more used to java...usually i just use else ifs and i kept forgetting vb doesnt need semi colons lol
Reply
#10
Java uses double pikes (||) to denote OR operators in conditional statements. Personally, I would go the route of Select Case for that particular function type, with a variable change, and a single formula elsewhere, since the formula gets executed regardless of job, and there are only x and y differences for each class.
Can't recall the syntax for a Select Case in VB, so a switch statement in java:
Code:
int x;
int y;
switch (cmbClass.Text)
{
  case "Thief (2nd)":
  case "Thief(3rd/4th)":
    x = 12;
    y = 20;
  case "Fighter":
  case "Spearman/DK":
    x = 4;
    y = 50;
  default:
    x = 0;
    y = 0;
}
  txtWashable.Text = int.ParseInt(txtCurMP.Text) - int.ParseInt(txtMP.Text);
  txtWashable.Text = int.ParseInt(txtWashable.Text) / x;
  txtAfter.Text = y * int.ParseInt(txtWashable.Text) + int.ParseInt(txtCurHP.Text);
Reply
#11
lol, well, i also wanted a simple gui instead of it being through a terminal (or command in windows case) without having to mess with swing. i get lazy when it comes to coding.

1 hour in vb > 3 hours in java
Reply
#12
I believe the formula for both pirates is the same:

level x 18 + 111 (minimum mp to wash 1 point)

Works for Corsairs at any rate.
Reply
#13
JoeTang Wrote:Java uses double pikes (||) to denote OR operators in conditional statements. Personally, I would go the route of Select Case for that particular function type, with a variable change, and a single formula elsewhere, since the formula gets executed regardless of job, and there are only x and y differences for each class.
Can't recall the syntax for a Select Case in VB, so a switch statement in java:
Code:
int x;
int y;
switch (cmbClass.Text)
{
  case "Thief (2nd)":
  case "Thief(3rd/4th)":
    x = 12;
    y = 20; break;
  case "Fighter":
  case "Spearman/DK":
    x = 4;
    y = 50; break;
  default:
    x = 0;
    y = 0;
}
  txtWashable.Text = int.ParseInt(txtCurMP.Text) - int.ParseInt(txtMP.Text);
  txtWashable.Text = int.ParseInt(txtWashable.Text) / x;
  txtAfter.Text = y * int.ParseInt(txtWashable.Text) + int.ParseInt(txtCurHP.Text);

If you don't break it will not do what you expect Tongue


ed: Yeah, Swing would be the reason I never updated my damage calculator for 4th job skills. I'd need about 30 checkbox/radio buttons with associated skill name + levels. :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)