Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved Adding xp tracker

Joined
Apr 8, 2018
Messages
45
I just created a seren stone bot that works quite well. Now an xp tracker would be nice to see how well the bot performs. But I have no idea how to go about doing this. I have seen that there are tutorial to creating an embaddableui but how do I make the bot actually keep track of the xp? Like the character can also gain additional xp through decorated mining urns and the furnace perk.
 
Joined
Apr 19, 2018
Messages
14
You will have to implement SkillListener which is the eventListener for XP gain or skill level ups. Then youll have to set your bot to listen for these events by putting this line of code in your onStart function
Code:
getEventDispatcher().addListener(this);
after thats done youll have to write a function called onExperienceGained(SkillEvent event) that will take the event information and push it through to your UI. you can see mine which just prints it out to the console in the picture that i linked.

and heres a link to the related docs, Generated Documentation (Untitled) if you want to look there are also other listeners listed, inventoryListener is very helpful
 

Attachments

  • eventListener.png
    eventListener.png
    5.9 KB · Views: 90
Joined
Apr 8, 2018
Messages
45
You will have to implement SkillListener which is the eventListener for XP gain or skill level ups. Then youll have to set your bot to listen for these events by putting this line of code in your onStart function
Code:
getEventDispatcher().addListener(this);
after thats done youll have to write a function called onExperienceGained(SkillEvent event) that will take the event information and push it through to your UI. you can see mine which just prints it out to the console in the picture that i linked.

and heres a link to the related docs, Generated Documentation (Untitled) if you want to look there are also other listeners listed, inventoryListener is very helpful

Thank you for the help this works great! Do you also know how to get the integer value out of the SkillEvent object event?
I would also like to make a cumulative xp tracker that adds the total gained xp.

edit: I went into the documentation you linked and it's clear how to obtain the integer value from there by using the methods getChange() etc. of the SkillEvent class.
 
Last edited:
Top