Who is online?
In total there is 1 user online :: 0 Registered, 0 Hidden and 1 Guest :: 1 Bot

None

Most users ever online was 9 on Thu Sep 01, 2011 10:59 pm
Top posters
Big D (1067)
 
Cruncher (904)
 
Farley (887)
 
Kewlbreeze (816)
 
Micro (456)
 
Comet (325)
 
TheButcher (225)
 
Oso (190)
 
Runaway Proton (179)
 
Vulcan (104)
 

Top posting users this week
Big D
 
-=orion=-
 


Colo Calculator

View previous topic View next topic Go down

Colo Calculator

Post  Oso on Thu Aug 25, 2011 5:16 pm

Hey all,

Grimy's website used to have a colo calculator that would allow you to input #TPW, #Holds, and distance to planet from terra, and it would calculate and create a macro for you to use.
Here is the an example of me doing the calculations manually, but I don't know the formula he used in order to generate the optimal macro.
I can probably come up with a mathematical formula, but I don't have the time. If anyone knows it, can we try to put together a script using it?
Here it is:
3 Turns per warp ship, 200 holds 7 sectors to planet from terra.
Land and take 21 Ore (1 turn)
Bwarp to Sector 1 (1 turn)
Land and take 179 Colos (1 turn)
Twarp back (3 turns)
Drop colos

This gives you 179 colos for 6 turns, or 39.833 Colos per turn.

The optimized solution would be this:
Land and take 42 Ore (1 turn)
Bwarp to Sector 1 (1 turn)
Land and take 158 Colos (1 turn)
Twarp back (3 turns)
Land and drop colos
Bwarp to Sector 1 (1 turn)
Land and take 179 Colos (1 turn)
Twarp back (3 turns)
Drop colos

This gives you 337 colos for 11 turns, or 30.636 Colos per turn.

However, if you were to take enough ore for 3 runs, you would get 474 colos in 16 turns, or 29.625 Colos per turn. And that is less efficient.

Can someone help me come up with a way to get a script to test all this?

Oso
Federation Commander
Federation Commander

Posts: 190
Join date: 2011-08-22

Back to top Go down

Re: Colo Calculator

Post  Big D on Fri Aug 26, 2011 1:53 am

I'd like to help you Oso, but I just don't know enough about how it worked. Singularity might. If you need his icq # I can give it to you.

Big D
Ground Zero Member
Ground Zero Member

Posts: 1067
Join date: 2010-02-13
Age: 54
Location: New Concord, Ohio

http://http:/silverwingstwgs.com

Back to top Go down

Re: Colo Calculator

Post  Oso on Fri Aug 26, 2011 11:32 am

Is he still on ICQ?

Well I tried to program it into Sikuli (Java python scripting language), but I had some issues trying to come up with the formula for adding the # colos taken on each trip.
I have an overall idea on how it would work, but putting it into code is something else...

Oso
Federation Commander
Federation Commander

Posts: 190
Join date: 2011-08-22

Back to top Go down

Re: Colo Calculator

Post  Micro on Fri Aug 26, 2011 12:06 pm

Sing's ICQ is 11153178 I don't know if he uses it.
He is also on FB [You must be registered and logged in to see this link.]
and he frequents the EIS forum

_________________
Regards,
Micro

Website: [You must be registered and logged in to see this link.]
Telnet: twgs.microblaster.net:2002
TeamSpeak3: ts.microblaster.net:9987

"I choose to believe what I was programmed to believe"

Micro
TWGS Sysop
TWGS Sysop

Posts: 456
Join date: 2011-08-15
Location: Oklahoma City, OK

http://www.microblaster.net

Back to top Go down

Re: Colo Calculator

Post  crosby on Fri Aug 26, 2011 10:06 pm

So you want a short Q&A:
1) Colonist Drop Category (Fuel, Org, Equip)
2) Use current ship?

Then have your script do some checks and spit out
the optimized macro?

That doesn't sound too hard to do in twx..
< edit..70 lines later..might take a bit...>

