evert123 Posted October 2, 2017 Share Posted October 2, 2017 Hello, I'm trying to set a player name so I can trade him later on. But I can not figure out how to set this name, what I have now is: Player person2 = new Player ("Evert123"); This is not working at all Quote Link to comment Share on other sites More sharing options...
Chris Posted October 2, 2017 Share Posted October 2, 2017 String player; Player p = getplayers.closest(......some players); if p != null player = p.getname ? Quote Link to comment Share on other sites More sharing options...
Wet Rag Posted October 2, 2017 Share Posted October 2, 2017 1 minute ago, SetYaName said: Account settings? What...? Do you have any java knowledge OP, have you looked at the API? Quote Link to comment Share on other sites More sharing options...
Chris Posted October 2, 2017 Share Posted October 2, 2017 or String[] accountsToTrade = {"Acc1", "Acc2",..........}; Quote Link to comment Share on other sites More sharing options...
evert123 Posted October 2, 2017 Author Share Posted October 2, 2017 17 minutes ago, SetYaName said: Account settings? I don't really know what you mean.. 15 minutes ago, Chris said: String player; Player p = getplayers.closest(......some players); if p != null player = p.getname ? Yes, I already have some code like this, only get last trade request and getPlayername. 15 minutes ago, Wet Rag said: What...? Do you have any java knowledge OP, have you looked at the API? Yes very very little but i know python, I looked at the API but I think this is mostly caused by my lack of Java knowledge. 16 minutes ago, Chris said: or String[] accountsToTrade = {"Acc1", "Acc2",..........}; I can just save it as a string? Because when i set an Position or Area I have to use the Entity? Like: Position momsKitchen = new Position (2222, 2222, 2) So I was expecting something with Player xxx = new Player. I will try string person2 = ("evert123") Quote Link to comment Share on other sites More sharing options...
Apaec Posted October 2, 2017 Share Posted October 2, 2017 (edited) Player somePlayer = getPlayers().closest("Zezima"); //Edit: Trading this player: int someThreshold = 7000; if (somePlayer != null && getMap().canReach(somePlayer) && somePlayer.interact("Trade with") && new ConditionalSleep(someThreshold) { @Override public boolean condition() throws InterruptedException { return getTrade().isCurrentlyTrading(); } }.sleep()) log("Successfully in trade!"); Edited October 2, 2017 by Apaec Quote Link to comment Share on other sites More sharing options...
evert123 Posted October 2, 2017 Author Share Posted October 2, 2017 Thx everybody I realize now that I did some stupid stuff. I never requested the players name, so I was working with a Player (Object??) and not a string, so it didn't make sense to me that it could be a string. @Apaec Really useful will definitely look at it, but for now it kinda feels like a spoiler so I first try to make it myself and then get back when I get frustrated :P Quote Link to comment Share on other sites More sharing options...