michaelzangl / minebot

Minebot
GNU General Public License v3.0
144 stars 48 forks source link

Is there a way to make my bot sell cactus #265

Open diamkil opened 5 years ago

diamkil commented 5 years ago

I want to know if there's a way my bot can take the cactus from my farm and then go to /home sc click on a quickshop sign and enter the amount of cactus from the inventory in the chat and then go back to /home c

pixelcrafter001 commented 5 years ago

Right Click or Left CLick and will you say how often he click or must be say in the chat like a simple number in stack size?

sorry for bad english Germans not always the best in it ^^

diamkil commented 5 years ago

Right Click or Left CLick and will you say how often he click or must be say in the chat like a simple number in stack size?

sorry for bad english Germans not always the best in it ^^

It needs to left click on the sign one time and enter the amount of cactus it has in its inventiry ex : 64 or even 704 in the chat to sell this amount

pixelcrafter001 commented 5 years ago

ok I do it for in a script that you can do with /minebot js sellCactus.js just a moment pls ^^

pixelcrafter001 commented 5 years ago

So sorry the Script tests are longer that I know... ;)

you must be change end of the txt file to .txt or do start with /minebot js sellCactus.txt there is your way

PS: you must be show on the sign by the home when not say this to me I can do something to fix that :D

sellCactus.txt MFG pixel

diamkil commented 5 years ago

So sorry the Script tests are longer that I know... ;)

you must be change end of the txt file to .txt or do start with /minebot js sellCactus.txt there is your way

PS: you must be show on the sign by the home when not say this to me I can do something to fix that :D

sellCactus.txt MFG pixel

Thank you I will test it tonight and give you the result, by the way where do I put the txt file in my minecraft directory?

pixelcrafter001 commented 5 years ago

in the ".minecraft/minebot/scripts"

diamkil commented 5 years ago

in the ".minecraft/minebot/scripts"

the bots doesn't enter the right amount in the chat but after left clicking the sign this text appears in the chat screen shot 2019-01-11 at 3 50 04 pm wich tells the exact amount of cactus it has to enter in the chat

pixelcrafter001 commented 5 years ago

Ok i come in 3 hours home than i can change it i think my math is not correct in the skript can you also say me what for a server it is (i'm searching for a good new one) :)

pixelcrafter001 commented 5 years ago

And have you a empty inventory when you go to the shop it works only perfect when you only have the cactus in the inventory or you they me how many tools / eat you have in the slots better send me a screenshot of your inventory :)

michaelzangl commented 5 years ago

To count all available cacturs, use:

       var count = 0;
    var inv = minescript.getInventory()
    for (var k = 0; k < 36; k++) {
        if (inv.getSlot(k).itemId == 81) {
            count += inv.getSlot(k).amount
        }
    }
       // Now use count, e.g.:
       minescript.serverCommand("/sell cactus " + count);
pixelcrafter001 commented 5 years ago

oh that is that i hava not know thanks I change this :D

pixelcrafter001 commented 5 years ago

ok I have changed it well it does it what you will :D and @michaelzangl thanks for help :)

sellCactus.txt

diamkil commented 5 years ago

there is still one last problem and it is that it counts the number of stacks and the scripts sometimes takes "non-full" stacks and the amount entered in the chat is the one if the stacks were full

pixelcrafter001 commented 5 years ago

sorry I don't can the complete inventory scan and the really answer say I hope this is hopefully okay for the while