OGame Automizer Development Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome on the OGame Automizer Development/Support Forum

If this is your first visit, be sure to check out the
http://ogameautomizer.com/doc/manual.html : A guide written by OA users with consultation of OA author (En)

http://ogameautomizer.com/doc/manual_de.html : A guide written by OA users with consultation of OA author (Benutzerschnittstellenhandbuch) (GE)

http://ogameautomizer.com/doc/scripting_manual.html : OA Scripting Manual (En)

Pages: 1 2 [3] 4 5

Author Topic: AllResToCoords - **Version 2.0 - Updated 2013/10/23**  (Read 22208 times)

0 Members and 1 Guest are viewing this topic.

Kaelan

  • Newbie
  • *
  • Offline Offline
  • Posts: 8
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #30 on: January 18, 2014, 12:49:01 AM »

Which Version of OA have you?
Logged

o2o

  • Newbie
  • *
  • Offline Offline
  • Posts: 26
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #31 on: January 18, 2014, 08:45:05 AM »

I am not entirely sure how to tell however in your <installation directory> there is a readme.txt file.  Within that file the Changelog for me ends at .123 but release dates end a v0.99 2008/05/15??  Is your's the same?

Alternatively, within the same directory, what is the size of the file: ogameautomiser.jar?  Mine appears as 1480KB (1.48MB) and if you open properties it displays as 1.44MB (1,514,708bytes)  If it's the same we can assume we have the same version.
Logged

Kaelan

  • Newbie
  • *
  • Offline Offline
  • Posts: 8
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #32 on: January 18, 2014, 12:52:29 PM »

So Changelog we have the same but my .jar file is a litte bit smaler
Logged

Kaelan

  • Newbie
  • *
  • Offline Offline
  • Posts: 8
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #33 on: January 18, 2014, 01:50:55 PM »

I have now the newest update but the script dont send the fleet to my mond -.-
Logged

o2o

  • Newbie
  • *
  • Offline Offline
  • Posts: 26
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #34 on: January 19, 2014, 12:12:21 PM »

I think you need someone with more API experience to help  - sorry.  I just don't know any other ideas.  I am guessing it is still down to co-ordinates/names but I can't be certain.

Mine did something similar the other day - sent all the res to the planet but it was because of the first thing I mentioned.  I didn't have the moon name next to the targetcoords.

sorry
Logged

Buffoflyby

  • Guest
Re: AllResToCoords - Version 1.1
« Reply #35 on: August 27, 2014, 09:20:30 PM »

Kaelan
I think you need to have a space between your planets coords and the name of the moon
I use this script http://forum.ogameautomizer.com/index.php/topic,2011.msg12607.html#msg12607

and after the planet coords make sure theres a space before your moons name
[x:xxx:x] moon

Anyhow, very nice work from the scriptmakers, makes OA a even better tool.

Logged

takan

  • Newbie
  • *
  • Offline Offline
  • Posts: 20
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #36 on: October 12, 2014, 05:35:43 PM »

 Please, use upwards for any complex fleet sending/recalling OA fluid API: Fleet Builder

is there an update?
Logged

o2o

  • Newbie
  • *
  • Offline Offline
  • Posts: 26
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #37 on: October 13, 2014, 01:11:42 AM »

Please, use upwards for any complex fleet sending/recalling OA fluid API: Fleet Builder

is there an update?

I've been getting this since the most recent update (I am on v1.0.23) - still sends the fleets but also produces the above message.
Logged

troniac

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 358
  • Rue de Bruxelles, 5000 Namur, Belgium
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #38 on: October 14, 2014, 03:37:19 PM »

It still works you should use the new Function because the old one will not be maintaned anymore.
Logged
Je'sui Brussels

takan

  • Newbie
  • *
  • Offline Offline
  • Posts: 20
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #39 on: October 21, 2014, 11:01:45 AM »

It still works you should use the new Function because the old one will not be maintaned anymore.

i dont know nohting about scripting. so i dont have a clue what i should change.

can someone help me with this?
Logged

