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

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

0 Members and 1 Guest are viewing this topic.

anonymous19

  • Newbie
  • *
  • Offline Offline
  • Posts: 24
    • View Profile
AllResToCoords - **Version 2.0 - Updated 2013/10/23**
« on: May 23, 2012, 04:06:55 PM »

Hello guys,
I'm back again with i little script for miners. It collects all your Ressources on your planets/moons by sending them to a target planet/moon.

I finished it a long time ago, but only customized for me, not for a general purpose.

Before you start the script, be aware that you set the config correctly.


The algorithm is basicaly this:
Quote
Bot-Iteration(planet)
1. Iteration begin, Preperation
1.1 Select current (iteration) planet
1.2 if you enabled "updatePlanets", the planet will be updated by OA before continue (takes about 15-20 seconds)
2. Gathering informations
2.1 Read out Ress amount Met+Crystal and Deut (Deut-remainingDeut)
2.2 Get amount of needed LargeCargos, if not enough stored on Planet, go to next Planet - Bot-Iteration(iter.next()) -> 1.1
2.3 Calculation of Trip Consumption
3. Sending the fleet to target planet and give a status message

If you have any questions or ideas for improvement, post it!

AllResToCoords - 1.0
Code: [Select]
//Config
int remainingDeut = 50000 // Deuterium which has to remain on Planet
def targetCoords = "[3:146:8]" // Target Planet Coordinates
def targetName = "Heimatplanet" // Target Planet Name

boolean updatePlanets = true // (true) if you want to update planet before sending, or (false) not. Recommended: (true)

printOut "AllResToCoords v1.0 started!"

//Code (do not enter this area)
Iterator<Planet> iter = getPlanets().iterator()
  while(iter.hasNext())
  {
    Planet p = iter.next();

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

   if(p.coordinates.toString() != targetCoords && p.name != targetName)
   {
    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(capacity < (res+consumption))
  {
    int ncap = (Math.abs(capacity - (res+consumption)))
    lcs = lcs + Math.ceil(ncap/25000)
  }
 
  if(getNumberOf('LARGECARGO', p.coordinates) >= lcs)
  {
    printOut "[Sending "+lcs+" LC's "+met+" Met, "+kris+" Kris and "+deut+" Deut from "+p.name+" to "+targetName+"."
    sendFleetWithResources (p.name,targetCoords,FleetMission.TRANSPORT_MISSION,100,met,kris,deut,[LARGECARGO : lcs])
    printOut " DONE!]"
  }
   }
  }

AllResToCoords - 1.1
http://forum.ogameautomizer.com/index.php/topic,2011.msg12607.html#msg12607

AllResToCoords - 2.0
http://forum.ogameautomizer.com/index.php/topic,2011.msg46968.html#msg46968
« Last Edit: October 23, 2015, 10:00:07 PM by anonymous19 »
Logged

wulf3010

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 447
    • View Profile
Re: AllResToCoords - Version 1.0
« Reply #1 on: May 23, 2012, 06:19:40 PM »

you are a genius. I was waiting for it since day1. Thank you
Logged

wulf3010

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 447
    • View Profile
Re: AllResToCoords - Version 1.0
« Reply #2 on: May 24, 2012, 11:19:14 PM »

I miss a very important thing i believe.
Where is the time that this script is on or do i have to set i manually?
I though about,
execute this script at 8 am, 4 pm 10 pm for example.

EDIT:
Another feature

what if you have one main planet in galaxy 1 and in in g3. Maybe its possible to say: move all ressources from planet 1,3,4,5 to planet 7 = "name1" and 2,6 to planet 8 = "name2" where the first planet in list, like on top, is 0
Add time like: execute name 1 at 6 am and 10 pm and name 2 at 7 am and 11 pm

a more complexx idea would be a calculation when all the transporters arive on 1 given planet.
i though about arive on planet 5 at 22 pm, start from planet 0,1,2,3,4,6,7,8 with "small/big transporters" at "calculated time"

