May 10, 20169 yr I made a simple Kebab Buying script, but how would I keep track of how many are bought? I've tried having it get the amount of the inventory but I can't seem to figure out how to keep it adding onto a number. I tried to do a KebabCount = KebabCount + 1 after the dialogue where the Kebab is bought but nope. ALSO, if you're reading this, what would be my best way of walking my player from Al Kharid to the GE so he can sell the Kebabs. Not planning on adding this yet but just wondering.
May 10, 20169 yr Author Tping with Varrock teleport and using Home tele to get back would be the best way? Sorry for that question I meant more of walking-wise. Would webWalk work or should I split it up to go to the gate then to GE. I've never scripted such long distances.
May 10, 20169 yr I made a simple Kebab Buying script, but how would I keep track of how many are bought? I've tried having it get the amount of the inventory but I can't seem to figure out how to keep it adding onto a number. I tried to do a KebabCount = KebabCount + 1 after the dialogue where the Kebab is bought but nope. ALSO, if you're reading this, what would be my best way of walking my player from Al Kharid to the GE so he can sell the Kebabs. Not planning on adding this yet but just wondering. int kebabCount; //After you get a full inventory and head to the bank. //before you open the bank kebabCount += getInventory().getAmount("name of item"); for walking grab a position near the GE WebWalkEvent toGE = new WebWalkEvent(INodeRouteFinder.createAdvanced(), new Position(0,0,0)); context.execute(toGE); hope this helps Edited May 10, 20169 yr by Sinatra
May 10, 20169 yr Does it say in chat when you buy a kebab? You could use the message listener in that case and just +1 everytime it pops up in chat, you could alternatively create your own inventory listener kind of thing, but its pretty unnecessary for this.
May 11, 20169 yr Author Does it say in chat when you buy a kebab? You could use the message listener in that case and just +1 everytime it pops up in chat, you could alternatively create your own inventory listener kind of thing, but its pretty unnecessary for this. It does! How would I do this message listener? Never heard of it tbh.
May 11, 20169 yr It does! How would I do this message listener? Never heard of it tbh. I'm on my at the moment so i'm not going to dig through the API But its an interface called MessageListener that you implement, and it will give you a method like public void onMessage(Message m) e.g. public class Test implements MessageListener
May 11, 20169 yr is tom a pornstar? Yes It does! How would I do this message listener? Never heard of it tbh. Should implement it like this then you should have a method @Override public void onMessage(Message m) { if(m.getMessage().contains("Blah")) { kebabCounter++; } }
May 11, 20169 yr Author Yes Should implement it like this then you should have a method @Override public void onMessage(Message m) { if(m.getMessage().contains("Blah")) { kebabCounter++; } } Sweet! Thanks a ton. What exactly is the 'MetalDragonsMain'? Do I put whatever I like there or?
May 11, 20169 yr Sweet! Thanks a ton. What exactly is the 'MetalDragonsMain'? Do I put whatever I like there or? That is the name of my Class refer to this topic http://osbot.org/forum/topic/91021-basic-java-tutorial-i-found-online-for-anyone-wanting-to-learn-basics-also-contains-link-for-more-information/ Could help you out a bunch
Create an account or sign in to comment