Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Problem with auto-currency!

Newbie Spellweaver
Joined
Apr 11, 2017
Messages
28
Reaction score
0
Good morning/evening to everyone!

Well, I encountered a problem recently where auto currency only applies when you manually pick up mesos with Z. It doesn't register somehow when you're picking up the mesos with item vac or using a pet.

I've looked everywhere and didn't anything sadly.

All help is greatly appreciated!

Best regards,
akh01999~
 
Junior Spellweaver
Joined
Apr 30, 2012
Messages
100
Reaction score
41
It doesn't register somehow when you're picking up the mesos with item vac or using a pet
Maybe you should look at where your pet loot / item vac code is and compare it to your normal loot. It'll be in a packet handler.
 
Upvote 0
Experienced Elementalist
Joined
Mar 12, 2015
Messages
238
Reaction score
43
It would depend on where ur auto-currency code is located at the moment, and what the itemvac command activates.
If you put the autobuy at the highest possible 'gainMeso' method (the one that doesn't extend from any other) you are probably guaranteed to make it work
 
Upvote 0
Newbie Spellweaver
Joined
Apr 11, 2017
Messages
28
Reaction score
0
Still can't find the problem, honestly. I'm pretty new to java. Here are the itemvac and automeso functions:

Item VAC Command:
Code:
List<MapleMapObject> items = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM));            
for (MapleMapObject item : items) {                
MapleMapItem mapItem = (MapleMapItem) item;                
if (player.getDSPoints() > 0) {               
 if (mapItem.getMeso() > 0) {                   
 player.gainMeso(mapItem.getMeso(), true);                }
 else if (mapItem.getItem().getItemId() >= 5000000 && mapItem.getItem().getItemId() <= 5000100) {                   
 int petId = MaplePet.createPet(mapItem.getItem().getItemId());                    
if (petId == -1) {                    }                   
 MapleInventoryManipulator.addById(c, mapItem.getItem().getItemId(), mapItem.getItem().getQuantity(), null, petId);               
 } else {                    
MapleInventoryManipulator.addFromDrop(c, mapItem.getItem(), true);                    }                        
mapItem.setPickedUp(true);                        
player.getMap().removeMapObject(item); // just incase ?                       
 player.getMap().broadcastMessage(MaplePacketCreator.removeItemFromMap(mapItem.getObjectId(), 2, player.getId()), mapItem.getPosition());                                
 } else {                   
player.dropMessage("The command " + heading + splitted[0] + " does not exist.");                 
}            
}

Auto Meso function:
Code:
c.getPlayer().gainMeso(mapitem.getMeso(), true, true, false);                                   
 if (c.getPlayer().getAutoMeso() == true){                                       
 if (c.getPlayer().getMeso() >= 2000000000){                                           
 int itemID = 4001190;                                           
 short quantity = 1;                                            
MapleInventoryManipulator.addById(c, itemID, quantity);                                            
c.getPlayer().dropMessage("[Auto Marble] You've earned a Blackhole Marble! Enjoy!");                                            c.getPlayer().gainMeso(-1999999999, true, true, false);
 
Upvote 0
Skilled Illusionist
Joined
Apr 26, 2015
Messages
302
Reaction score
77
This kind of question is not easy to anwser without an stacktrace of your error.

What you should do is learn a bit more of Java and to understand what exactly you are going.

Start here:
 
Upvote 0
Newbie Spellweaver
Joined
Apr 11, 2017
Messages
28
Reaction score
0
I figured it out! I added the automeso function itself into the vac command + the pet looting manually.

Thanks everyone for your help!
 
Upvote 0
Junior Spellweaver
Joined
Apr 30, 2012
Messages
100
Reaction score
41
It would depend on where ur auto-currency code is located at the moment, and what the itemvac command activates.
If you put the autobuy at the highest possible 'gainMeso' method (the one that doesn't extend from any other) you are probably guaranteed to make it work

That would also call upon it every single time you gain mesos - in trades, through NPCs, special consumables and cash items. Which may or may not be what you'd want.
 
Upvote 0
Experienced Elementalist
Joined
Mar 12, 2015
Messages
238
Reaction score
43
What would be the point of auto-buy otherwise, i suppose its to have a cheap fix to the 2.1b meso limit
 
Upvote 0
Back
Top