Skippermix

  • Newbie
  • *
  • Offline Offline
  • Posts: 25
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #40 on: December 26, 2014, 11:41:37 PM »

When I use the version with minRes I often get "metal on planet < metal to transport" and then it aint flying
Logged

anonymous19

  • Newbie
  • *
  • Offline Offline
  • Posts: 24
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #41 on: October 23, 2015, 09:58:41 PM »

Hello guys, im back with a new version for you!

I hope you will like it. There a some new features and cleanups.

Feel free to report bugs and ask questions. Or simple ask for new features and maybe I will implement it...

Check out the - incomplete, but mentioning the important changes - changelog:

AllRessToCoords v2.0 (based on AllRessToCoords v1.0)
- Fleet sending now bases on Fluid API from OA
- Implemented a blacklist. You can add planets/moons to the blacklist, when you want them to get ignored in the transportation process
- Variable "minRessources" to specify a minimum of sum ressources to transport. If planet has less ressources => dont transport
- Variable "avoidMoons" to generally avoid moons in the transportation process
- Variable "maxDeutConsumption" to specify a limit of maximum deuterium costs for a transport. If limit exceeded => dont transport ress
- Variable "speed" to set the speed of the fleet
- In case of fleet sending errors because of connection issues, trys to resend certain times (see config)
- Shows how much ressources have been transported
- Better error exceptions

Please remember to use an up-to-date OgameAutomizer version! Otherwise the script wont work.
I recommend to download the latest OA version for the new OgameV6:
http://ogameautomizer.com/BetaVersion/OGameAutomizer.jar

Script:
Code: [Select]
//                                               ______
//  ___ ____  ___  ___  __ ____ _  ___  __ _____<  / _ \
// / _ `/ _ \/ _ \/ _ \/ // /  ' \/ _ \/ // (_-</ /\_, /
// \_,_/_//_/\___/_//_/\_, /_/_/_/\___/\_,_/___/_//___/
//                    /___/     
                       
//[[Hints]]
//Attention: Before running this script, the planets should be updated. If they are'nt, the script will not work. To ensure the updating, set 'updatePlanets=true' in config.
//Warning: When you don't have enough LCs on a specific Planet, the Transport will not happen. Remember to leave enough LCs on your Planets.
ArrayList<String> blacklist = new ArrayList<String>();

//[[Config]]
int remainingDeut = 300000 // Deuterium which has to remain on Planet
int minRessources = 500000 // Minimum of Ressources that will be transported. If planet has less ressources => dont transport. (0 if you want to send everything)
int maxDeutConsumption = 0 // Maximum costs of Deuterium which is allowed to transport (0 for infinity)
def targetCoords = "[1:1:1] Moon" // Target Planet Coordinates (for targetting a moon, append "[X:Y:Z] Moon" (Moon in your Language, f.ex. in german: "Mond").
boolean avoidMoons = false // (true) if you don't want to send ressources from a moon, otherwise (false)
int speed = 100 // Percentage of Fleet-Speed (100 <=> 100%)

boolean updatePlanets = true // (true) if you want to update planet before sending, or (false) not. Recommended: (true)
int trys = 2 // In Case of Errors (f.ex. a lost connection) the script will retry to send the specific transport again ("trys" represents the number of retrys)

// Blacklist
// if you want to add a planet to the blacklist: blacklist.add("[1:30:4 Moon]")
// blacklist.add("[1:1:1]");

//[[Code]] (please do not enter this area!)
int sumMet = 0
int sumKris = 0
int sumDeut = 0

printOut "AllResToCoords v2.0 by anonymous19 started!"

Iterator<Planet> iter = getPlanets().iterator()

