Jump to content

SoulPlay rBuy - Shop buyer


Rain
 Share

Recommended Posts

First script so expect it to be buggy(If the door is open at the herblore shop you may get stuck if you are inside when it closes)

 

This will buy almost all ingredients in the Herblore shop, I'm planning to make it work with other stores 

BE1ddJ7.png

JREXr6j.png

 

Just compile and place the files inside your script follder ;)

Pastebin

Link to comment
Share on other sites

5 hours ago, Rain said:

First script so expect it to be buggy(If the door is open at the herblore shop you may get stuck if you are inside when it closes)

 

This will buy almost all ingredients in the Herblore shop, I'm planning to make it work with other stores 

BE1ddJ7.png

JREXr6j.png

 

Just compile and place the files inside your script follder ;)

Pastebin

Thanks for this, just some suggestions/improvements to ur code could be made(Which will help u in the future), ill list them:

  • Null check before interacting with anything for example if(npc != null) npc.interact("Trade");
  • In this code:
  •  NPC Shop = NPCs.getNearest(NPCid);
            Walking.walkTo(t);
            Time.sleep(4500);
            Shop.interact("Trade");
            Time.sleep(1000);
            if (Widgets.getOpenInterface() ==  3824) {
            	Time.sleep(300, 400);
            	Packets.sendAction(54, Itemid, slotid, 3900);
            	Time.sleep(300, 600);
            	Packets.sendAction(54, Itemid, slotid, 3900);
            }
  • What if the store is opened? it will reloop and try to walk to the tile and re interact instead u can use something like this:
  • 		if (Widgets.getOpenInterface() ==  3824) {
            	Time.sleep(300, 400);
            	Packets.sendAction(54, Itemid, slotid, 3900);
            	Time.sleep(300, 600);
            	Packets.sendAction(54, Itemid, slotid, 3900);
            } else {
    			NPC Shop = NPCs.getNearest(NPCid);
                Walking.walkTo(t);
                Time.sleep(4500);
    			if(Shop != null && Shop.isReachable()){  //If shop exists and it can be reached
                  Shop.interact("Trade");
                  Time.sleep(1000);
    			} else if(Shop != null && !Shop.isReachable()){  
    				//Open door
    			}
    		}
  •  

Other than that, all good as ur first script good job! :)

Edited by Death Dead
Link to comment
Share on other sites

Êþº¾   4 < rBuy xobot/script/ActiveScript -xobot/client/callback/listeners/PaintListener /xobot/client/callback/listeners/MessageListener runTime Lxobot/script/util/Timer; NPCid I Itemid slotid itemtype Ljava/lang/String;     startTime J <init> ()V Code java/lang/Error WUnresolved compilation problem: 
    The public type rBuy must be defined in its own file

    (Ljava/lang/String;)V LineNumberTable LocalVariableTable this LrBuy; onStart ()Z $ !Unresolved compilation problem: 
interact bankAllExcept bank loop ()I repaint (Ljava/awt/Graphics;)V (J)Ljava/lang/String; MessageRecieved ((Ljava/lang/String;ILjava/lang/String;)V 
SourceFile Rbuyer.java RuntimeVisibleAnnotations Lxobot/script/Manifest; authors Rain name rBuy Herblore buyer version?ð       description )Buys Herblore ingredients and banks them 

 

 

some weird bug..

Edited by denhaag070
Link to comment
Share on other sites

  • 4 months later...

Is it possible for someone to add Limpwurt root??

case "Limpwurt Root":
                    NPCid = 587;
                    Itemid = 225;
                    slotid = 6;
                    break;

I tried to add it myself but when compiling the script just dont run...

 

thanks

Link to comment
Share on other sites

  • Neo locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...