Hi all,

I'm afraid I only know VB and VBA, not HTML or Javascript. Based on
the programming experience I do have, I can tell that what I want is
obscenely simple, if I knew the language. Basically, all I want is a
greasemonkey userscript that performs a simple subtraction and
division, with the results displayed on a webpage. For anyone willing
to help me out with this, please read on. I will try to explain it as
briefly and clearly as I can. This user script would work for a
simulation website that is used for an online strategy game.

The web page I want the script to work with is: http://websim.speedsim.net/

When the page loads freshly (no simulation has been run), you can see
the following clearly on the page:

Battle on       Fight at Unknown [x:xxx:xx]
Result
Debris Field    0 Metal (0%), 0 Crystal (0%) ~ 0 Recycler
Moonchance      Not enough ressources in the debris
Losses Attacker 0 Metal, 0 Crystal and 0 Deuterium
Losses Defender 0 Metal, 0 Crystal and 0 Deuterium
Theoretic Plunder       0 Metal, 0 Crystal and 0 Deuterium ~ 0 Large Cargo
Real Plunder    0 Metal, 0 Crystal and 0 Deuterium (0% Booty)
Needed Fuel     0 Deuterium
Flight times    00:00:00 h

If an example simulation is run, this data changes. For this example,
I am running a simulation of 100 Battleships for the attacker, and 5
destroyers for the defender. These two numbers are entered on the page
and the 'simulate' button is pressed. No other data needs to be
entered. After the simulation described above is run, the following
data is reported:

Battle on       Fight at [0:0:0]
Result  | Attacker wins (100%) | after ~ 1 rounds
Debris Field    103.500 Metal (230%), 79.500 Crystal (530%) ~ 10 Recycler
Moonchance      Chance that a moon arises is 1%
Losses Attacker 45.000 Metal, 15.000 Crystal and 0 Deuterium
Losses Defender 300.000 Metal, 250.000 Crystal and 75.000 Deuterium
Theoretic Plunder       0 Metal, 0 Crystal and 0 Deuterium ~ 0 Large Cargo
Real Plunder    0 Metal, 0 Crystal and 0 Deuterium (100% Booty)
Needed Fuel     0 Deuterium
Flight times    00:00:00 h

The user script I'm looking for would do two simple things. Calculate
profit, and convert that profit based on the relative value of each
resource. Like this:

Metal Profit = Debris Field Metal + Real Plunder Metal - Losses
Attacker Metal
Crystal Profit = Debris Field Crystal + Real Plunder Crystal - Losses
Attacker Crystal
Deuterium Profit = Real Plunder Deuterium - Need Fuel Deuterium

Converted profit would be as follows:

(Metal Profit / 3) + (Crystal Profit / 2) + Deuterium Profit

That's it. I'd like the both sets of results displayed on the webpage
somewhere. Where, specifically, does not matter to me. The bottom of
the page would be fine.

I wish I knew Javascript, because I'm certain this would take only a
few minutes for someone that knows the language and syntax.

I really appreciate your consideration and, for anyone willing to do
this, THANK YOU VERY MUCH! Please let me know if you have any question
at all. Thanks again.

---A Mad Doberman

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to