while(iter.hasNext())
{
  Planet p = iter.next();
 
  if(avoidMoons && p.coordinates.isMoon())
  {
    printOut "[Coordinate "+p.coordinates+" is a moon, config says avoid moons, so no transport happens.]"
    continue
  }

  if(updatePlanets)
  {
   printOut "[Updating Planet "+p.coordinates
   updatePlanetCoord(p.coordinates)
   printOut " DONE! ]"
  }

 if(p.coordinates.toString() != targetCoords)
 {
  if(blacklist.contains(p.coordinates))
  {
   printOut "[Planet/Moon "+p.coordinates+" is blacklisted! So next.]"
   continue
  }
 
  def met = p.getMetal()
  def kris = p.getCrystal()
  def deut = (p.getDeuterium()-remainingDeut)
  int res = (met+kris+deut)
  int lcs = Math.ceil(res/25000)
  int capacity = (lcs*25000)
  int consumption = getTripConsumption(p.coordinates, targetCoords, 100, [LARGECARGO : lcs])

  if(maxDeutConsumption>0 && consumption>maxDeutConsumption)
  {
   printOut "[Maximum deuterium costs exceeded for transport at "+p.coordinates+"("+consumption+" deut).]"
   continue
  }
 
  if(capacity < (res+consumption))
  {
   int ncap = (Math.abs(capacity - (res+consumption)))
   lcs = lcs + Math.ceil(ncap/25000)
  }

  if(res < minRessources)
  {
   printOut "[No transport from "+p.coordinates+", because the minimum ressource amount was not reached!]"
  }
  else
  {
   if(getNumberOf('LARGECARGO', p.coordinates) >= lcs)
   {
    printOut "[Sending "+lcs+" lc's with "+met+" metal, "+kris+" crystal and "+deut+" deuterium from "+p.name+" "+p.coordinates+" to "+targetCoords+"."
    int c=0
   
    while(c<trys)
    {
     def fleet1 = getBuilderFactory().newFleet()
      .setFrom(p.coordinates)
      .setTarget(targetCoords)
      .setMission(TRANSPORT_MISSION)
      .addShips(LARGECARGO: lcs)
      .setMetal(met)
      .setCrystal(kris)
      .setDeuterium(deut)
      .setSpeed(speed) 
     if(fleet1.sendNow())
     {
      printOut " DONE!]"
      sumMet+=met
      sumKris+=kris
      sumDeut+=deut
      break
     }
     else
     {
       printOut "Try #"+c+"/"+trys
       c++
     }
    }
   
    if(c>=trys){ printOut " unknown ERROR!]" }
   }
  else
  {
    printOut "[Not enough large cargos to transport all ressources!]"
  }
  }
 }
 else
 {
  printOut "[No transport from "+p.name+"("+p.coordinates+") because it is the target planet!]"
 }
}
printOut "AllResToCoords finished! If you want to repeat the Transports, restart Script!"
printOut "[Total Payload: "+sumMet+" Metal, "+sumKris+" Crystal, "+sumDeut+" Deuterium]"

bouky

  • Newbie
  • *
  • Offline Offline
  • Posts: 6
    • View Profile
Re: AllResToCoords - **Version 2.0 - Updated 2013/10/23**
« Reply #42 on: March 21, 2016, 06:12:39 PM »

when no enough ship I tried to make send max ressources as possible. first deut then cris and finally met

/!\  ==> I don't know if it works I didn't try it yet <==  /!\


Code: [Select]
//                  ______
//
//
//  ___ ____  ___  ___  __ ____ _  ___  __ _____<  / _ \
// / _ `/ _ \/ _ \/ _ \/ // /  ' \/ _ \/ // (_-</ /\_, /
// \_,_/_//_/\___/_//_/\_, /_/_/_/\___/\_,_/___/_//___/
//                    /___/     
                       
//[[Hints]]
//Attention: Before running this script, the planets should be updated. If they are'nt, the script will not work. To ensure the updating, set 'updatePlanets=true' in config.
//Warning: When you don't have enough LCs on a specific Planet, the Transport will not happen. Remember to leave enough LCs on your Planets.
ArrayList<String> blacklist = new ArrayList<String>();

