Update: Added the ability to freely place tools in any spot on your toolbar. Define with .tool set.
See https://github.com/ECC314/PMC/wiki/ToolSwitcher for a clearer explanation.
Thread Tools
Thread Tools
Page 4 of 9
-
Also, anyone know how to run a .command? For example .tool
If I just put it in as a macro, or even with ECHO, it just says it in chat, bypassing any Macro Mod filtering.
For now, I just use
Code:$${ TOGGLE(@pmctoolswitch) IF(@pmctoolswitch) LOG("&2&l[&a&lPMC: ToolSwitch&2&l]&6 ToolSwitch-Macro &aenabled&6.") ELSE LOG("&2&l[&a&lPMC: ToolSwitch&2&l]&6 ToolSwitch-Macro &cdisabled&6.") ENDIF }$$
-
Code:$${TOGGLE(@pmctoolswitch)}$$
Reason why ECHO() does not work: ECHO is not affected by FILTER() or OnSendChatMessage, it seems. This causes ".tool" to be sent to the server without the macro mod filtering it. I might add code snippets to the README.txt which would allow for a copy-and-paste toggle feature to be inserted in other players' macros.
//Github download updated.-
Potato x 1 - List
-
-
Good to know, hopefully they'll add support for .commands at some point.
I made a quick script to automatically collect available kits, cause why not.
All you have to do is type /kit (Or bind a key with $${ECHO(/kit)}$$, and it will collect any available kits, as well as run again, every 61 minutes, until you either relog, or force close the onChat macro, via the topleft of the screen, when you press ~
Add this code in a .txt and apply it to the onChat event. Make sure you add it at the end, otherwise anything after it won't run for another 61 minutes!
Code:$${ STRIP(&chat,%CHAT%) IFMATCHES(%&chat%,"^Kits: ") IFMATCHES(%CHAT%," Starter") ECHO(/kit starter) WAIT(1000ms) ENDIF IFMATCHES(%CHAT%," Flint") ECHO(/kit flint) WAIT(1000ms) ENDIF IFMATCHES(%CHAT%," Anvil") ECHO(/kit anvil) WAIT(1000ms) ENDIF IFMATCHES(%CHAT%," Water") ECHO(/kit water) WAIT(1000ms) ENDIF IFMATCHES(%CHAT%," Pyro") ECHO(/kit pyro) WAIT(1000ms) ENDIF IFMATCHES(%CHAT%," Compass") ECHO(/kit compass) WAIT(1000ms) ENDIF IFMATCHES(%CHAT%," Mobs") ECHO(/kit mobs) WAIT(1000ms) ENDIF IFMATCHES(%CHAT%," Signs") ECHO(/kit signs) WAIT(1000ms) ENDIF IFMATCHES(%CHAT%," Enderchest") ECHO(/kit enderchest) WAIT(1000ms) ENDIF //Delete the next 2 lines to remove the automatic, hourly kit collector WAIT(3600000ms) LOG("&4&l[&c&lAuto-Kit&4&l] &6Collects in &c1 minute&6. Make room in your &6inventory!") PLAYSOUND(random.levelup) WAIT(55000ms) LOG("&4&l[&c&lAuto-Kit&4&l] &6Collects in &c5 seconds&6!") PLAYSOUND(random.levelup) WAIT(5000ms) PLAYSOUND(random.levelup) ECHO(/kit) ENDIF }$$
If you want to add this to your macro collection, @314 I'd be happy to add some statistics code along with it, too
Also, does anyone else crash if you try to use the $$p command, then click [AddPlace]? For example, bind "/tp $$p" to a key, and test it.
EDIT: Didn't realize kits still worked when your inventory was full, until it auto collected and they all fell on the ground. I changed the code to have a 1 minute warning before auto collect, then another at 5 seconds.
EDIT 2: Script will stack on itself if you type /kit after it's already been run, essentially just making it run twice every 61 minutes. It will also error if you're in SG when it auto-collects. Working of a fix for both of these, as well as adding the ability to pick and choose which kits you collect, and collecting all kits at once, rather then 1 every second. -
I added an automatic pumpkin and melon miner (automatically mines them when looked at and in range, this is not an afk script by any means, you still have to move around and aim yourself) and an auto eating function to 314's ToolSwitch script. I'll paste it here for anyone interested.
All of these are toggled on/off with auto tool, using ".tool"
Melon/Pumpkin Miner and Auto-Eat Files (easiest to install, but if you don't want all of them, use the other spoilers below):
Automatic Pumpkin/Melon Miner: Automatically mines pumpkins and melons when they're in range and being looked at. I made it so I don't accidently break the stems while farming 2 rows at once and let's face it, holding down the left click button is just too much work.
Add the lineCode:&pmctoolswitch4 = "pumpkin$"
Code:IFMATCHES(%HITID%,"^(%&pmctoolswitch4%)") IF((@#pmctoolaxe > 0) && (@#pmctoolaxe < 10)) SLOT(%@#pmctoolaxe%) KEY(ATTACK) ENDIF ENDIF
(this assumes you're holding your relevant melon mining device in your 4th hotbar slot, for ".tool set" support, please refer to the "Melon .tool set "spoiler) Add the lineCode:&pmctoolswitch5 = "melon_block$"
Code:IFMATCHES(%HITID%,"^(%&pmctoolswitch5%)") SLOT(4) KEY(ATTACK) ENDIF
Add the lineCode:&pmctoolswitch5 = "melon_block$"
Code:IFMATCHES(%HITID%,"^(%&pmctoolswitch5%)") IF((@#pmctoolmelon > 0) && (@#pmctoolmelon < 10)) SLOT(%@#pmctoolmelon%) KEY(ATTACK) ENDIF ENDIF
Code:IFMATCHES(%@&pmccommand%,"(?i)^\.tool set melon (.+)$") MATCH(%@&pmccommand%,"(?i)^\.tool set melon (.+)$",{&var}) SET(#var,%&var%) IF((#var > 9) || (#var < 1)) LOG("&2&l[&a&lPMC: ToolSwitch&2&l]&c Error: Invalid slot (1-9).") ELSE @#pmctoolmelon = #var LOG("&2&l[&a&lPMC: ToolSwitch&2&l]&6 Melon in slot &e%@#pmctoolmelon%&6.") ENDIF UNSET(@pmcerror) ENDIF
Code:LOG(" &6<tool> parameters: &bsilk&6,&b shovel&6,&b axe&6,&b sword&6,&b fortune&6, &bmelon&6.")
Auto Eat: Automatically eats when your hunger is at 18/20 or less.
(this assumes your food is in slot 9, for ".tool set" support, refer to the "Auto Eat with ".tool set" Support" spoiler) Add this to the main loop in PMC_ToolSwitch.txt:
Code:IF(%HUNGER% < 19) SLOT(9) KEY(USE) ENDIF
Add this to the main loop in PMC_ToolSwitch.txt:
Code:IF(%HUNGER% < 19) SLOT(%@#pmctoolfood%) KEY(USE) ENDIF
Code:IFMATCHES(%@&pmccommand%,"(?i)^\.tool set food (.+)$") MATCH(%@&pmccommand%,"(?i)^\.tool set food (.+)$",{&var}) SET(#var,%&var%) IF((#var > 9) || (#var < 1)) LOG("&2&l[&a&lPMC: ToolSwitch&2&l]&c Error: Invalid slot (1-9).") ELSE @#pmctoolfood = #var LOG("&2&l[&a&lPMC: ToolSwitch&2&l]&6 Food in slot &e%@#pmctoolfood%&6.") ENDIF UNSET(@pmcerror) ENDIF
Code:LOG(" &6<tool> parameters: &bsilk&6,&b shovel&6,&b axe&6,&b sword&6,&b fortune&6, &bmelon&6, &bfood&6.")
-
First, would it be legal to do a "if I have stone, /sell stone" macro? and if so, what would the if statement look like? I can replicate for other stuff, just don't know all the variables and such for this. I'm envisioning something like:
If (inventory) stone =True
then echo ("/sell stone") (syntax is off I'm sure)
I have a sell stone types already, but when I don't have 1 of that item in my inventory, I get a bunch of error messages and would like to not get them.
A few other questions:
1. Can you have a "sell all except diamond" statement of some sort?
2. Can you somehow say "sell all types of stone" without having to put them in 1 by 1?
Sorry, I get basic scripting, but don't know all the variables/commands/context for this language. I'm not a developer by any means ;). -
2. I made a few tests about that; so far nothing worked.
Also, if you are in SG when the time runs out, you will get spammed with error messages as your kits are not available there... oh, and you could modify it to only issue one single command which combines everything instead of using many. -
From what I understood from the Automation Clause, we're not allowed to use any macros/scripts/mods that automate things to the point where we don't have to do any work, and/or are able to be afk.
To be clear about my script above (and I added this to the op, as well), it doesn't fully automate farming melon/pumpkins (I should have worded that differently before), it just auto tool switches, and mines them when they're in range and being looked at, taking the place of your left mouse button. You still have to walk around and aim at them yourself. I did it mainly to help prevent mining the stems when swinging back and forth to mine 2 rows at once.
If it is actually against the rules, considered bending the rules, or staff doesn't want it posted for any reason, I apologize, and I'll take it down immediately and remove if from my game, as well. If any staff could comment on this, or pm me about that, that would be great.
Code:$${ //editable variables //add whatever items you want to auto-sell here &itemstosell = "stone|cobblestone|granite|diorite|andesite|dirt|gravel|flint" IF(GUI = "NONE") #amounttosell = 0 UNSET(&sell[]) GUI(INVENTORY) //cycles through all inventory slot ID's FOR(#slotid,9,44) //gets inventory slot info GETSLOTITEM(%#slotid%,&founditem,#stacksize,#datavar) //checks if the item is on the sell list IFMATCHES(%&founditem%, "^(%&itemstosell%)$") //detects what type of stone it is, a function like this is also needed for wood, planks, wool, decoration bricks/sandstone, colored glass, clay, etc... IF(&founditem = "stone") IF(#datavar = 1) &founditem = "granite" ELSEIF(#datavar = 3) &founditem = "diorite" ELSEIF(#datavar = 5) &founditem = "andesite" ENDIF ENDIF //checks is an item is already in the sell array //I used this so instead of selling everything as it was found, it would save an array of items, then close your inventory so you could get back to what you were doing, then actually sell them, saving you a few seconds INDEXOF(&sell,#index,%&founditem%) //if item was not a duplicate IF(#index = -1) //adds it to the sell array PUSH(&sell,%&founditem%) #amounttosell = #amounttosell + 1 ENDIF ENDIF NEXT //closes inventory GUI, allowing you to go back to mining, as it sells everything GUI() //checks if anything needs to be sold IF(#amounttosell > 0) #endofarray = #amounttosell - 1 //cycles through array for things to be sold FOR(#arrayposition,0,%#endofarray%) ECHO(/sell %&sell[%#arrayposition%]%) //anti command spam WAIT(1) NEXT ENDIF ENDIF }$$
There's also a Command Page, with examples of variables and events, and a page of User Made Scripts, some of which are a little outdated on formatting, but should still be useful to get some general ideas about what things do. -
-
ScarabCoder BuilderBuilder ⛰️ Ex-Mayor ⚒️⚒️
I wanna merge my LWC macro with PMC.... But your code is so much better and more advanced then mine! I'm still having trouble understanding it, and adapting my code to match the same layout :)
-
I took a look at your LWC macro - I have seen certain interesting things which I might test in the future... my goal is to have a LWC macro condensed into one single, clean .txt file. :) -
ScarabCoder BuilderBuilder ⛰️ Ex-Mayor ⚒️⚒️
-
Logannnnnn Alaska シBuilder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade
Thanks so much 314! :artist:
I'll donate 5K when I see you in game!-
Winner x 1 - List
-
-
Added you as the top supporter in the main post. :) -
ChaaadMaxxx fσσтвαℓℓ α∂∂ιςт єςσℓєα∂єяBuilder ⛰️ Ex-EcoLeader ⚜️⚜️⚜️ Premium Upgrade
donating $7500!!! (I will donate plenty more if you keep up the good work)
P.S.- Don't worry about that message in convo, .tool command fixed it lol.
This saves tons of time and effort, and you deserve to be rewarded. Everyone can do this macro, and it will save you soooo much time :D.
thanks again 314, you are a beast <3 -
This macro tromps all others, works really well and the support you gave me to set it up was superb. Will donate 10k next time I see you in game. Thanks for your continuous support here at ECC!! :)
Page 4 of 9