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 ... 6

Author Topic: Easiest way to scan moons with OA Scripting  (Read 30025 times)

0 Members and 1 Guest are viewing this topic.

Devil's Hand

  • Administrator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 2,523
    • View Profile
Re: Easiest way to scan moons with OA Scripting
« Reply #15 on: April 18, 2012, 07:52:41 PM »

no script code => no idea

Regards,
Logged

wulf3010

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 447
    • View Profile
Re: Easiest way to scan moons with OA Scripting
« Reply #16 on: July 27, 2012, 02:39:28 AM »

Where can i put my moon coordinates?

def printPlayer = { player -> masterofdisaster
  printOut player.playerID + "|" + player.playerName + "|" + player.planetName + "\t" +
    player.rank + "\t" +
    player.galaxy + "3" + player.system + "122" + player.planet + "7" + player.isMoon + "\t" +

is this right?
What does "t" mean?

It brings only shit up:
02:40:52 : 101162|Falke|G1   0   17244328119true   6   0   0   No_Ally
02:40:52 : waiting for spies or free fleet slots...
02:40:52 : Has Available Fleet slots: true
02:40:52 : ESPIONAGE PROBEs on planet: 0

What to do to fix?

thanks in advanced
« Last Edit: July 27, 2012, 02:42:43 AM by wulf3010 »
Logged

Devil's Hand

  • Administrator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 2,523
    • View Profile
Re: Easiest way to scan moons with OA Scripting
« Reply #17 on: July 27, 2012, 07:55:33 PM »

Quote
Where can i put my moon coordinates?
Here script decide with which coordinates it should continue.
Code: [Select]
if(player.galaxy==coord.galaxy && player.system>=coord.system-radius && player.system<=coord.system+radius && player.isMoon /*&& player.playerName.equals("Player Name") && player.rank>=XXX*/){
Quote
is this right?
Whatever you code above does, it's not right.
Code: [Select]
def printPlayer = { player -> masterofdisasterit a closure/function declaration, what the hell masterofdisaster is doing there
+ closure not ended with {

Quote
What does "t" mean?
Tabulation, Tab on your keyboard.

Quote
What to do to fix?
I've no idea about what do you want from this script.

Regards,
Logged

wulf3010

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 447
    • View Profile
Re: Easiest way to scan moons with OA Scripting
« Reply #18 on: July 27, 2012, 11:16:33 PM »

Hi Devil,

this is the full script programmed here.

//Definition of function to print a player info
def printPlayer = { player ->
  printOut player.playerID + "|" + player.playerName + "|" + player.planetName + "\t" +
    player.rank + "\t" +
    player.galaxy + ":" + player.system + ":" + player.planet + " " + player.isMoon + "\t" +
    player.globalActivityStatus + "\t" +  //OGamePlayerAbstract.ACTIVE_ACTIVITY_STATUS, INACTIVE_ACTIVITY_STATUS, LONGINACTIVE_ACTIVITY_STATUS, NOOB_ACTIVITY_STATUS, VACATION_ACTIVITY_STATUS, STRONG_ACTIVITY_STATUS, BANNED_ACTIVITY_STATUS, UNKNOWN_ACTIVITY_STATUS
    player.metalDebris + "\t" +
    player.crystalDebris + "\t" +
    (player.allianceID == 0 ? "No_Ally" : player.allianceID + "|" + player.allianceName + "|" + player.allianceRank);
}

def coord = getPlanets().get(0).coordinates
def radius = 20
def spy2send = 2
def iter = getPlayers().iterator()
while(iter.hasNext()){
  def player = iter.next()
  if(player.galaxy==coord.galaxy && player.system>=coord.system-radius && player.system<=coord.system+radius && player.isMoon /*&& player.playerName.equals("Player Name") && player.rank>=XXX*/){
    //print it
    printPlayer player
    //wait till have needed spies
    while(getNumberOf('ESPIONAGEPROBE', coord) < spy2send || !hasAvailableFleetSlot()){
      printOut "waiting for spies or free fleet slots..."
      printOut "Has Available Fleet slots: " + hasAvailableFleetSlot()
      printOut "ESPIONAGE PROBEs on planet: " + getNumberOf('ESPIONAGEPROBE', coord)
      sleep 30000
    }
    //Send a spy ...
    def sent = sendFleet(  //sendFleet function returns a boolean [true,false], Groovy infers the type of 'sent' variable at compile time
      getPlanetFromCoordinates(coord).name,  //Planet Name: "Main Planet"
      new Coordinates(player.galaxy,player.system,player.planet,(player.isMoon ? Coordinates.MOON_TYPE : Coordinates.PLANET_TYPE)),     //Target Coordinates (yours or enemy)
      FleetMission.ESPIONAGE_MISSION,  //Missions: ATTACK_MISSION, TRANSPORT_MISSION, DEPLOYMENT_MISSION, ESPIONAGE_MISSION, COLONIZATION_MISSION, RECYCLE_MISSION, EXPEDITION_MISSION
      100,          //Speed [10-100] means 10%-100%, speed step is 10% => 10,20,30,...,100
      [ESPIONAGEPROBE : spy2send]  //SMALLCARGO, LARGECARGO, LIGHTFIGHTER, HEAVYFIGHTER, CRUISER, BATTLESHIP, COLONYSHIP, RECYCLER, ESPIONAGEPROBE, BOMBER, DESTROYER, DEATHSTAR, BATTLECRUISER
    );
    if(sent) printOut "Fleet sent !"
    else printOut "Fleet sent failed !"
  }
}


wheere i have to put my koordinates from where i want to scan the moons ?
Logged

Devil's Hand

  • Administrator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 2,523
    • View Profile
Re: Easiest way to scan moons with OA Scripting
« Reply #19 on: July 28, 2012, 01:12:31 AM »

Quote
wheere i have to put my koordinates from where i want to scan the moons ?

Code: [Select]
def coord = getPlanets().get(0).coordinatesreplace the line above by the following one:
Code: [Select]
def coord = Coordinates.getCoordinates("[X:Y:Z]")
Regards,
Logged

wulf3010

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 447
    • View Profile
Re: Easiest way to scan moons with OA Scripting
« Reply #20 on: July 28, 2012, 03:03:49 AM »

does OA auto set the coords in? Does OA find the correct planet ?
or do i have to do manually?
Logged

Devil's Hand

  • Administrator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 2,523
    • View Profile
Re: Easiest way to scan moons with OA Scripting
« Reply #21 on: July 28, 2012, 03:33:07 AM »

does OA auto set the coords in? Does OA find the correct planet ?
or do i have to do manually?
It's a script/program, means it does what you program/writeup it to do, not more not less.
Logged

wulf3010

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 447
    • View Profile
Re: Easiest way to scan moons with OA Scripting
« Reply #22 on: July 28, 2012, 04:22:34 AM »

its not my script, i have no clou about the programming language, i am the infrastructure guy. anyways i understand it should scan the moons, but in what range, from which planet ...

that is what i need to know where to set this.
Logged

Devil's Hand

  • Administrator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 2,523
    • View Profile
Re: Easiest way to scan moons with OA Scripting
« Reply #23 on: July 28, 2012, 04:44:33 AM »

.... i understand it should scan the moons, but in what range, from which planet ...

that is what i need to know where to set this.
it sends a defined number of probes from one planet (by default the first one) to targets within defined radius
Code: [Select]
def coord = getPlanets().get(0).coordinates
def radius = 20
def spy2send = 2
« Last Edit: July 28, 2012, 04:48:59 AM by Devil's Hand »
Logged

wulf3010

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 447
    • View Profile
Re: Easiest way to scan moons with OA Scripting
« Reply #24 on: July 28, 2012, 01:47:30 PM »

what happen if the default one is in galaxy 1 and i want to scan galaxy 7

the spios wont be send out, to less deut

can you modify it so i can tell the programm from which moon he should scann?
Logged

Devil's Hand

  • Administrator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 2,523
    • View Profile
Re: Easiest way to scan moons with OA Scripting
« Reply #25 on: July 28, 2012, 02:27:38 PM »

what happen if the default one is in galaxy 1 and i want to scan galaxy 7

the spios wont be send out, to less deut

can you modify it so i can tell the programm from which moon he should scann?
I'm not here to explain every line of code. This script is the simplest example of how you can do an automatic enemies scan.
I take only the responsibility to provide an API and explanation about how to use it. I'm not here to create scripts at your wishes.

Regards,
Logged

wulf3010

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 447
    • View Profile
Re: Easiest way to scan moons with OA Scripting
« Reply #26 on: July 28, 2012, 08:08:44 PM »

alright, thank you for your help, it was just a question since i am not be able to program by myself
Logged

wulf3010

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 447
    • View Profile
Re: Easiest way to scan moons with OA Scripting
« Reply #27 on: July 31, 2012, 09:34:12 PM »

can someone else help me out here. What i have to do to make the script work for my purpose, to tell the script from which planet and in which galaxy it has to scan the moons?
Logged

kuite

  • Guest
Re: Easiest way to scan moons with OA Scripting
« Reply #28 on: September 21, 2012, 11:17:59 PM »

Hello everybody, this is my first post here, but make it quick : script by Devil doesn't work for me ( i mean, its working except range - he try to scan from 4 to 1 galaxy) , but it is fine as long as this script is perfect
Code: [Select]
Re: Easiest way to scan moons with OA Scripting
« Reply #18 on: July 27, 2012, 11:16:33 PM »
Quote
Hi Devil,

this is the full script programmed here.

//Definition of function to print a player info
def printPlayer = { player ->
  printOut player.playerID + "|" + player.playerName + "|" + player.planetName + "\t" +
    player.rank + "\t" +
    player.galaxy + ":" + player.system + ":" + player.planet + " " + player.isMoon + "\t" +
    player.globalActivityStatus + "\t" +  //OGamePlayerAbstract.ACTIVE_ACTIVITY_STATUS, INACTIVE_ACTIVITY_STATUS, LONGINACTIVE_ACTIVITY_STATUS, NOOB_ACTIVITY_STATUS, VACATION_ACTIVITY_STATUS, STRONG_ACTIVITY_STATUS, BANNED_ACTIVITY_STATUS, UNKNOWN_ACTIVITY_STATUS
    player.metalDebris + "\t" +
    player.crystalDebris + "\t" +
    (player.allianceID == 0 ? "No_Ally" : player.allianceID + "|" + player.allianceName + "|" + player.allianceRank);
}

def coord = getPlanets().get(0).coordinates
def radius = 20
def spy2send = 2
def iter = getPlayers().iterator()
while(iter.hasNext()){
  def player = iter.next()
  if(player.galaxy==coord.galaxy && player.system>=coord.system-radius && player.system<=coord.system+radius && player.isMoon /*&& player.playerName.equals("Player Name") && player.rank>=XXX*/){
    //print it
    printPlayer player
    //wait till have needed spies
    while(getNumberOf('ESPIONAGEPROBE', coord) < spy2send || !hasAvailableFleetSlot()){
      printOut "waiting for spies or free fleet slots..."
      printOut "Has Available Fleet slots: " + hasAvailableFleetSlot()
      printOut "ESPIONAGE PROBEs on planet: " + getNumberOf('ESPIONAGEPROBE', coord)
      sleep 30000
    }
    //Send a spy ...
    def sent = sendFleet(  //sendFleet function returns a boolean [true,false], Groovy infers the type of 'sent' variable at compile time
      getPlanetFromCoordinates(coord).name,  //Planet Name: "Main Planet"
      new Coordinates(player.galaxy,player.system,player.planet,(player.isMoon ? Coordinates.MOON_TYPE : Coordinates.PLANET_TYPE)),     //Target Coordinates (yours or enemy)
      FleetMission.ESPIONAGE_MISSION,  //Missions: ATTACK_MISSION, TRANSPORT_MISSION, DEPLOYMENT_MISSION, ESPIONAGE_MISSION, COLONIZATION_MISSION, RECYCLE_MISSION, EXPEDITION_MISSION
      100,          //Speed [10-100] means 10%-100%, speed step is 10% => 10,20,30,...,100
      [ESPIONAGEPROBE : spy2send]  //SMALLCARGO, LARGECARGO, LIGHTFIGHTER, HEAVYFIGHTER, CRUISER, BATTLESHIP, COLONYSHIP, RECYCLER, ESPIONAGEPROBE, BOMBER, DESTROYER, DEATHSTAR, BATTLECRUISER
    );
    if(sent) printOut "Fleet sent !"
    else printOut "Fleet sent failed !"
  }
}

unfortunatley, this script only spying moon, however, it should spy planets (looking in code). Where is a problem, any ideas ?
Logged

Devil's Hand

  • Administrator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 2,523
    • View Profile
Re: Easiest way to scan moons with OA Scripting
« Reply #29 on: September 22, 2012, 12:22:33 AM »

Quote
unfortunatley, this script only spying moon, however, it should spy planets (looking in code). Where is a problem, any ideas ?
Quote
if(player.galaxy==coord.galaxy && player.system>=coord.system-radius && player.system<=coord.system+radius && player.isMoon
Regards,
Logged
Pages: 1 [2] 3 4 ... 6
 

Page created in 0.053 seconds with 20 queries.