Help saving data?

Jump to navigation Jump to search
Revision as of 21 December 2013 at 18:53.
The highlighted comment was edited in this revision. [diff]

Help saving data?

I don't know java files very well, and I want to have a bot record some data for research. Whenever I try to make a file to record stuff in, robocode stops the bot. I am trying to create a file in the robot's data directory, but I must be doing something wrong. How do you specify a path to a directory in which you are allowed to write?

    Straw (talk)06:33, 21 December 2013

    You can use AdvancedRobot.getDataDirectory() to get the path you're allowed to write in. Alternatively, you can use AdavancedRobot.getDataFile(String filename)

    To enforce the write quota, Robocode also requires that you write to the file using RobocodeFileOutputStream or RobocodeFileWriter (instead of FileOutputStream or OutputStreamWriter)

    (and, as is mentioned on Saving Gun Data of course you can adjust the write quota)

      Rednaxela (talk)07:18, 21 December 2013

      Thanks.

        Straw (talk)10:59, 21 December 2013

        Straw the write quota has to be 200 kb or below in order to roborumble P.S what data is saved P.S what kd tree are you using

          Tmservo (talk)20:44, 21 December 2013