Thread: Location Logger

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 Location Logger 
    The One And Only

    KaiserCo's Avatar
    Join Date
    Dec 2010
    Posts
    2,420
    Thanks given
    509
    Thanks received
    445
    Rep Power
    209
    Code:
    if (playerCommand.startsWith("c") && playerCommand.length() > 2) {
    	   try {
    	   BufferedWriter coord = new BufferedWriter(new FileWriter("./Data/Coords.txt", true));
    	   String location = playerCommand.substring(2);
    	   try {	
    		coord.write("X: "+c.absX+" Y: "+c.absY+" H: "+c.heightLevel+" L: "+location);
    		c.sendMessage("You have successfully logged a location.");
    		coord.newLine();
    		} finally {
    		coord.close();
    		}
    		} catch (IOException e) {
    	                e.printStackTrace();
    		}
    	}
    Basically I use this for if I find an area I like and don't feel like opening up notepad or whatever to save the coordinates I can just type ::c (location) and it will automatically save the X coord, Y coord, and my height, as well with what area it is in a file in the server, that makes it cleaner and easier to save locations as well as find them later on.. Here is what it will look like when it saves into the file..

    X: 3232 Y: 3231 H: 0 L: Lumbridge
    X: 3210 Y: 3424 H: 0 L: Varrock
    X: 2964 Y: 3378 H: 0 L: Falador
    X: 3102 Y: 3489 H: 0 L: Edgeville
    Usage:
    In game go to whatever location you want, say lumbridge, then do..
    ::c Lumbridge
    And It will save the coordinates along with the name you provided in coords.txt in your data folder.
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    Banned

    Join Date
    Apr 2012
    Age
    24
    Posts
    2,948
    Thanks given
    1,126
    Thanks received
    1,081
    Rep Power
    0
    I did the same thing sort of when developing my server. It's a useful command
    Reply With Quote  
     

  4. #3  
    Father Of Lies


    Join Date
    May 2012
    Age
    23
    Posts
    1,216
    Thanks given
    267
    Thanks received
    289
    Rep Power
    242
    I did this but with npc spawns, it wrote to xml your current location and the npc's Id
    Reply With Quote  
     

  5. #4  
    Registered Member

    Join Date
    Aug 2012
    Posts
    3,161
    Thanks given
    2,843
    Thanks received
    855
    Rep Power
    2235
    Thanks for this. Very useful
    Reply With Quote  
     

  6. #5  
    Pile of Junk
    Awvik's Avatar
    Join Date
    Dec 2011
    Posts
    46
    Thanks given
    23
    Thanks received
    6
    Rep Power
    11
    Thanks actually looks pretty useful
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #6  
    Registered Member
    LeBron James's Avatar
    Join Date
    Jan 2009
    Posts
    1,510
    Thanks given
    166
    Thanks received
    129
    Rep Power
    165
    Very useful thanks!



    Reply With Quote  
     

  8. #7  
    Donator


    Join Date
    Jun 2011
    Posts
    2,555
    Thanks given
    539
    Thanks received
    402
    Rep Power
    658
    Really useful, nice snippet!
    All the best,
    Nirvana

    Reply With Quote  
     

  9. #8  
    Registered Member Obito Uchiha's Avatar
    Join Date
    Oct 2010
    Posts
    767
    Thanks given
    2
    Thanks received
    30
    Rep Power
    46
    Nice tut brah and i see your a obito fan aswell
    Reply With Quote  
     

  10. #9  
    The One And Only

    KaiserCo's Avatar
    Join Date
    Dec 2010
    Posts
    2,420
    Thanks given
    509
    Thanks received
    445
    Rep Power
    209
    Thanks for the positive feedback everyone.

    Quote Originally Posted by obito uchiha View Post
    Nice tut brah and i see your a obito fan aswell
    Obito's a fucking badass!
    Reply With Quote  
     

  11. #10  
    Registered Member Obito Uchiha's Avatar
    Join Date
    Oct 2010
    Posts
    767
    Thanks given
    2
    Thanks received
    30
    Rep Power
    46
    Quote Originally Posted by Steve Smith View Post
    Thanks for the positive feedback everyone.



    Obito's a fucking badass!
    Agreed and also a very old hero of our's but for now badass wannabe gangsta but i still think hes the coolest character in naruto because of this
    Those who abadon their friend's is worse than trash !
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Simple Logger
    By Mister Maggot in forum Application Development
    Replies: 38
    Last Post: 05-25-2011, 06:51 AM
  2. Simple Logger
    By Sir Tom in forum Snippets
    Replies: 0
    Last Post: 08-27-2010, 01:12 AM
  3. Logger
    By Andy in forum Snippets
    Replies: 0
    Last Post: 01-28-2010, 01:07 AM
  4. Basic IP Logger
    By J03Y in forum Website Development
    Replies: 4
    Last Post: 05-26-2009, 06:51 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •