Jump to content
  • 0
Sign in to follow this  
Sir Zotic

Grand Exchange Problem

Question

I need 1 big help with this. When you go to sell something it equips the item and closes all of the screens.

Look at my video Problem.
[url]http://tinypic.com/player.php?v=1zwkco8&s=5[/url]

[CODE] public void sellItems() {
int x = selectedAmount;
int y = firstItemStacked(selectedItemId);
int z = secondItemStacked(selectedItemId);

long l = firstItemStacked;
long g = secondItemStacked;

long o = l+g;

if(removeGrandExchangeItems(x, y, z, firstItemStacked, secondItemStacked, o)) {
final int s = selectedSlot; int b = selectedSlot;
int i = newOffer("Sell", selectedItemId, selectedAmount, selectedAmount, selectedPrice, 0, c.playerName, false, b);
c.getItems().deleteItem2(selectedItemId, selectedAmount);
if(i == -1) {
c.getItems().addItem(selectedItemId, selectedAmount);
c.sendMessage("To many offers, please try again later.");
return;
}
openGrandExchange(true);
c.sendConfig(4, b, 1, -1);
c.sendConfig(5, b, 1, -1);
int k = b*2; k += 24565;
c.getPA().sendFrame34(selectedItemId, 0, k, selectedAmount);
sellItems(i, c.playerName);
CycleEventHandler.getInstance().addEvent(c, new CycleEvent() {
public void execute(CycleEventContainer container) {

container.stop();
}

@Override
public void stop() {
c.sendConfig(5, s, 3, -1);
}
}, 2);
PlayerSave.saveGame(c);
}
}[/CODE]

Share this post


Link to post
Share on other sites

14 answers to this question

Recommended Posts

  • 0
[quote name='Sir Zotic']I need 1 big help with this. When you go to sell something it equips the item and closes all of the screens.

Look at my video Problem.
[url]http://tinypic.com/player.php?v=1zwkco8&s=5[/url]

[CODE] public void sellItems() {
int x = selectedAmount;
int y = firstItemStacked(selectedItemId);
int z = secondItemStacked(selectedItemId);

long l = firstItemStacked;
long g = secondItemStacked;

long o = l+g;

if(removeGrandExchangeItems(x, y, z, firstItemStacked, secondItemStacked, o)) {
final int s = selectedSlot; int b = selectedSlot;
int i = newOffer("Sell", selectedItemId, selectedAmount, selectedAmount, selectedPrice, 0, c.playerName, false, b);
c.getItems().deleteItem2(selectedItemId, selectedAmount);
if(i == -1) {
c.getItems().addItem(selectedItemId, selectedAmount);
c.sendMessage("To many offers, please try again later.");
return;
}
openGrandExchange(true);
c.sendConfig(4, b, 1, -1);
c.sendConfig(5, b, 1, -1);
int k = b*2; k += 24565;
c.getPA().sendFrame34(selectedItemId, 0, k, selectedAmount);
sellItems(i, c.playerName);
CycleEventHandler.getInstance().addEvent(c, new CycleEvent() {
public void execute(CycleEventContainer container) {

container.stop();
}

@Override
public void stop() {
c.sendConfig(5, s, 3, -1);
}
}, 2);
PlayerSave.saveGame(c);
}
}[/CODE][/QUOTE]

hint: equipitem

Share this post


Link to post
Share on other sites
  • 0
[quote name='storm powner']hint: equipitem[/QUOTE]

where do you see equipitem?

i think the problem may be that you may have CHANGED the writing to say offer, but it still uses the same command as EQUIP. Go into your clickingbuttons.java and check it out

Share this post


Link to post
Share on other sites
  • 0
[quote name='nexonian']where do you see equipitem?

i think the problem may be that you may have CHANGED the writing to say offer, but it still uses the same command as EQUIP. Go into your clickingbuttons.java and check it out[/QUOTE]
thats what i'm saying equipitem, when you click it it equips it, means you have to lole at the equipitem handler :P

Share this post


Link to post
Share on other sites
  • 0
[quote name='nexonian']where do you see equipitem?

i think the problem may be that you may have CHANGED the writing to say offer, but it still uses the same command as EQUIP. Go into your clickingbuttons.java and check it out[/QUOTE]

this is the code on clickingbuttons.java
[code] case 95185:
case 95191:
case 95203:
case 95206:
case 95194:
case 95209:
case 95188:
case 95212:
case 95197:
case 95215:
case 95200:
case 95218:
case 96078:
case 96174:
case 96074:
case 96082:
case 96182:
case 96030:
case 96130:
case 96034:
case 96134:
case 96038:
case 96138:
case 96042:
case 96142:
case 96046:
case 96146:
case 96050:
case 96150:
case 96058:
case 96158:
case 96070:
case 96170:
case 96062:
case 96162:
case 96086:
case 96186:
case 96089:
case 96189:
case 95223:
case 95227:
case 95231:
case 95235:
case 95239:
case 95243:
case 213230:
case 209254:
case 95221:
case 95225:
case 95229:
case 95233:
case 95237:
case 95241:
case 214016:
case 210040:
p.GE().buttonClick(buttonId);
break;[/code]
[quote name='storm powner']thats what i'm saying equipitem, when you click it it equips it, means you have to lole at the equipitem handler :P[/QUOTE]

There no equipment.java

Share this post


Link to post
Share on other sites
  • 0
[quote name='Sir Zotic']this is the code on clickingbuttons.java
[code] case 95185:
case 95191:
case 95203:
case 95206:
case 95194:
case 95209:
case 95188:
case 95212:
case 95197:
case 95215:
case 95200:
case 95218:
case 96078:
case 96174:
case 96074:
case 96082:
case 96182:
case 96030:
case 96130:
case 96034:
case 96134:
case 96038:
case 96138:
case 96042:
case 96142:
case 96046:
case 96146:
case 96050:
case 96150:
case 96058:
case 96158:
case 96070:
case 96170:
case 96062:
case 96162:
case 96086:
case 96186:
case 96089:
case 96189:
case 95223:
case 95227:
case 95231:
case 95235:
case 95239:
case 95243:
case 213230:
case 209254:
case 95221:
case 95225:
case 95229:
case 95233:
case 95237:
case 95241:
case 214016:
case 210040:
p.GE().buttonClick(buttonId);
break;[/code]


There no equipment.java[/QUOTE]

im not saying equipment.java i say the file that handles all the items to equip them aka wearitem.java (much spoonfeed)

Share this post


Link to post
Share on other sites
  • 0
[quote name='storm powner']im not saying equipment.java i say the file that handles all the items to equip them aka wearitem.java (much spoonfeed)[/QUOTE]

found it :)

Share this post


Link to post
Share on other sites
  • 0
[quote name='Sir Zotic']found it :)[/QUOTE]


did you fix this: [IMG]http://i41.tinypic.com/2mqw2op.png[/IMG]
it should display thse for sell and buy, but it isnt: [IMG]http://i43.tinypic.com/sndro1.png[/IMG]

Share this post


Link to post
Share on other sites
  • 0
[quote name='storm powner']did you fix this: [IMG]http://i41.tinypic.com/2mqw2op.png[/IMG]
it should display thse for sell and buy, but it isnt: [IMG]http://i43.tinypic.com/sndro1.png[/IMG][/QUOTE]

i have same problem as you..you fix it?

Share this post


Link to post
Share on other sites
  • 0
[quote name='Sir Zotic']i have same problem as you..you fix it?[/QUOTE]

i didint fix it, otherwise i wouldnt ask if you fixed it :P

Share this post


Link to post
Share on other sites
  • 0
[quote name='storm powner']i didint fix it, otherwise i wouldnt ask if you fixed it :P[/QUOTE]

i think it around Sell method.

[code] public void openGrandExchange(boolean open) {
for(int i = 1; i < Slots.length; i++) {
if(Slots[i] != 0) {
if(sellers[Slots[i]] != null && sellers[Slots[i]].owner.equalsIgnoreCase(c.playerName) && sellers[Slots[i]].slot == i) {
if(sellers[Slots[i]].completed) {
c.sendConfig(5, i, 5, -1);
} else {
c.sendConfig(5, i, 3, -1);
}
int k = i*2; k += 24565;
c.getPA().sendFrame34(sellers[Slots[i]].itemId, 0, k, sellers[Slots[i]].amount);
c.getPA().sendFrame126(""+c.getItems().getItemName(sellers[Slots[i]].itemId)+"", 32000+i);
c.getPA().sendFrame126(Misc.format(sellers[Slots[i]].price)+" gp", 33000+i);
if(sellers[Slots[i]].amount != 1) {
c.getPA().sendFrame126(""+intToKOrMil(sellers[Slots[i]].amount), 33100+i);
} else {
c.getPA().sendFrame126("", 33100+i);
}
if(sellers[Slots[i]].aborted) {
updateBar("Red", "Sell", Slots[i], i, c);
} else {
updateBar("Green", "Sell", Slots[i], i, c);
}
} else if(buyers[Slots[i]] != null && buyers[Slots[i]].owner.equalsIgnoreCase(c.playerName) && buyers[Slots[i]].slot == i) {
if(buyers[Slots[i]].completed) {
c.sendConfig(5, i, 6, -1);
} else {
c.sendConfig(5, i, 4, -1);
}
int k = i*2; k += 24565;
c.getPA().sendFrame34(buyers[Slots[i]].itemId, 0, k, buyers[Slots[i]].amount);
c.getPA().sendFrame126(""+c.getItems().getItemName(buyers[Slots[i]].itemId)+"", 32000+i);
c.getPA().sendFrame126(Misc.format(buyers[Slots[i]].price)+" gp", 33000+i);
if(buyers[Slots[i]].amount != 1) {
c.getPA().sendFrame126(""+intToKOrMil(buyers[Slots[i]].amount), 33100+i);
} else {
c.getPA().sendFrame126("", 33100+i);
}
if(buyers[Slots[i]].aborted) {
updateBar("Red", "Buy", Slots[i], i, c);
} else {
updateBar("Green", "Buy", Slots[i], i, c);
}
}
} else {
c.sendConfig(4, i, 3, -1);
int k = i*2; k += 24565;
c.getPA().sendFrame34(-1, 0, k, 1);
c.getPA().sendFrame126("", 33000+i);
c.getPA().sendFrame126("", 32000+i);
c.getPA().sendFrame126("", 33100+i);
}
}
if(open) {
c.getPA().showInterface(24500);
recievedMessage = false;
}
}[/code] Edited by Sir Zotic

Share this post


Link to post
Share on other sites
Sign in to follow this  

×