just some ideas

EDIT END





or maybe even better, write a script who manages other scripts with time and execution.

Like

Execute script "ScriptName" at time: 22:00 and 08:00 and ...repeat execution every 6 hours/days/weeks
Do not execute scrips between 01:00 and 07:00 am

would be freaking awesome
« Last Edit: May 25, 2012, 12:20:24 AM by wulf3010 »
Logged

wulf3010

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 447
    • View Profile
Re: AllResToCoords - Version 1.0
« Reply #3 on: June 10, 2012, 02:11:04 PM »

can someone add pls a blacklist, so i can exclude 1 or more planets from this script?
Logged

atx

  • Newbie
  • *
  • Offline Offline
  • Posts: 39
    • View Profile
Re: AllResToCoords - Version 1.0
« Reply #4 on: August 30, 2012, 04:54:57 PM »

Well you wrote it's possible to send to moons, doesnt work for me. When i insert the moon's name it sends everything to the planet.

Any Suggestions ?

----

Got the solution acc. to this thread http://forum.ogameautomizer.com/index.php/topic,1733.0.html.
You just have to change it like that (if your moon is on '3:146:8' and named 'Moon'):
def targetCoords = "[3:146:8]" to def targetCoords = "[3:146:8] Moon"
« Last Edit: August 30, 2012, 05:05:00 PM by atx »
Logged

bohne

  • Newbie
  • *
  • Offline Offline
  • Posts: 44
    • View Profile
Re: AllResToCoords - Version 1.0
« Reply #5 on: September 10, 2012, 10:02:36 AM »

Code: [Select]
08:45:53 : Analysiert Scanberichte
08:50:10 : alle ress zum plani: Script started
08:50:11 : Aktualisiert Flottenaktivitäten : [2:182:4]
08:50:18 : verschicke Flotte : TRANSPORT [2:182:4] -> [3:383:6] Großer Transporter : 35
08:50:45 : Aktualisiert Flottenaktivitäten : [7:132:7]
08:50:59 : verschicke Flotte : TRANSPORT [7:132:7] -> [3:383:6] Großer Transporter : 52
08:51:18 : alle ress zum plani: Script stopped
08:51:24 : alle ress zum plani: Script started
08:51:25 : Aktualisiert Flottenaktivitäten : [x:xxx:x]
08:51:35 : verschicke Flotte : TRANSPORT [x:xxx:x] -> [x:xxx:x] Großer Transporter : 35
08:51:53 : Aktualisiert Flottenaktivitäten : [x:xxx:x]
08:51:59 : verschicke Flotte : TRANSPORT [x:xxx:x] ->[x:xxx:x] Großer Transporter : 52
08:52:20 : Aktualisiert Flottenaktivitäten : [x:xxx:x]
08:52:28 : verschicke Flotte : TRANSPORT[x:xxx:x] -> [x:xxx:x] Großer Transporter : 52
08:52:58 : Aktualisiert Flottenaktivitäten : [x:xxx:x]
08:53:10 : verschicke Flotte : TRANSPORT [x:xxx:x]-> [x:xxx:x]Großer Transporter : 52
08:53:40 : Aktualisiert Flottenaktivitäten : [x:xxx:x]
08:53:58 : Aktualisiert Flottenaktivitäten : [x:xxx:x] Mond
08:54:12 : Aktualisiert Flottenaktivitäten : [x:xxx:x]
08:54:21 : verschicke Flotte : TRANSPORT [7:132:7] -> [3:383:6] Großer Transporter : 28
08:54:23 : planet.getDeuterium() < deuterium
08:54:23 : Cannot send the fleet
08:54:25 : Scanne : x-xxx
08:54:25 : alle ress zum plani: Script stopped

all in all, doesnt work :/
Logged

LittleCat

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 61
    • View Profile
Re: AllResToCoords - Version 1.0
« Reply #6 on: April 14, 2013, 11:36:22 AM »

How can i modify the script to send al res to a moon instead of a planet?
Logged

Chaos-Warrior

  • Newbie
  • *
  • Offline Offline
  • Posts: 20
    • View Profile
Re: AllResToCoords - Version 1.0
« Reply #7 on: April 14, 2013, 11:22:36 PM »

targetCoords = "[1:234:5] anything"
Logged

fireb00n

  • Newbie
  • *
  • Offline Offline
  • Posts: 7
    • View Profile
Re: AllResToCoords - Version 1.0
« Reply #8 on: May 01, 2013, 09:43:40 PM »

what do i have to do if i want to use small cargos instead of big ones,,, and can i  make a change that the script always uses maximum cargos? i think this would be more human... thanks
Logged

sloncina

  • Newbie
  • *
  • Offline Offline
  • Posts: 37
    • View Profile
Re: AllResToCoords - Version 1.0
« Reply #9 on: May 02, 2013, 08:31:29 PM »

Here is modified version that sends small cargo´s and all of them regardless of resource on planet

Code: [Select]
//Config
int remainingDeut = 0 // Deuterium which has to remain on Planet
def targetCoords = "[1:555:5]moon name if it is a moon" // Target Planet Coordinates
def targetName = "planet name or moon name" // Target Planet Name


boolean updatePlanets = true // (true) if you want to update planet before sending, or (false) not. Recommended: (true)

printOut "AllResToCoords v1.0 started!"

Iterator<Planet> iter = getPlanets().iterator()
  while(iter.hasNext())
  {
    Planet p = iter.next();

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

   if(p.coordinates.toString() != targetCoords && p.name != targetName)
   {
    def met = p.getMetal()
  def kris = p.getCrystal()
  def deut = (p.getDeuterium()-remainingDeut)
  int res = (met+kris+deut)
  int lcs = getNumberOf(SMALLCARGO, p.coordinates)
 int capacity = (lcs*5000)


consumption = getTripConsumption( p.coordinates, targetCoords, 100, [ SMALLCARGO : lcs])
 
  if(capacity < (res+consumption))
  {
   int ncap = (Math.abs(capacity - (res+consumption)))
   lcs = lcs + Math.ceil(ncap/5000)
  }
 
  if(getNumberOf(SMALLCARGO, p.coordinates) >= lcs)
  {
   printOut "[Sending "+lcs+" Cargos's "+met+" Met, "+kris+" Kris and "+deut+" Deut from "+p.name+" to "+targetName+"."
 sendFleetWithResources (p.name,targetCoords,FleetMission.TRANSPORT_MISSION,100,met,kris,deut,[SMALLCARGO : lcs])
   
 
    printOut " DONE!]"
  }

  }
  }

Logged

sloncina

  • Newbie
  • *
  • Offline Offline
  • Posts: 37
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #10 on: May 03, 2013, 12:05:39 AM »

Here It's new version 1.1 :)

Basically it's the same thing as original  but it test do you have enough large cargo's/deut if not it test do you have enough large cargo +small cargo/deut and sends that if you do.
At the end it prints out all the planet's that did not make a res transport because they did not have enough cargo or deut on planet

Code: [Select]
//Config
int remainingDeut = 0 // Deuterium which has to remain on Planet
def targetCoords = "[x:xxx:x]moon" // Target Planet Coordinates
def targetName = "moonx" // Target Planet Name
boolean updatePlanets = true // (true) if you want to update planet before sending, or (false) not. Recommended: (true)

printOut "AllResToCoords v1.1 started!"

//Code (do not enter this area)

