PDA

View Full Version : Problems calculating earned XP



Mr. Roboto
08-11-2014, 09:31 AM
I have a script: https://villavu.com/forum/showthread.php?t=109817

It unlocks the safes at the Rogues Den.

When a safe is unlocked sucessfully two possibilities may occur:

You get a gem.
You get money.


How can I detect when the user gains XP? (for proggy).

What I tried:


// Checks for a new gem in inventory.
b := tabBackPack.waitForShift(5000);
// Checks for money gained.
b2 := findColorTolerance(x, y, 14868703, 924, 813, 933, 825, 1);

if b = true OR b2 = true
then xpGained := xpGained + 70;

Only the gem part works, the other check is not being detected.

The Mayor
08-11-2014, 10:33 AM
use chatBox.getXP(), the one asha wrote (look in his scripts, I think I use it in monkey pilferer too).



var
startXP:integer;
begin

startXP := chatBox.getXP();

stealStuff();

if chatBox.getXP() <> startXP then
writeLn('Must have stole something');

Mr. Roboto
08-11-2014, 11:19 AM
use chatBox.getXP(), the one asha wrote (look in his scripts, I think I use it in monkey pilferer too).



var
startXP:integer;
begin

startXP := chatBox.getXP();

stealStuff();

if chatBox.getXP() <> startXP then
writeLn('Must have stole something');



That's awesome! Thank you.