Merge pull request #65 from Parabot/feature/friends-list

[FEATURE] Friends list
This commit is contained in:
Jeroen Ketelaar
2016-11-28 19:35:32 +01:00
committed by GitHub
3 changed files with 42 additions and 5 deletions
+7 -2
View File
@@ -6,7 +6,7 @@
<groupId>org.parabot</groupId> <groupId>org.parabot</groupId>
<artifactId>317-api-minified</artifactId> <artifactId>317-api-minified</artifactId>
<version>1.201</version> <version>1.202</version>
<name>Parabot 317-API-Minified</name> <name>Parabot 317-API-Minified</name>
<licenses> <licenses>
@@ -35,7 +35,7 @@
<dependency> <dependency>
<groupId>org.parabot</groupId> <groupId>org.parabot</groupId>
<artifactId>client</artifactId> <artifactId>client</artifactId>
<version>2.6.0</version> <version>2.6.1</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<artifactId>*</artifactId> <artifactId>*</artifactId>
@@ -44,6 +44,11 @@
</exclusions> </exclusions>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.parabot</groupId>
<artifactId>internal-api</artifactId>
<version>1.4.45</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
@@ -30,8 +30,6 @@ public interface Client {
int getBackDialogId(); int getBackDialogId();
int getInputDialogState();
int getPlane(); int getPlane();
int[] getMenuActionId(); int[] getMenuActionId();
@@ -62,4 +60,12 @@ public interface Client {
int[] getSettings(); int[] getSettings();
boolean isLoggedIn(); boolean isLoggedIn();
int getInputDialogState();
long[] getFriendsListAsLong();
void addFriend(long id);
void deleteFriend(long id);
} }
@@ -1,11 +1,12 @@
package org.rev317.min.api.methods; package org.rev317.min.api.methods;
import org.parabot.api.misc.TextUtils;
import org.parabot.environment.api.utils.Time; import org.parabot.environment.api.utils.Time;
import org.parabot.environment.scripts.framework.SleepCondition; import org.parabot.environment.scripts.framework.SleepCondition;
import org.rev317.min.Loader; import org.rev317.min.Loader;
/** /**
* @author Everel, JKetelaar * @author Everel, JKetelaar, EmmaStone
*/ */
public class Game { public class Game {
@@ -77,6 +78,15 @@ public class Game {
return Loader.getClient().getPlane(); return Loader.getClient().getPlane();
} }
/**
* Gets the friends list long values
*
* @return long values of friends list
*/
public static long[] getFriendsListAsLong() {
return Loader.getClient().getFriendsListAsLong();
}
/** /**
* Determines whether this client has action 4 hooked * Determines whether this client has action 4 hooked
* *
@@ -160,4 +170,20 @@ public class Game {
public static void login(String username, String password) { public static void login(String username, String password) {
login(username, password, false); login(username, password, false);
} }
/**
* Adds friend
* @param username String
*/
public static void addFriend(String username) {
Loader.getClient().addFriend(TextUtils.longForName(TextUtils.fixName(username)));
}
/**
* Deletes friend
* @param username String
*/
public static void deleteFriend(String username) {
Loader.getClient().deleteFriend(TextUtils.longForName(TextUtils.fixName(username)));
}
} }