The Meaning of Life, the Universe, and Everything.
Join Date:
4/3/2015
Posts:
43
Member Details
Mart, if I bind the script to OnHealthChange, won't it set this_script_lock and loop for this_script_paused even when the main script isn't running and thus get stuck in an endless loop? If there is a way to tell what scripts are running, then this would work.
Mart, if I bind the script to OnHealthChange, won't it set this_script_lock and loop for this_script_paused even when the main script isn't running and thus get stuck in an endless loop? If there is a way to tell what scripts are running, then this would work.
If you want it to wait for the main script to finish before it does its' thing, then yes
Not an ideal solution, but how about inverting this_script_paused to mean this_script_running
then you can set that when the main script starts, unset it when the main script finishes, and onHealthChange will not wait for it to pause
This only works if the script doesn't end abruptly though (such as with closing the game mid-script)
I don't know of any way to check for running scripts, but if you want.., you could use a global array for that
have every script register its' running into the global array when it starts, and unregister whenever it finishes or Stop()'s
Stop(*) would have to be replaced by something by Stop(*);Unset(@&running_scripts) and such
You'd probably use a mini file-include for that, just plop it in front of any script that might matter, that runs for any reasonable amount of time
If you want i can try and write something like that
that works fine, but I can't seem to write a code to do /feed (or eat food in my hotbar) when my hunger bar starts to go down:
if(HUNGER=20)
log("&4[Macro] Fed has stopped");
unset(Fed);
stop();
else;
log("&2[Macro] Fed has started");
set(Fed);
do;
if(HUNGER!=20)
echo("/feed);
endif;
loop;
that's prolly the most derp code I've written and it semi-works. I want to keep the script running if my hunger bar decreases from 20 several times, and not activating it by myself
Can anyone help me to do a javascript macro (or whatever it's called).
I basically want to farm XP and keep my hunger satisfied when I reach a certain amount of hunger.
This is the code I have for "grinding":
that works fine, but I can't seem to write a code to do /feed (or eat food in my hotbar) when my hunger bar starts to go down:
that's prolly the most derp code I've written and it semi-works. I want to keep the script running if my hunger bar decreases from 20 several times, and not activating it by myself
1) "javascript" is completely unrelated to this mod..
it's also completely unrelated to java (javascript is to java as carpet is to car)
2) Always use the right event for the job.., in this case, you only care for it to do something when your hunger changes, so use onHungerChange
doing that already saves you from having these infinite loops, and what you're left with is
IF(HUNGER != 20)
Echo("/feed")
ENDIF
of course this isn't toggleable right now.., but you can add that in as well - here's an example that you can toggle with some key
<on some key>
Toggle(@autofeed_active)
IF(@autofeed_active)
Log("[Macro] Fed online")
ELSE;
Log("[Macro] Fed offline")
ENDIF
<onHungerChange>
IF(@autofeed_active)
IF(HUNGER != 20); //yes, you could combine the two conditions but it looks clearer to me separately
Echo("/feed")
ENDIF
ENDIF
----
Note the indentation.., all pairs like Do();Loop or IF;ENDIF should have their contents indented further.., it makes the code a LOT easier to read
for example your supposed "mess", when indented, looks like this
IF(HUNGER=20); (1)
log("&4[Macro] Fed has stopped");
unset(Fed); (2)
stop();
ELSE;
log("&2[Macro] Fed has started");
set(Fed); (2)
DO;
IF(HUNGER!=20)
echo("/feed);
ENDIF;
LOOP;
(3)
It also makes mistakes easier to spot.., i didn't notice any at first but indenting it i found three
1) The outer condition checks for hunger.., it should check for Fed (so if Fed, unset and stop, if not Fed, set and start looping)
2) user variables MUST be all lowercase.., so Fed just wouldn't work anyway, replace both 2's and the 1 with "fed" or "running"
If you want it to wait for the main script to finish before it does its' thing, then yes
Not an ideal solution, but how about inverting this_script_paused to mean this_script_running
then you can set that when the main script starts, unset it when the main script finishes, and onHealthChange will not wait for it to pause
This only works if the script doesn't end abruptly though (such as with closing the game mid-script)
I don't know of any way to check for running scripts, but if you want.., you could use a global array for that
have every script register its' running into the global array when it starts, and unregister whenever it finishes or Stop()'s
Stop(*) would have to be replaced by something by Stop(*);Unset(@&running_scripts) and such
You'd probably use a mini file-include for that, just plop it in front of any script that might matter, that runs for any reasonable amount of time
If you want i can try and write something like that
Ok I think I have something figured out, but thanks though!
Can anyone help me to do a javascript macro (or whatever it's called).
I basically want to farm XP and keep my hunger satisfied when I reach a certain amount of hunger.
This is the code I have for "grinding":
that works fine, but I can't seem to write a code to do /feed (or eat food in my hotbar) when my hunger bar starts to go down:
that's prolly the most derp code I've written and it semi-works. I want to keep the script running if my hunger bar decreases from 20 several times, and not activating it by myself
Here's something I wrote for getting a potato out of my inv and eating it. If you use it just change where ever it says baked_potato to what ever you have to eat.
//Check for hunger
IF(%HUNGER% != 20)
PICK(baked_potato)
IF(%ITEM% != "baked_potato")
LOG(food not in hotbar)
KEY(inventory)
WAIT(500ms)
GETSLOT("baked_potato",#food)
Something i wanted to look into for a while but just never got around to it and could prob implement it into my scripts individually but @mart3323 do you have any good suggestions to a "pause" function for macros that automate things (especially ones that move). Im sure i could go down to the main loop in my scripts and add a function that waits for a key then just waits() until its pressed again but im looking for something more universal i can call anywhere. Im pretty sure MM cant do this though. Especially without functions.
Something i wanted to look into for a while but just never got around to it and could prob implement it into my scripts individually but @mart3323 do you have any good suggestions to a "pause" function for macros that automate things (especially ones that move). Im sure i could go down to the main loop in my scripts and add a function that waits for a key then just waits() until its pressed again but im looking for something more universal i can call anywhere. Im pretty sure MM cant do this though. Especially without functions.
literally just talked about this with jyrx on the thread =P
tl;dr is that pausing a thread isn't something you're generally able to dofrom outside the thread itself, and the same goes for this mod
if you need the behaviour you must put in manual breakpoints
java.lang.IncompatibleClassChangeError: Found class com.mumfrey.liteloader.util.Input, but interface was expected
at net.eq2online.macros.input.InputHandlerModuleJInput.<init>(InputHandlerModuleJInput.java:90)
at net.eq2online.macros.core.MacroModCore.initInputHandler(MacroModCore.java:365)
at net.eq2online.macros.core.MacroModCore.onTickInGUI(MacroModCore.java:844)
at net.eq2online.macros.LiteModMacros.onTick(LiteModMacros.java:127)
at com.mumfrey.liteloader.core.event.HandlerList$Tickable9.onTick(HandlerList$Tickable9.java:100)
at com.mumfrey.liteloader.client.LiteLoaderEventBrokerClient.onTick(LiteLoaderEventBrokerClient.java:406)
at com.mumfrey.liteloader.client.CallbackProxyClient.onTick(CallbackProxyClient.java:69)
at com.mumfrey.liteloader.core.event.EventProxy.$event00005(EventProxy.java:216)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1056)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:345)
at net.minecraft.client.main.Main.main(SourceFile:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.8
Operating System: Windows 8.1 (amd64) version 6.3
Java Version: 1.8.0_25, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 164757848 bytes (157 MB) / 366395392 bytes (349 MB) up to 1060372480 bytes (1011 MB)
Mod Pack: 1.8-SNAPSHOT-r370-b50-2015-07-27_18-55-07
LiteLoader Mods: 2 loaded mod(s)
- Macro / Keybind Mod version 0.11.1 beta 1
- WorldEditCUI version 1.8.0_03
LaunchWrapper: 25 active transformer(s)
- Transformer: net.minecraftforge.fml.common.asm.transformers.PatchingTransformer
- Transformer: optifine.OptiFineClassTransformer
- Transformer: net.minecraftxray.loader.b
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.BlamingTransformer
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.MarkerTransformer
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.SideTransformer
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.EventSubscriptionTransformer
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.EventSubscriberTransformer
- Transformer: $wrapper.net.minecraftforge.classloading.FluidIdTransformer
- Transformer: com.mumfrey.liteloader.transformers.event.EventProxyTransformer
- Transformer: com.mumfrey.liteloader.launch.LiteLoaderTransformer
- Transformer: com.mumfrey.liteloader.client.transformers.CrashReportTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.DeobfuscationTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.AccessTransformer
- Transformer: net.minecraftforge.transformers.ForgeAccessTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.ModAccessTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.ItemStackTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.TerminalTransformer
- Transformer: com.mumfrey.liteloader.transformers.event.EventTransformer
- Transformer: com.mumfrey.liteloader.common.transformers.LiteLoaderPacketTransformer
- Transformer: com.mumfrey.liteloader.client.transformers.LiteLoaderEventInjectionTransformer
- Transformer: com.mumfrey.liteloader.client.transformers.MinecraftTransformer
- Transformer: net.eq2online.macros.input.InputHandlerInjector
- Transformer: com.mumfrey.liteloader.transformers.event.json.ModEventInjectionTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.ModAPITransformer
JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: Minecraft 1.8 MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.3.1502 Optifine OptiFine_1.8_HD_U_D5 3 mods loaded, 3 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCHIJA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
UCHIJA FML{8.0.99.99} [Forge Mod Loader] (forge-1.8-11.14.3.1502.jar)
UCHIJA Forge{11.14.3.1502} [Minecraft Forge] (forge-1.8-11.14.3.1502.jar)
Loaded coremods (and transformers):
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 347.52' Renderer: 'GeForce GTX 970/PCIe/SSE2'
Launched Version: 1.8-Forge11.14.3.1502
XRay Version: 4.1.6
LWJGL: 2.9.1
OpenGL: GeForce GTX 970/PCIe/SSE2 GL version 4.5.0 NVIDIA 347.52, NVIDIA Corporation
GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.
Using VBOs: No
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: [painterly.zip]
Current Language: English (US)
Profiler Position: N/A (disabled)
java.lang.IncompatibleClassChangeError: Found class com.mumfrey.liteloader.util.Input, but interface was expected
at net.eq2online.macros.input.InputHandlerModuleJInput.(InputHandlerModuleJInput.java:90)
at net.eq2online.macros.core.MacroModCore.initInputHandler(MacroModCore.java:365)
at net.eq2online.macros.core.MacroModCore.onTickInGUI(MacroModCore.java:844)
at net.eq2online.macros.LiteModMacros.onTick(LiteModMacros.java:127)
at com.mumfrey.liteloader.core.event.HandlerList$Tickable9.onTick(HandlerList$Tickable9.java:100)
at com.mumfrey.liteloader.client.LiteLoaderEventBrokerClient.onTick(LiteLoaderEventBrokerClient.java:406)
at com.mumfrey.liteloader.client.CallbackProxyClient.onTick(CallbackProxyClient.java:69)
at com.mumfrey.liteloader.core.event.EventProxy.$event00005(EventProxy.java:216)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1056)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:345)
at net.minecraft.client.main.Main.main(SourceFile:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.8
Operating System: Windows 8.1 (amd64) version 6.3
Java Version: 1.8.0_25, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 164757848 bytes (157 MB) / 366395392 bytes (349 MB) up to 1060372480 bytes (1011 MB)
Mod Pack: 1.8-SNAPSHOT-r370-b50-2015-07-27_18-55-07
LiteLoader Mods: 2 loaded mod(s)
- Macro / Keybind Mod version 0.11.1 beta 1
- WorldEditCUI version 1.8.0_03
LaunchWrapper: 25 active transformer(s)
- Transformer: net.minecraftforge.fml.common.asm.transformers.PatchingTransformer
- Transformer: optifine.OptiFineClassTransformer
- Transformer: net.minecraftxray.loader.b
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.BlamingTransformer
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.MarkerTransformer
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.SideTransformer
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.EventSubscriptionTransformer
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.EventSubscriberTransformer
- Transformer: $wrapper.net.minecraftforge.classloading.FluidIdTransformer
- Transformer: com.mumfrey.liteloader.transformers.event.EventProxyTransformer
- Transformer: com.mumfrey.liteloader.launch.LiteLoaderTransformer
- Transformer: com.mumfrey.liteloader.client.transformers.CrashReportTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.DeobfuscationTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.AccessTransformer
- Transformer: net.minecraftforge.transformers.ForgeAccessTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.ModAccessTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.ItemStackTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.TerminalTransformer
- Transformer: com.mumfrey.liteloader.transformers.event.EventTransformer
- Transformer: com.mumfrey.liteloader.common.transformers.LiteLoaderPacketTransformer
- Transformer: com.mumfrey.liteloader.client.transformers.LiteLoaderEventInjectionTransformer
- Transformer: com.mumfrey.liteloader.client.transformers.MinecraftTransformer
- Transformer: net.eq2online.macros.input.InputHandlerInjector
- Transformer: com.mumfrey.liteloader.transformers.event.json.ModEventInjectionTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.ModAPITransformer
JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: Minecraft 1.8 MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.3.1502 Optifine OptiFine_1.8_HD_U_D5 3 mods loaded, 3 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCHIJA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
UCHIJA FML{8.0.99.99} [Forge Mod Loader] (forge-1.8-11.14.3.1502.jar)
UCHIJA Forge{11.14.3.1502} [Minecraft Forge] (forge-1.8-11.14.3.1502.jar)
Loaded coremods (and transformers):
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 347.52' Renderer: 'GeForce GTX 970/PCIe/SSE2'
Launched Version: 1.8-Forge11.14.3.1502
XRay Version: 4.1.6
LWJGL: 2.9.1
OpenGL: GeForce GTX 970/PCIe/SSE2 GL version 4.5.0 NVIDIA 347.52, NVIDIA Corporation
GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.
Using VBOs: No
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: [painterly.zip] Current Language: English (US)
Profiler Position: N/A (disabled)
Looks like you're using the beta 1 of the macro mod. There is a beta 2 out. Try that one.
I don't understand this, the mod was working perfectly, and without doing any changes, suddenly it won't load automatically the server config. I didn't deactivate it, in fact I tried disabling that function and enabling it again just in case, but nothing, every time I open the game, it loads default config and I find no way to make it load every specific server config as it used to do automatically before :/
Pleaseeee update Realy need AutoCraft in the Beta it dont work please fix i realy need it
You could just make an auto crafting script for any particular item using getslot and slotclick. If you don't know how, let me know and I'll throw something together for you.
It's in beta for 1.8. Mumfrey doesn't put them directly in the op because the idea is that if people aren't willing to find it linked somewhere in this thread, then they aren't going to be able to deal with the bugs. (though there are few that I've found.) Anyways the easiest way to find the betas are by going to the op and in the downloads section, click on the link by older versions. Then click on prerelease, which is the fourth from the bottom.
Thanks for responding jryx :D. My problem isn't so much willingness, but more that I simply spend too much time Modding as it is (probably more then I spend playing) and that searching through everything for tiny little details just adds exponentially to that time.
I'm trying to use WAIT(1ms) in a loop in an unsafe block, but when I do that it does it every 50ms instead. Is this intended behaviour?
50ms is the atomic unit of time in the game, you can't do anything with more precision
Personally i always specify wait time in ticks or whole seconds, as a reminder of this fact =P
why do you need 1ms of wait though? It sounds like there's probably a better way to do whatever you're trying to
if it's something gameplay, latency is going to mess you up anyway
if it's calculating something, you should always be able to do that without atomic delays
Thanks for responding jryx :D. My problem isn't so much willingness, but more that I simply spend too much time Modding as it is (probably more then I spend playing) and that searching through everything for tiny little details just adds exponentially to that time.
That's the idea.., people who don't have time and a willingness to put up with stuff should either get a stable version or assume there is none, rather than waste more of their own time putting up with various bugs and stuff
I have a problem where any change that I make is not saved after reopening minecraft. If I move, delete, or create a macro it just gets reverted after closing and restarting the client. It did work at one point but after taking a 1 year break from minecraft I'm having this problem. I tried removing all other mods and that didn't help. I'm using the version for 1.7.2. Any idea what could be causing it?
Hmm, I am trying to paste the § sign in a book for color codes, but if I use Type(§) It will try to type it in the book (Duuhh)0, but you cant type § in a book, you gotta paste it. Is there something for that?
I.., guess you could use Press() with LWJGL keycodes, but that's getting real hacky now
I'm also not sure how you'd handle holding ctrl down for the ctrl-v
*Edit: Tried it ingame, couldn't figure it out.., for some reason Press() would only type capital letters, even though caps lock is off, disabled, and the script was literally Wait(1);Press(47)
47 being the v key
----
Perhaps there's a module for reading/writing books?
I have a problem where any change that I make is not saved after reopening minecraft. If I move, delete, or create a macro it just gets reverted after closing and restarting the client. It did work at one point but after taking a 1 year break from minecraft I'm having this problem. I tried removing all other mods and that didn't help. I'm using the version for 1.7.2. Any idea what could be causing it?
The only thing I can think of is that the mod is saving it in a different directory than where minecraft is located. I'm not sure how the mod determines where to save the macros though... Are you using a fresh install or old files from a year ago? Are you using the standard .minecraft folder in appdata or did you change the directory in the launcher? Or another thing could be the path is different because the user is different. Any info you can give about how your environment has changed in the past year could be helpful to diagnose this. (of course if you are using a fresh install then it shouldn't matter...)
The Meaning of Life, the Universe, and Everything.
Join Date:
3/20/2012
Posts:
1,544
Member Details
First time user of this mod and since it's been around for a while , there must be some people , that can do this in their sleep .
Does anyone have a script that will fly a spiral out from Co-Ords.. 0,0 that can be used in single player to generate my minimap mod .I have to fly over an area before the the terrain gets added to the in game map permanently .Not the Browser Dynmap .
So the script should fly outward in an ever increasing square adding on an overlap of 300 blocks
First time user of this mod and since it's been around for a while , there must be some people , that can do this in their sleep .
Does anyone have a script that will fly a spiral out from Co-Ords.. 0,0 that can be used in single player to generate my minimap mod .I have to fly over an area before the the terrain gets added to the in game map permanently .Not the Browser Dynmap .
So the script should fly outward in an ever increasing square adding on an overlap of 300 blocks
Thanks
Can you use the /tp command?
This mod doesn't really automate movement so that logic tends to be complicated, but if we can do it by chat then it will be
1) Really simple, easy to make
2) Reliable because of the above
3) Quick, because teleportation
If not, do you have ANY mods or plugins that you think might be helpful?
----
Also, while i'm asking questions it would be really great to know the shape and size of your sight range and the time you have to spend for it to register (or is it instant?, hypothetically if you teleport to a place and then back a second later, will it still map?)
Mart, if I bind the script to OnHealthChange, won't it set this_script_lock and loop for this_script_paused even when the main script isn't running and thus get stuck in an endless loop? If there is a way to tell what scripts are running, then this would work.
If you want it to wait for the main script to finish before it does its' thing, then yes
Not an ideal solution, but how about inverting this_script_paused to mean this_script_running
then you can set that when the main script starts, unset it when the main script finishes, and onHealthChange will not wait for it to pause
This only works if the script doesn't end abruptly though (such as with closing the game mid-script)
I don't know of any way to check for running scripts, but if you want.., you could use a global array for that
have every script register its' running into the global array when it starts, and unregister whenever it finishes or Stop()'s
Stop(*) would have to be replaced by something by Stop(*);Unset(@&running_scripts) and such
You'd probably use a mini file-include for that, just plop it in front of any script that might matter, that runs for any reasonable amount of time
If you want i can try and write something like that
'Cause tomorrow spring is here
Can anyone help me to do a javascript macro (or whatever it's called).
I basically want to farm XP and keep my hunger satisfied when I reach a certain amount of hunger.
This is the code I have for "grinding":
that works fine, but I can't seem to write a code to do /feed (or eat food in my hotbar) when my hunger bar starts to go down:
that's prolly the most derp code I've written and it semi-works. I want to keep the script running if my hunger bar decreases from 20 several times, and not activating it by myself
1) "javascript" is completely unrelated to this mod..
it's also completely unrelated to java (javascript is to java as carpet is to car)
2) Always use the right event for the job.., in this case, you only care for it to do something when your hunger changes, so use onHungerChange
doing that already saves you from having these infinite loops, and what you're left with is
IF(HUNGER != 20)
Echo("/feed")
ENDIF
of course this isn't toggleable right now.., but you can add that in as well - here's an example that you can toggle with some key
<on some key>
Toggle(@autofeed_active)
IF(@autofeed_active)
ELSE;
ENDIF
<onHungerChange>
IF(@autofeed_active)
ENDIF
----
Note the indentation.., all pairs like Do();Loop or IF;ENDIF should have their contents indented further.., it makes the code a LOT easier to read
for example your supposed "mess", when indented, looks like this
IF(HUNGER=20); (1)
ELSE;
(3)
It also makes mistakes easier to spot.., i didn't notice any at first but indenting it i found three
1) The outer condition checks for hunger.., it should check for Fed (so if Fed, unset and stop, if not Fed, set and start looping)
2) user variables MUST be all lowercase.., so Fed just wouldn't work anyway, replace both 2's and the 1 with "fed" or "running"
3) missing ENDIF to close the outer IF
'Cause tomorrow spring is here
Ok I think I have something figured out, but thanks though!
Here's something I wrote for getting a potato out of my inv and eating it. If you use it just change where ever it says baked_potato to what ever you have to eat.
//Check for hunger
IF(%HUNGER% != 20)
IF(%ITEM% != "baked_potato")
KEY(inventory)
WAIT(500ms)
GETSLOT("baked_potato",#food)
IF(%#food% = -1)
ECHO(/home bed)
STOP(all)
SLOTCLICK(44)
WAIT(200ms)
SLOTCLICK(%#food%)
WAIT(200ms)
SLOTCLICK(44)
WAIT(200ms)
LOG(closing inv)
GUI
WAIT(500ms)
PICK(baked_potato)
DO
ENDIF
**If someone can show me how to indent stuff it would be greatly appreciated!****I looked at Gorlem's markdown tut and couldn't figure it out****I just realized the editor says markup not markdown... that's probably why bold isn't working either**Nevermind
Something i wanted to look into for a while but just never got around to it and could prob implement it into my scripts individually but @mart3323 do you have any good suggestions to a "pause" function for macros that automate things (especially ones that move). Im sure i could go down to the main loop in my scripts and add a function that waits for a key then just waits() until its pressed again but im looking for something more universal i can call anywhere. Im pretty sure MM cant do this though. Especially without functions.
literally just talked about this with jyrx on the thread =P
tl;dr is that pausing a thread isn't something you're generally able to dofrom outside the thread itself, and the same goes for this mod
if you need the behaviour you must put in manual breakpoints
IF(@halt_exec);Set(@halting_exec);Do();While(@halt_exec);Unset(@halting_exec);ENDIF
'Cause tomorrow spring is here
Dunno if this has been fixed already but I'm using the 1.8 version of this and getting 100% crashes on launch. Here is the error message.
Time: 8/6/15 11:49 PM
Description: Unexpected error
java.lang.IncompatibleClassChangeError: Found class com.mumfrey.liteloader.util.Input, but interface was expected
at net.eq2online.macros.input.InputHandlerModuleJInput.<init>(InputHandlerModuleJInput.java:90)
at net.eq2online.macros.core.MacroModCore.initInputHandler(MacroModCore.java:365)
at net.eq2online.macros.core.MacroModCore.onTickInGUI(MacroModCore.java:844)
at net.eq2online.macros.LiteModMacros.onTick(LiteModMacros.java:127)
at com.mumfrey.liteloader.core.event.HandlerList$Tickable9.onTick(HandlerList$Tickable9.java:100)
at com.mumfrey.liteloader.client.LiteLoaderEventBrokerClient.onTick(LiteLoaderEventBrokerClient.java:406)
at com.mumfrey.liteloader.client.CallbackProxyClient.onTick(CallbackProxyClient.java:69)
at com.mumfrey.liteloader.core.event.EventProxy.$event00005(EventProxy.java:216)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1056)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:345)
at net.minecraft.client.main.Main.main(SourceFile:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.8
Operating System: Windows 8.1 (amd64) version 6.3
Java Version: 1.8.0_25, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 164757848 bytes (157 MB) / 366395392 bytes (349 MB) up to 1060372480 bytes (1011 MB)
Mod Pack: 1.8-SNAPSHOT-r370-b50-2015-07-27_18-55-07
LiteLoader Mods: 2 loaded mod(s)
- Macro / Keybind Mod version 0.11.1 beta 1
- WorldEditCUI version 1.8.0_03
LaunchWrapper: 25 active transformer(s)
- Transformer: net.minecraftforge.fml.common.asm.transformers.PatchingTransformer
- Transformer: optifine.OptiFineClassTransformer
- Transformer: net.minecraftxray.loader.b
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.BlamingTransformer
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.MarkerTransformer
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.SideTransformer
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.EventSubscriptionTransformer
- Transformer: $wrapper.net.minecraftforge.fml.common.asm.transformers.EventSubscriberTransformer
- Transformer: $wrapper.net.minecraftforge.classloading.FluidIdTransformer
- Transformer: com.mumfrey.liteloader.transformers.event.EventProxyTransformer
- Transformer: com.mumfrey.liteloader.launch.LiteLoaderTransformer
- Transformer: com.mumfrey.liteloader.client.transformers.CrashReportTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.DeobfuscationTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.AccessTransformer
- Transformer: net.minecraftforge.transformers.ForgeAccessTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.ModAccessTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.ItemStackTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.TerminalTransformer
- Transformer: com.mumfrey.liteloader.transformers.event.EventTransformer
- Transformer: com.mumfrey.liteloader.common.transformers.LiteLoaderPacketTransformer
- Transformer: com.mumfrey.liteloader.client.transformers.LiteLoaderEventInjectionTransformer
- Transformer: com.mumfrey.liteloader.client.transformers.MinecraftTransformer
- Transformer: net.eq2online.macros.input.InputHandlerInjector
- Transformer: com.mumfrey.liteloader.transformers.event.json.ModEventInjectionTransformer
- Transformer: net.minecraftforge.fml.common.asm.transformers.ModAPITransformer
JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: Minecraft 1.8 MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.3.1502 Optifine OptiFine_1.8_HD_U_D5 3 mods loaded, 3 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCHIJA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
UCHIJA FML{8.0.99.99} [Forge Mod Loader] (forge-1.8-11.14.3.1502.jar)
UCHIJA Forge{11.14.3.1502} [Minecraft Forge] (forge-1.8-11.14.3.1502.jar)
Loaded coremods (and transformers):
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 347.52' Renderer: 'GeForce GTX 970/PCIe/SSE2'
Launched Version: 1.8-Forge11.14.3.1502
XRay Version: 4.1.6
LWJGL: 2.9.1
OpenGL: GeForce GTX 970/PCIe/SSE2 GL version 4.5.0 NVIDIA 347.52, NVIDIA Corporation
GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.
Using VBOs: No
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: [painterly.zip]
Current Language: English (US)
Profiler Position: N/A (disabled)
Looks like you're using the beta 1 of the macro mod. There is a beta 2 out. Try that one.
I don't understand this, the mod was working perfectly, and without doing any changes, suddenly it won't load automatically the server config. I didn't deactivate it, in fact I tried disabling that function and enabling it again just in case, but nothing, every time I open the game, it loads default config and I find no way to make it load every specific server config as it used to do automatically before :/
You could just make an auto crafting script for any particular item using getslot and slotclick. If you don't know how, let me know and I'll throw something together for you.
Thanks for responding jryx :D. My problem isn't so much willingness, but more that I simply spend too much time Modding as it is (probably more then I spend playing) and that searching through everything for tiny little details just adds exponentially to that time.
50ms is the atomic unit of time in the game, you can't do anything with more precision
Personally i always specify wait time in ticks or whole seconds, as a reminder of this fact =P
why do you need 1ms of wait though? It sounds like there's probably a better way to do whatever you're trying to
if it's something gameplay, latency is going to mess you up anyway
if it's calculating something, you should always be able to do that without atomic delays
That's the idea.., people who don't have time and a willingness to put up with stuff should either get a stable version or assume there is none, rather than waste more of their own time putting up with various bugs and stuff
'Cause tomorrow spring is here
I have a problem where any change that I make is not saved after reopening minecraft. If I move, delete, or create a macro it just gets reverted after closing and restarting the client. It did work at one point but after taking a 1 year break from minecraft I'm having this problem. I tried removing all other mods and that didn't help. I'm using the version for 1.7.2. Any idea what could be causing it?
log the GUI variable to find out what it is, make an IF block to check for that value, then use Type() i guess
IF(GUI = "something_find_out_what");Type(your_message);ENDIF
'Cause tomorrow spring is here
I.., guess you could use Press() with LWJGL keycodes, but that's getting real hacky now
I'm also not sure how you'd handle holding ctrl down for the ctrl-v
*Edit: Tried it ingame, couldn't figure it out.., for some reason Press() would only type capital letters, even though caps lock is off, disabled, and the script was literally Wait(1);Press(47)
47 being the v key
----
Perhaps there's a module for reading/writing books?
'Cause tomorrow spring is here
Nope, that was it, Press() is the most low level command there is - if that doesn't work and there's no module, it's probably impossible
'Cause tomorrow spring is here
The only thing I can think of is that the mod is saving it in a different directory than where minecraft is located. I'm not sure how the mod determines where to save the macros though... Are you using a fresh install or old files from a year ago? Are you using the standard .minecraft folder in appdata or did you change the directory in the launcher? Or another thing could be the path is different because the user is different. Any info you can give about how your environment has changed in the past year could be helpful to diagnose this. (of course if you are using a fresh install then it shouldn't matter...)
First time user of this mod and since it's been around for a while , there must be some people , that can do this in their sleep .
Does anyone have a script that will fly a spiral out from Co-Ords.. 0,0 that can be used in single player to generate my minimap mod .I have to fly over an area before the the terrain gets added to the in game map permanently .Not the Browser Dynmap .
So the script should fly outward in an ever increasing square adding on an overlap of 300 blocks
Thanks
Can you use the /tp command?
This mod doesn't really automate movement so that logic tends to be complicated, but if we can do it by chat then it will be
1) Really simple, easy to make
2) Reliable because of the above
3) Quick, because teleportation
If not, do you have ANY mods or plugins that you think might be helpful?
----
Also, while i'm asking questions it would be really great to know the shape and size of your sight range and the time you have to spend for it to register (or is it instant?, hypothetically if you teleport to a place and then back a second later, will it still map?)
'Cause tomorrow spring is here