//[[Config]]
int remainingDeut = 300000 // Deuterium which has to remain on Planet
int minRessources = 1000000 // Minimum of Ressources that will be transported. If planet has less ressources => dont transport. (0 if you want to send everything)
int maxDeutConsumption = 0 // Maximum costs of Deuterium which is allowed to transport (0 for infinity)
def targetCoords = "[3:489:12] Lune" // Target Planet Coordinates (for targetting a moon, append "[X:Y:Z] Moon" (Moon in your Language, f.ex. in german: "Mond").
boolean avoidMoons = false // (true) if you don't want to send ressources from a moon, otherwise (false)
int speed = 100 // Percentage of Fleet-Speed (100 <=> 100%)

boolean updatePlanets = true // (true) if you want to update planet before sending, or (false) not. Recommended: (true)
int trys = 200 // In Case of Errors (f.ex. a lost connection) the script will retry to send the specific transport again ("trys" represents the number of retrys)

// Blacklist
// if you want to add a planet to the blacklist: blacklist.add("[1:30:4 Moon]")
// blacklist.add("[3:489:12]");

//[[Code]] (please do not enter this area!)
int sumMet = 0
int sumKris = 0
int sumDeut = 0

printOut "AllResToCoords v2.0 by anonymous19 started!"

Iterator<Planet> iter = getPlanets().iterator()

while(iter.hasNext())
{
  Planet p = iter.next();
 
  if(avoidMoons && p.coordinates.isMoon())
  {
    printOut "[Coordinate "+p.coordinates+" is a moon, config says avoid moons, so no transport happens.]"
    continue
  }

  if(updatePlanets)
  {
   printOut "[Updating Planet "+p.coordinates
   updatePlanetCoord(p.coordinates)
   printOut " DONE! ]"
  }

 if(p.coordinates.toString() != targetCoords)
 {
  if(blacklist.contains(p.coordinates))
  {
   printOut "[Planet/Moon "+p.coordinates+" is blacklisted! So next.]"
   continue
  }
 
  def met = p.getMetal()
  def kris = p.getCrystal()
  def deut = (p.getDeuterium()-remainingDeut)
  int res = (met+kris+deut)
  int lcs = Math.ceil(res/25000)
  int capacity = (lcs*25000)
  int consumption = getTripConsumption(p.coordinates, targetCoords, 100, [LARGECARGO : lcs])

  if(maxDeutConsumption>0 && consumption>maxDeutConsumption)
  {
   printOut "[Maximum deuterium costs exceeded for transport at "+p.coordinates+"("+consumption+" deut).]"
   continue
  }
 
  if(capacity < (res+consumption))
  {
   int ncap = (Math.abs(capacity - (res+consumption)))
   lcs = lcs + Math.ceil(ncap/25000)
  }

  if(res < minRessources)
  {
   printOut "[No transport from "+p.coordinates+", because the minimum ressource amount was not reached!]"
  }
  else
  {
   if(getNumberOf('LARGECARGO', p.coordinates) >= lcs)
   {
    printOut "[Sending "+lcs+" lc's with "+met+" metal, "+kris+" crystal and "+deut+" deuterium from "+p.name+" "+p.coordinates+" to "+targetCoords+"."
    int c=0
   
    while(c<trys)
    {
     def fleet1 = getBuilderFactory().newFleet()
      .setFrom(p.coordinates)
      .setTarget(targetCoords)
      .setMission(DEPLOYMENT_MISSION)
      .addShips(LARGECARGO: lcs)
      .setMetal(met)
      .setCrystal(kris)
      .setDeuterium(deut)
      .setSpeed(speed)
     if(fleet1.sendNow())
     {
      printOut " DONE!]"
      sumMet+=met
      sumKris+=kris
      sumDeut+=deut
      break
     }
     else
     {
       printOut "Try #"+c+"/"+trys
       c++
     }
    }
   
    if(c>=trys){ printOut " unknown ERROR!]" }
   }
  else
  {
    printOut "[Not enough large cargos to transport all ressources!]"
    // Debut modif
    GTdispo = getNumberOf('LARGECARGO', p.coordinates)
    fretdispo = GTdispo*25000
    def fleet1 = getBuilderFactory().newFleet()
      .setFrom(p.coordinates)
      .setTarget(targetCoords)
      .setMission(DEPLOYMENT_MISSION)
      .addShips(LARGECARGO: GTdispo)
      .setSpeed(speed)
    if ( deut > fretdispo){  
      fleet1.setDeuterium(fretdispo)}
    if (deut < fretdispo && kris > fretdispo-deut){
      fleet1.setDeuterium(deut).setCrystal(fretdispo-deut)}
    if (deut < fretdispo && kris <fretdispo-deut && met >fretdispo-(deut+kris)){
      fleet.setDeuterium(deut).setCrystal(fretdispo-deut).setMetal(fretdispo-(deut+kris))}
      if(fleet1.sendNow()) {printOut "max res sent"} // Fin modif
  }
  }
 }
 else
 {
  printOut "[No transport from "+p.name+"("+p.coordinates+") because it is the target planet!]"
 }
}
printOut "AllResToCoords finished! If you want to repeat the Transports, restart Script!"
printOut "[Total Payload: "+sumMet+" Metal, "+sumKris+" Crystal, "+sumDeut+" Deuterium]"