Were you talking about doing a webpage that did that?




crosby
Newbie
Newbie

Posts: 69
Join date: 2011-08-26

Back to top Go down

Re: Colo Calculator

Post  Oso on Sun Aug 28, 2011 2:00 pm

crosby wrote:So you want a short Q&A:
1) Colonist Drop Category (Fuel, Org, Equip)
2) Use current ship?

Then have your script do some checks and spit out
the optimized macro?

That doesn't sound too hard to do in twx..
< edit..70 lines later..might take a bit...>

Were you talking about doing a webpage that did that?




The Grimy website had something that would take your input and spit out a macro.
It would be nice to do in TWX, I've been fiddling around with python trying to figure out how to do the math aspect of it, and have not had any success.

Oso
Federation Commander
Federation Commander

Posts: 190
Join date: 2011-08-22

Back to top Go down

Re: Colo Calculator

Post  crosby on Sun Aug 28, 2011 3:56 pm

Bah..I've been fiddling with it. For giggles I'll post what I have so far:

Code:
#  Optimized Bwarp Colo Macro Maker

:checkshit
:grabprompt
getword currentline $firstword 1
If $firstword = "Citadel"
 send "Q"
  setVar $prompt "Citadel"
Elseif $firstword = "Planet"
 setVar $prompt $firstword
Else
 setvar $err "*Dude, you must have a planet to do this...**"
 goto :DaEnd
End
:planetAssessment
#  So making it here means we are at the Planet prompt, next check.

#Planet #6 in sector 4588: Damogran
#Class M, Earth Type
#Created by: Karn
#Claimed by: ToolBoxx [4]

#  Item    Colonists  Colonists    Daily    Planet      Ship      Planet
#          (1000s)  2 Build 1  Product    Amount    Amount    Maximum
# -------  ---------  ---------  ---------  ---------  ---------  ---------
#Fuel Ore    63,162          2    31,580    806,841          0  3,000,000
#Organics    21,597          1    21,403    14,173          0    900,000
#Equipment    30,771          1    30,770    20,309          0    900,000
#Fighters        N/A          1    83,753    768,092    300,000  5,000,000

#Planet has a level 6 Citadel, treasury contains 19,640,940 credits.
#Military reaction=0%, QCannon power=26%, AtmosLvl=20%, SectLvl=3%
#      -=-=-=-=-=- TransWarp power = 2017 hops -=-=-=-=-=-
#  ¦¦¦¦  Planetary Defense Shielding Power Level = 0  ¦¦¦¦
#        Planetary Interdictor Generator = ACTIVE
#      -=-=-=-=-=- TransPort power = 31 hops -=-=-=-=-=-

#Planet command (?=help) [D]

# settextlinetrigger planet  :grabplanetnumber "Planet #"
# settextlinetrigger fuel    :grabstartfuel  "Fuel Ore"
# settextlinetrigger citadel :grabcitlevel "Planet has a level"
# settextlinetrigger tpad    :tpadrange  "TransPort power ="
# settextlinetrigger doneplanet  :doneplanet "Planet command (?="
send "D"
waitfor "in sector"
:grabplanetnumber
getword currentline $planetnumber 2
striptext $planetnumber "#"
:grabsector
getword currentline $startsector 5
striptext $startsector ":"

waitfor "Fuel Ore"
:grabstartfuel
getword currentline $startfuel 6
striptext $startfuel ","
If $startfuel < 100
 setvar $err "..Dude, you have less than 100 Fuel on your planet!?!*"
 goto :DaEnd
End

waitfor "Planet has a level"
:grabcitlevel
getword currentline $citlevel 5
waitfor "TransPort power ="
:tpadrange
getword currentline $tpadrange 5
waitfor "Planet command (?="
:doneplanet
killalltriggers
# ok, so we made it to the planet prompt
If $citlevel = 0
  setvar $err "...Dude, you need a citadel to tpad colo..."
  goto :DaEnd