def message=[]
def resourse=[]
int i=0
int r=0
Iterator<Planet> iter = getPlanets().iterator()
  while(iter.hasNext())
  {
    Planet p = iter.next();

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

   if(p.coordinates.toString() != targetCoords && p.name != targetName)
   {
    def met = p.getMetal()
  def kris = p.getCrystal()
  def deut = (p.getDeuterium()-remainingDeut)
  int res = (met+kris+deut)
  int capOfSmall = 5000*getNumberOf(SMALLCARGO, p.coordinates)
  int capOfLarge = 25000*getNumberOf(LARGECARGO, p.coordinates)
 
if((capOfLarge+capOfSmall)<=res){

message[i]="\nYou dont have enough of cargo ships on planet named >> "+p.name+" << on cordinates "+p.coordinates
resourse[r]="Thease resourse weren't transported "+met+" met "+kris+" deut "+deut
i++
r++

}

else if(capOfLarge>res){
int lcs = Math.ceil(res/25000)
int consumption = getTripConsumption( p.coordinates, targetCoords, 100, [LARGECARGO : lcs])
if(consumption<deut){
   printOut "[Sending Cargos's with: "+met+" Met, "+kris+" Kris and "+deut+" Deut from "+p.name+" to "+targetName+"."
 sendFleetWithResources (p.name,targetCoords,FleetMission.TRANSPORT_MISSION,100,met,kris,deut,[LARGECARGO : lcs])
     printOut " DONE Sending transport from "+p.name}else {
message[i]="\nYou dont have enough of deut for trip on planet named >> "+p.name+" << on cordinates "+p.coordinates
resourse[r]="Thease resourse weren't transported "+met+" met "+kris+" deut "+deut
r++
i++
}
   
 }
else {

int lcs = getNumberOf(LARGECARGO, p.coordinates)
int restres=res-capOfLarge
int scs =Math.ceil(restres/5000)
int consumption = getTripConsumption( p.coordinates, targetCoords, 100, [SMALLCARGO : scs])
if(consumption<deut){
printOut "[Sending Cargos's with: "+met+" Met, "+kris+" Kris and "+deut+" Deut from "+p.name+" to "+targetName+"."
 sendFleetWithResources (p.name,targetCoords,FleetMission.TRANSPORT_MISSION,100,met,kris,deut,[LARGECARGO : lcs,SMALLCARGO : scs])
     printOut " DONE Sending transport from "+p.name}else {

message[i]="\nYou dont have enough of deut for trip on planet named >> "+p.name+" << on cordinates "+p.coordinates
resourse[r]="Thease resourse weren't transported "+met+" met "+kris+" deut "+deut
r++
i++
}

}

 


}
  }
for(x=0; x < i;x++){
printOut message[x]
printOut resourse[x]

}


« Last Edit: May 03, 2013, 08:39:34 PM by sloncina »
Logged

LittleCat

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 61
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #11 on: August 10, 2013, 12:31:06 PM »

Can you add an option to set the minimum resources to start transport?
Now its even starting a transport when there's only 50k of resources on the planet.
I would like to start it from 800k or higher.
Logged

Death

  • Newbie
  • *
  • Offline Offline
  • Posts: 38
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #12 on: August 12, 2013, 05:39:19 PM »

just define your minimum Ressources at " in minRess = "" " for starting a transport. If you have more Ressources the script works as usual, if you have less ressources the scripts skips the planet and goes on with the next one

Quote
if ((kris+met+deut-remainingDeut) < minRess){
    printOut "Avaiblable Ressources on planet" +p.name+ " are less than "+ minRess}

