Jump to content

Setting player name


Recommended Posts

Posted
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")

Posted (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 by Apaec
Posted

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...