Elseif $tpadrange < 2
  setvar $err "...Dude, your tpad's range is nonexistant!?!**"
  goto :DaEnd
End
# so we have a citadel, fuel, and a tpad.  Let's check trader Align.
settextlinetrigger align :checkAlign "Rank and Exp"
settextlinetrigger tpw  :tpw        "Turns to Warp"
settextlinetrigger turns :checkturns "Turns left"
settexttrigger back2cit  :back2cit  "Citadel command (?="
send "CI"
pause

:checkAlign
# make sure our align is > 1000
# currentline:->  Rank and Exp  : 32,760 points, Alignment=4,500,000 Saintly
setvar $templine currentline
striptext $templine ":"
replacetext $templine "=" " "
getword $templine $test1 7
striptext $test1 ","
If $test1 < 1000
  setvar $err "Dude, you can't jump to Fed, you're alignment is " & $test1
  goto :DaEnd
End
pause
:tpw
# grabbing turns per warp outta this:
# Turns to Warp  : 2
setvar $templine currentline
striptext $templine ":"
getword $templine $tpw 4
pause
:checkturns
#  grabbing remaining turns outta this:
#  Turns left    : Unlimited      or
#  Turns left    : 1500
setvar $templine currentline
striptext $templine ":"
getword $templine $turns 3
If ($turns = "Unlimited") or ($turns = "99999") or ($turns = 0)
  echo ansi_4 & "*Proceeding as unlimited turn game, hit '" & ansi_15 & "q" & ansi_4 & "' to abort.**"
  echo #27 & "[1;5;35;44m" & "You have 10 seconds to abort!" & #27 & "[0m**"
  settextouttrigger stopit :stopit "q"
  setdelaytrigger  noway :noway 10000
  pause
  :stopit
    setvar $err "aborted by user, over proceeding as an unlimited game."
    goto :DaEnd
End
    :noway
      # we aren't aborting..we going!!
      echo ansi_4 "* Ok, not aborting, we must be unlim..**"

:back2cit
 #  ok, we should have enough to proceed.
 #  let's get our course and distance.
 send "cf" & $startsector & "*1*"
 waitfor ") from sector"
 getword currentline $goingHops 4
 striptext $goingHops "("
 send "cf1*" & $startsector & "*"
 waitfor ") from sector"
 getword currentline $comingHops 4
 striptext $comingHops "("



:build_macro

:set_failsafe_triggers
:send_macro
:check_package
# assess figs/shields/planet overload and if ok, goto :send_macro

:limit_hit
echo ansi_5 & "*Whoopie, we made it.  Script powering down.**"
halt

 echo "**holy shit..we're about to hit DaEnd..and we didn't DO anything wrong!!"
:DaEnd
echo #27 & "[2J"
Echo Ansi_4 & "*You've reached DaEnd.  Error code as follows: " & $err & "**"
echo "**" & $planetnumber & " planet number*"
echo "start sector is " & $startsector & "*"
echo "*" & $prompt & " starting prompt*"
echo "*" & $startfuel & " starting fuel*"


Halt


It's turning into a standalone tpad colo script that will
just use the best system after internal calculations. It
will crunch the 3 trips with one load of fuel vs the 2 and
use the most efficient.

I'm just at the route calculation part now...

crosby
Newbie
Newbie

Posts: 69
Join date: 2011-08-26

Back to top Go down

Re: Colo Calculator

Post  Oso on Thu Sep 01, 2011 6:28 pm

That is pretty cool, crosby.

I tried going over the math with my son to show him just how complicated this game can be, beyond READING and not having anything to click on. Very Happy

I would give him some variables and let him calculate how many cycles should be run to be the most efficient.
Sometimes it was two, three, four, or even five depending on the distance, turns, and holds.

I'm still trying to wrap my head around turning the calculations into script, but it is nice to see that you have a good grasp on it.

Oso
Federation Commander
Federation Commander

Posts: 190
Join date: 2011-08-22

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum