Jump to content

Experience Tracker


Deceiver

Recommended Posts

Well, tried looking to better paint methods (ExperienceTracker api), and I'm not the best @ scripting and Java but I'm positive I did this right...

 

I've already defined ExperienceTracker as: (Don't criticize my naming)

ExperienceTracker  xpTrack= new ExperienceTracker();

So in my onStart method, I have this:

xpTrack.start(Skill.MINING);

Then my paint, as well, these don't even show up:

g.drawString("Experience: " + xpTrack.getGainedXP(Skill.MINING) + " (" + xpTrack.getGainedXPPerHour(Skill.MINING) + ")", 15, 101);
g.drawString("Level: " + this.beginningLevel + " (" + xpTrack.getGainedLevels(Skill.MINING) + ")", 15, 115);

And I wasn't getting any errors... but the log for when I started the script:

[INFO][Bot #1][08/13 07:31:44 PM]: Thanks for using WWFMiner!
[INFO][Bot #1][08/13 07:31:44 PM]: Error in script onExit(): WWFMiner
[INFO][Bot #1][08/13 07:31:44 PM]: Script WWFMiner has exited!

Link to comment
Share on other sites

I'm guessing you need to call

 

xpTrack.exchangeContext(this);

 

Also you should post these into the scripting help section so others (ie starting scripters) can benefit from this too

 

 

Oop, true. I'll move it there, and I'll see if that is the problem.

 

noobs

 

initialize your global instance using the getter method from method provider do it on the onStart

ExperienceTracker  xpTrack;

onStart() {
this.xpTrack = getExperienceTracker();
}
Edited by jos3dpay
  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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