Array

Plugin Reload & API Docs

Avatar

By Scrumplex 27 May 2016 11:12

Admin · 2,147,483,647 comments
Stealth_^ wrote

I saw that you made an Issue Report for the same thing I'm trying to figure out.
https://github.com/TheHolyWaffle/TeamSp … /issues/68

What did you do to make it work (if anything)?

EDIT: I guess it's worth mentioning that I'm trying to remove all groups on client disconnect.

I don't use uids in my leaveevent. I only need the clientid for my functions. You could create a HashMap<Integer, String>, where Integer is the clid and String is the uid. If a client joins the server add his clid and uid to that hashmap and remove him if he leaves. And before you remove him get his uid.


The Developer of the Sprummlbot and the Admin of this forum.

Avatar

By Stealth_^ 1 Jun 2016 05:20

Member · 55 comments

I think I've got the gist of just about everything to do with the bot, the last question is, how do I use editClient?

Or anything that uses ClientProperty for that matter.

Last edited by Stealth_^ (1 Jun 2016 05:32)

Avatar

By Stealth_^ 10 Jun 2016 17:16

Member · 55 comments

Bump

Avatar

By Scrumplex 11 Jun 2016 08:32

Admin · 2,147,483,647 comments
Stealth_^ wrote

I think I've got the gist of just about everything to do with the bot, the last question is, how do I use editClient?

Or anything that uses ClientProperty for that matter.

You need to create a Map<ClientProperty, String>. Then you have to put a ClientProperty and a value. For example: map.put(ClientProperty.CLIENT_IS_CHANNEL_COMMANDER, "1");
But you can't edit everything.
Use 1 instead of true, 0 instead of false.
https://github.com/TheHolyWaffle/TeamSp … perty.java
If it has a false in the initialization of the enum then you cannot edit that property.


The Developer of the Sprummlbot and the Admin of this forum.

Avatar

By Stealth_^ 4 Jul 2016 06:34

Member · 55 comments

Woo I almost made it a month with no help!

Next question: How do I loop the clients?

Tried:

for (Client i : getAPI().getClients()){
    //dostuff    
}

But I got the error:
Error:(374, 44) java: for-each not applicable to expression type
  required: array or java.lang.Iterable
  found:    com.github.theholywaffle.teamspeak3.api.CommandFuture<java.util.List<com.github.theholywaffle.teamspeak3.api.wrapper.Client>>

Last edited by Stealth_^ (4 Jul 2016 06:34)

Avatar

By Scrumplex 4 Jul 2016 15:27

Admin · 2,147,483,647 comments
Stealth_^ wrote

Woo I almost made it a month with no help!

Next question: How do I loop the clients?

Tried:

for (Client i : getAPI().getClients()){
    //dostuff    
}

But I got the error:
Error:(374, 44) java: for-each not applicable to expression type
  required: array or java.lang.Iterable
  found:    com.github.theholywaffle.teamspeak3.api.CommandFuture<java.util.List<com.github.theholywaffle.teamspeak3.api.wrapper.Client>>

That error occurrs, because the Sprummlbot uses the TS3ApiAsync Class. QuickFix:

for (Client i : getAPI().getClients().getUninterruptibly){
    //dostuff    
}

Any api related method in the TS3ApiAsync class returns a CommandFuture Object.
https://github.com/TheHolyWaffle/TeamSp … uture.java


The Developer of the Sprummlbot and the Admin of this forum.

Array