else {


Code: [Select]
//Config
int remainingDeut = 0 // Deuterium which has to remain on Planet
int minRess = 5000000 // minimum Ressources on Planet for starting a Transport
def targetCoords = "[x:xxx:x] Moon" // Target Planet Coordinates
def targetName = "moonx" // Target Planet Name
boolean updatePlanets = true // (true) if you want to update planet before sending, or (false) not. Recommended: (true)


printOut "AllResToCoords v1.1 started!"

//Code (do not enter this area)

def message=[]
def resourse=[]
int i=0
int r=0
Iterator<Planet> iter = getPlanets().iterator()
  while(iter.hasNext())
  {
    Planet p = iter.next();

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

   if(p.coordinates.toString() != targetCoords && p.name != targetName)
   {
    def met = p.getMetal()
  def kris = p.getCrystal()
  def deut = (p.getDeuterium()-remainingDeut)
  int res = (met+kris+deut)
  int capOfSmall = 5000*getNumberOf(SMALLCARGO, p.coordinates)
  int capOfLarge = 25000*getNumberOf(LARGECARGO, p.coordinates)

if ((kris+met+deut-remainingDeut) < minRess){
    printOut "Avaiblable Ressources on planet" +p.name+ " are less than "+ minRess}

else {

   
       
       
if((capOfLarge+capOfSmall)<=res){

message[i]="\nYou dont have enough of cargo ships on planet named >> "+p.name+" << on cordinates "+p.coordinates
resourse[r]="Thease resourse weren't transported "+met+" met "+kris+" deut "+deut
i++
r++

}

else if(capOfLarge>res){
int lcs = Math.ceil(res/25000)
int consumption = getTripConsumption( p.coordinates, targetCoords, 100, [LARGECARGO : lcs])
if(consumption<deut){
   printOut "[Sending Cargos's with: "+met+" Met, "+kris+" Kris and "+deut+" Deut from "+p.name+" to "+targetName+"."
 sendFleetWithResources (p.name,targetCoords,FleetMission.TRANSPORT_MISSION,100,met,kris,deut,[LARGECARGO : lcs])
     printOut " DONE Sending transport from "+p.name}else {
message[i]="\nYou dont have enough of deut for trip on planet named >> "+p.name+" << on cordinates "+p.coordinates
resourse[r]="Thease resourse weren't transported "+met+" met "+kris+" deut "+deut
r++
i++
}
   
 }
else    {

    int lcs = getNumberOf(LARGECARGO, p.coordinates)
    int restres=res-capOfLarge
    int scs =Math.ceil(restres/5000)
int consumption = getTripConsumption( p.coordinates, targetCoords, 100, [SMALLCARGO : scs])
if(consumption<deut){
printOut "[Sending Cargos's with: "+met+" Met, "+kris+" Kris and "+deut+" Deut from "+p.name+" to "+targetName+"."
 sendFleetWithResources (p.name,targetCoords,FleetMission.TRANSPORT_MISSION,100,met,kris,deut,[LARGECARGO : lcs,SMALLCARGO : scs])
     printOut " DONE Sending transport from "+p.name}else {

message[i]="\nYou dont have enough of deut for trip on planet named >> "+p.name+" << on cordinates "+p.coordinates
resourse[r]="Thease resourse weren't transported "+met+" met "+kris+" deut "+deut
r++
i++
}
}
    }

 


}
  }
for(x=0; x < i;x++){
printOut message[x]
printOut resourse[x]

}
« Last Edit: August 12, 2013, 05:41:24 PM by Death »
Logged

wulf3010

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 447
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #13 on: August 14, 2013, 09:12:00 AM »

ist it possible to integrate moons in it and to leave some deut behind.
example i want all ressources from all moon to moon x. I want to start with 10 millionen ressources but 1 million deut should be left behind always.

possible?
Logged

Death

  • Newbie
  • *
  • Offline Offline
  • Posts: 38
    • View Profile
Re: AllResToCoords - Version 1.1
« Reply #14 on: August 14, 2013, 10:53:00 AM »

 About your request to left X-Deut behind. Just define "int remainingDeut =" e.g. "int remainingDeut = 1000000". In this case the script lefts 1kk on your moon.

According to your Request, to fly only from moons: Just enter ""def moon = ">>HERE<<"" the word "moon" in your own ongame language. If you are German, enter "Mond" if you play an english OGame enter "moon" or what ever^^

Quote
   if(p.coordinates.toString() != targetCoords && p.name != targetName && p.coordinates.toString().contains(moon))

Code: [Select]
//Config
int remainingDeut = 0 // Deuterium which has to remain on Planet
int minRess = 0 // minimum Ressources on Planet for starting a Transport
def targetCoords = "[2:50:10]" // Target Planet Coordinates
def targetName = "Mondschein" // Target Planet Name
def moon = "Mond" // enter the String "Moon" on your OGame-language
boolean updatePlanets = true // (true) if you want to update planet before sending, or (false) not. Recommended: (true)


printOut "AllResToCoords v1.1 started!"

//Code (do not enter this area)

def message=[]
def resourse=[]
int i=0
int r=0
Iterator<Planet> iter = getPlanets().iterator()
  while(iter.hasNext())
  {
    Planet p = iter.next();

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

   if(p.coordinates.toString() != targetCoords && p.name != targetName && p.coordinates.toString().contains(moon))
   {
    def met = p.getMetal()
  def kris = p.getCrystal()
  def deut = (p.getDeuterium()-remainingDeut)
  int res = (met+kris+deut)
  int capOfSmall = 5000*getNumberOf(SMALLCARGO, p.coordinates)
  int capOfLarge = 25000*getNumberOf(LARGECARGO, p.coordinates)

if ((kris+met+deut-remainingDeut) < minRess){
    printOut "Avaiblable Ressources on planet" +p.name+ " are less than "+ minRess}

else {
 
       
       
if((capOfLarge+capOfSmall)<=res){

message[i]="\nYou dont have enough of cargo ships on planet named >> "+p.name+" << on cordinates "+p.coordinates
resourse[r]="Thease resourse weren't transported "+met+" met "+kris+" deut "+deut
i++
r++

}

else if(capOfLarge>res){
int lcs = Math.ceil(res/25000)
int consumption = getTripConsumption( p.coordinates, targetCoords, 100, [LARGECARGO : lcs])
if(consumption<deut){
   printOut "[Sending Cargos's with: "+met+" Met, "+kris+" Kris and "+deut+" Deut from "+p.name+" to "+targetName+"."
 sendFleetWithResources (p.name,targetCoords,FleetMission.TRANSPORT_MISSION,100,met,kris,deut,[LARGECARGO : lcs])
     printOut " DONE Sending transport from "+p.name}else {
message[i]="\nYou dont have enough of deut for trip on planet named >> "+p.name+" << on cordinates "+p.coordinates
resourse[r]="Thease resourse weren't transported "+met+" met "+kris+" deut "+deut
r++
i++
}
   
 }
else    {

    int lcs = getNumberOf(LARGECARGO, p.coordinates)
    int restres=res-capOfLarge
    int scs =Math.ceil(restres/5000)
int consumption = getTripConsumption( p.coordinates, targetCoords, 100, [SMALLCARGO : scs])
if(consumption<deut){
printOut "[Sending Cargos's with: "+met+" Met, "+kris+" Kris and "+deut+" Deut from "+p.name+" to "+targetName+"."
 sendFleetWithResources (p.name,targetCoords,FleetMission.TRANSPORT_MISSION,100,met,kris,deut,[LARGECARGO : lcs,SMALLCARGO : scs])
     printOut " DONE Sending transport from "+p.name}else {

message[i]="\nYou dont have enough of deut for trip on planet named >> "+p.name+" << on cordinates "+p.coordinates
resourse[r]="Thease resourse weren't transported "+met+" met "+kris+" deut "+deut
r++
i++
}
}
    }

 


}
  }
for(x=0; x < i;x++){
printOut message[x]
printOut resourse[x]

}
« Last Edit: August 14, 2013, 10:56:57 AM by Death »
Logged
Pages: [1] 2 3 4
 

Page created in 0.058 seconds with 20 queries.