« Last Edit: March 21, 2016, 07:02:51 PM by bouky »
Logged

JotZet

  • Newbie
  • *
  • Offline Offline
  • Posts: 10
    • View Profile
Re: AllResToCoords - **Version 2.0 - Updated 2013/10/23**
« Reply #43 on: July 08, 2016, 09:13:00 AM »

when no enough ship I tried to make send max ressources as possible. first deut then cris and finally met

/!\  ==> I don't know if it works I didn't try it yet <==  /!\


Code: [Select]
//                  ______
//
//
//  ___ ____  ___  ___  __ ____ _  ___  __ _____<  / _ \
// / _ `/ _ \/ _ \/ _ \/ // /  ' \/ _ \/ // (_-</ /\_, /
// \_,_/_//_/\___/_//_/\_, /_/_/_/\___/\_,_/___/_//___/
//                    /___/     
                       
//[[Hints]]
//Attention: Before running this script, the planets should be updated. If they are'nt, the script will not work. To ensure the updating, set 'updatePlanets=true' in config.
//Warning: When you don't have enough LCs on a specific Planet, the Transport will not happen. Remember to leave enough LCs on your Planets.
ArrayList<String> blacklist = new ArrayList<String>();

//[[Config]]
int remainingDeut = 300000 // Deuterium which has to remain on Planet
int minRessources = 1000000 // Minimum of Ressources that will be transported. If planet has less ressources => dont transport. (0 if you want to send everything)
int maxDeutConsumption = 0 // Maximum costs of Deuterium which is allowed to transport (0 for infinity)
def targetCoords = "[3:489:12] Lune" // Target Planet Coordinates (for targetting a moon, append "[X:Y:Z] Moon" (Moon in your Language, f.ex. in german: "Mond").
boolean avoidMoons = false // (true) if you don't want to send ressources from a moon, otherwise (false)
int speed = 100 // Percentage of Fleet-Speed (100 <=> 100%)

boolean updatePlanets = true // (true) if you want to update planet before sending, or (false) not. Recommended: (true)
int trys = 200 // In Case of Errors (f.ex. a lost connection) the script will retry to send the specific transport again ("trys" represents the number of retrys)

// Blacklist
// if you want to add a planet to the blacklist: blacklist.add("[1:30:4 Moon]")
// blacklist.add("[3:489:12]");

//[[Code]] (please do not enter this area!)
int sumMet = 0
int sumKris = 0
int sumDeut = 0

printOut "AllResToCoords v2.0 by anonymous19 started!"

Iterator<Planet> iter = getPlanets().iterator()

