Hello everyone! :D
UPDATE ON BOTTOM OF POST FOR AUTO MELON ATTACKING
With a little (alot) of help from SioniannSun (to make it much more compact) I have made a macro that shows you how many of an item you have (in this instance pumpkins and melons, how much it is worth , and it auto sells at 1500!
Here is a youtube video on how to set it all up, or you can use the instructions below :)
The Final Product Should Look Like This (minus the coordinates, that's someone else's mod):
For OnPickupItem
Then you hit the edit file, create a new file called PandM, it will open up the text editor and you will type or copy/pasteCode:$$<PandM.txt>
After all of that is done it's time to set up the gui, so go into the gui editor located here:Code:$${ IFMATCHES(%PICKUPID%, "pumpkin"); @#pumpkin = %@#pumpkin% + %PICKUPAMOUNT%; @#pumpworth = (%@#pumpkin% * 2) / 5; IF(@#pumpkin >= 1500); ECHO("/sell pumpkin"); @#pumpkin = 0; @#pumpworth = 0; ENDIF; ENDIF; IFMATCHES(%PICKUPID%, "melon"); @#melons = %@#melons% + %PICKUPAMOUNT%; @#melworth = (%@#melons% * 2); IF(@#melons >= 1500); ECHO("/sell melon"); @#melons = 0; @#melworth = 0; ENDIF; ENDIF; SETLABEL(pumpkin, "Pumpkins: %@#pumpkin%"); SETLABEL(pumpworth, "Worth: $ %@#pumpworth%"); SETLABEL(melons, "Melons: %@#melons%"); SETLABEL(melworth, "Worth: $ %@#melworth%"); }$$
Double click ingame
Then with the button on the bottom left with the plus sign, you can rearrange the grid if you want, or just click it and select add label.
Choose which grid spot you want it to be at and then make the control name pumpkin, melons, pumpworth, and melworth (make sure you set 4 different labels with the 4 names to 4 different locations) and make sure that there is nothing in the label text and there you can change the font color, background color, alignment, ect.
I also recommend setting a button to set both values to 0 just incase anything happens, you can do that by selecting a key on the main screen and then in the command box putting in:
Feel free to donate to me if this helped you :D and also taking requests, not super good at this but I enjoy trying to figure it out! Thanks!Code:$${ ECHO("/sell pumpkin"); ECHO("/sell melon"); @#pumpkin = 0; @#pumpworth = 0; @#melons = 0; @#melworth = 0; SETLABEL(pumpkin, "Pumpkins: %@#pumpkin%"); SETLABEL(pumpworth, "Worth: $ %@#worth%"); SETLABEL(melons, "Melons: %@#melons%"); SETLABEL(melworth, "Worth: $ %@#melworth%"); }$$
?
Are you going to use this?
-
Yes
23 vote(s)60.5% -
No
2 vote(s)5.3% -
Maybe
5 vote(s)13.2% -
This is confusing wtf
8 vote(s)21.1%
Thread Tools
Thread Tools
-
Amerikathefree BuilderBuilder ⛰️ Ex-Mayor ⚒️⚒️
-
destroyer2441 BuilderBuilder ⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ I ⭐ Premium Upgrade
this is an amazing macro. It is so helpful being able to auto sell it
-
Like x 1 - List
-
-
SionainnSun MayorMayor ⛰️⛰️ Ex-Mayor ⚒️⚒️
This is a really cool macro, well done! :) If you don't mind, there are some suggestions I'd like to make ^-^
If you didn't want input, sorry :X3: I just like to help if I can (and hopefully this was somewhat helpful... maybe...)For this, all you need to do is: $$<Loops.txt>. (Or, if the $${ and }$$ aren't in Loops.txt, you can do $${$$<Loops.txt>}$$)
I noticed you didn't use percent signs around any variable names (such as PICKUPAMOUNT.) As far as I know, you have to, but your macro seems to work without doing so o_O I would put them though, because you should have to (I think...)
You also entered the condition as PICKUPITEM = "Pumpkin". As far as I'm aware, PICKUPITEM isn't a variable, it's PICKUPID... but again, apparently your macro works :p
And, finally, in your ECHO commands, you didn't put quotes around the message (/sell pumpkin.) I, again, was under the impression that it was necessary to do so, but if you've tested the macro and it works, it's apparently not necessary... I would still do it though, just for the sake of style.
I can't test at the moment because I can't go on Minecraft, but I would think at least one of these would work: The first is obviously the best, since you're using its actual worth (.4 dollars). However, if decimals don't work for some reason, the second example below should work (since 2/5 = .4)
- @#worth = %PICKUPAMOUNT% * .4;
- @#worth = %PICKUPAMOUNT% * 2 / 5;
For this, I would recommend just making a text file with the code in it, because (for me, at least) that makes it easier to a) edit it and b) see what's actually going on--readable code is always good ;)
Also, I'm not sure why you made it two separate scripts... it should work as only one script, I believe. Basically, I would recommend something like this:
And then, again, all you would have to do is bind it to onItemPickup next to "IF TRUE" using $$<fileName.txt>.Code:$${ @#pumpkin = @#pumpkin + %PICKUPAMOUNT%; @#worth = @#worth + %PICKUPAMOUNT% * .4; IF(@#pumpkin >= 1000); ECHO("/sell pumpkin"); @#pumpkin = 0; @#worth = 0; ENDIF; }$$
If you didn't want to use the conditional macro thing, and just wanted to use the regular one, you could also do this:
And you would just bind it like above, except in the normal macro tab.Code:$${ IFMATCHES(%PICKUPID%, "pumpkin"); @#pumpkin = @#pumpkin + %PICKUPAMOUNT%; @#worth = @#worth + %PICKUPAMOUNT% * .4; IF(@#pumpkin >= 1000); ECHO("/sell pumpkin"); @#pumpkin = 0; @#worth = 0; ENDIF; ENDIF; }$$
Again, I haven't tested any of this code because I can't go on Minecraft at the moment, but I'm fairly sure it should work :laugh: If it doesn't, just let me know and I'll see what I can do, I don't have a great track record of making macros work on the first try :confused: -
Amerikathefree BuilderBuilder ⛰️ Ex-Mayor ⚒️⚒️Hey! Thanks for the input! And honestly I tried doing alot of the things that you recommended and for some reason they just would not work doing them the "correct" way. (like putting the conditional macro in a txt file and putting the percent signs around pickupamounts) if you want to test it and figure out a way to make it work without being so messy I would be super appreciative! :)
-
SionainnSun MayorMayor ⛰️⛰️ Ex-Mayor ⚒️⚒️Alrighty so I did a thing :D I tested it and everything, and I also got it all in one script (setting the labels), because it was inefficient to run on a constant loop like that. So, the final product:
If this works for you, feel free to use it, and if not, I'll try to fix whatever bugs there are. It seemed to work pretty well for me :happy:As far as I can figure, decimals just aren't supported at all in the macro mod. What it does instead is takes the number with a decimal and cuts it off just before the decimal--not rounding, but similar. I.e., 62.20 would become 62 (it just cuts off the decimal), but 62.8 would also become 62, not 63 (even though it's closer to 63.) The result is that the script just displays the worth of the pumpkins to the nearest whole number, but always rounds down. However, the most it's ever off by is 80 cents, so it shouldn't be too much of an issue, I don't think :)Code:$${ IFMATCHES(%PICKUPID%, "pumpkin"); @#pumpkin = %@#pumpkin% + %PICKUPAMOUNT%; @#worth = (%@#pumpkin% * 2) / 5; IF(@#pumpkin >= 1000); ECHO("/sell pumpkin"); @#pumpkin = 0; @#worth = 0; ENDIF; SETLABEL(Worth, "Worth: %@#worth%"); SETLABEL(Amount, "Pumpkins: %@#pumpkin%"); ENDIF; }$$
In your original post, you said both @#pumpkin and @#worth got set to zero when you joined the server, but I didn't see anywhere in your code where that happened. It would be very simple to do (as would setting both variables to zero whenever you enter the "/sell pumpkin" command), but that would require binding a script to onJoinGame and onSendChat respectively, and I wasn't sure if you wanted to have to deal with multiple scripts like that :p If you don't do that, there's no need to make the variables global (with the @ prefix), but I left it in case you want to do anything in different script. -
Amerikathefree BuilderBuilder ⛰️ Ex-Mayor ⚒️⚒️Not sure what you did that was different from me, but it worked! And now I can put the melon one in there as well! Thank you so much! I'll redo the video and the post. Oh and I didnt say they would be set to zero once you join the game, I just set a button to do /sell (item) and that sets the values to 0
-
heartsandwrists BuilderBuilder ⛰️ Ex-President ⚒️⚒️
this is cool :O you should do something like this for cocoa
-
Agree x 1 - List
-
-
SionainnSun MayorMayor ⛰️⛰️ Ex-Mayor ⚒️⚒️Glad to hear it :D if there's anything else I can help with, feel free to let me know :)
-
Like x 1 - List
-
-
Amerikathefree BuilderBuilder ⛰️ Ex-Mayor ⚒️⚒️
Updated with auto melon attacker! :D (Attacks if you are looking at melons)