while(iter.hasNext())
{
  Planet p = iter.next();
 
  if(avoidMoons && p.coordinates.isMoon())
  {
    printOut "[Coordinate "+p.coordinates+" is a moon, config says avoid moons, so no transport happens.]"
    continue
  }

  if(updatePlanets)
  {
   printOut "[Updating Planet "+p.coordinates
   updatePlanetCoord(p.coordinates)
   printOut " DONE! ]"
  }

 if(p.coordinates.toString() != targetCoords)
 {
  if(blacklist.contains(p.coordinates))
  {
   printOut "[Planet/Moon "+p.coordinates+" is blacklisted! So next.]"
   continue
  }
 
  def met = p.getMetal()
  def kris = p.getCrystal()
  def deut = (p.getDeuterium()-remainingDeut)
  int res = (met+kris+deut)
  int lcs = Math.ceil(res/25000)
  int capacity = (lcs*25000)
  int consumption = getTripConsumption(p.coordinates, targetCoords, 100, [LARGECARGO : lcs])

  if(maxDeutConsumption>0 && consumption>maxDeutConsumption)
  {
   printOut "[Maximum deuterium costs exceeded for transport at "+p.coordinates+"("+consumption+" deut).]"
   continue
  }
 
  if(capacity < (res+consumption))
  {
   int ncap = (Math.abs(capacity - (res+consumption)))
   lcs = lcs + Math.ceil(ncap/25000)
  }

  if(res < minRessources)
  {
   printOut "[No transport from "+p.coordinates+", because the minimum ressource amount was not reached!]"
  }
  else
  {
   if(getNumberOf('LARGECARGO', p.coordinates) >= lcs)
   {
    printOut "[Sending "+lcs+" lc's with "+met+" metal, "+kris+" crystal and "+deut+" deuterium from "+p.name+" "+p.coordinates+" to "+targetCoords+"."
    int c=0
   
    while(c<trys)
    {
     def fleet1 = getBuilderFactory().newFleet()
      .setFrom(p.coordinates)
      .setTarget(targetCoords)
      .setMission(DEPLOYMENT_MISSION)
      .addShips(LARGECARGO: lcs)
      .setMetal(met)
      .setCrystal(kris)
      .setDeuterium(deut)
      .setSpeed(speed)
     if(fleet1.sendNow())
     {
      printOut " DONE!]"
      sumMet+=met
      sumKris+=kris
      sumDeut+=deut
      break
     }
     else
     {
       printOut "Try #"+c+"/"+trys
       c++
     }
    }
   
    if(c>=trys){ printOut " unknown ERROR!]" }
   }
  else
  {
    printOut "[Not enough large cargos to transport all ressources!]"
    // Debut modif
    GTdispo = getNumberOf('LARGECARGO', p.coordinates)
    fretdispo = GTdispo*25000
    def fleet1 = getBuilderFactory().newFleet()
      .setFrom(p.coordinates)
      .setTarget(targetCoords)
      .setMission(DEPLOYMENT_MISSION)
      .addShips(LARGECARGO: GTdispo)
      .setSpeed(speed)
    if ( deut > fretdispo){  
      fleet1.setDeuterium(fretdispo)}
    if (deut < fretdispo && kris > fretdispo-deut){
      fleet1.setDeuterium(deut).setCrystal(fretdispo-deut)}
    if (deut < fretdispo && kris <fretdispo-deut && met >fretdispo-(deut+kris)){
      fleet.setDeuterium(deut).setCrystal(fretdispo-deut).setMetal(fretdispo-(deut+kris))}
      if(fleet1.sendNow()) {printOut "max res sent"} // Fin modif
  }
  }
 }
 else
 {
  printOut "[No transport from "+p.name+"("+p.coordinates+") because it is the target planet!]"
 }
}
printOut "AllResToCoords finished! If you want to repeat the Transports, restart Script!"
printOut "[Total Payload: "+sumMet+" Metal, "+sumKris+" Crystal, "+sumDeut+" Deuterium]"


Doesn´t work for me :(
Would be awesome if somebody could implement that, because that´s exactly what I´m looking for.

If there are not enough LG and SC available, just send all available Cargos with MaxResources (DCM, or MCD, or configurable)
Logged

AnonymousUser

  • Newbie
  • *
  • Offline Offline
  • Posts: 11
    • View Profile
Re: AllResToCoords - **Version 2.0 - Updated 2013/10/23**
« Reply #44 on: July 19, 2016, 04:02:16 AM »

Works perfect! great script!
Logged
Pages: 1 2 [3] 4 5
 

Page created in 0.066 seconds with 20 queries.