• 0

    posted a message on Macro / Keybind Mod
    Quote from Cloud7050»

    Hey mumphrey, I'm on macros 1.11.2's older version (latest version has an issue with the text editor's slider, so I reverted). I was wondering if the following behaviour was intended (documentation states that FILTER is supposed to terminate), and if there's a way to work around it:


    Say there was a chat message "1". I wish for the chat filter script to end after the first FILTER, as my chat filter script is rather long and starts to lag me by running unnecessary tests. Yet, the following code still logs both "text1" and "text2", meaning the script appears to not terminate. I understand that "text3" will not log, because FILTER still somewhat terminates. My understanding of "terminate" is that the entire chat filter instance for that particular chat message will stop running, similar to STOP in a txt file.

    ifmatches(%CHATCLEAN%,"1")
    filter
    log("text3")
    endif
    
    ifmatches(%CHATCLEAN%,"2")
    filter
    else
    log("text1")
    endif
    
    log("text2")



    Is there a way to not run the second IFMATCHES test altogether, if the chat message already gets filtered? (I understand that "[12]" simple regex would work, but the above code is just to demonstrate the issue. I actually have a bunch more different IFMATCHES tests that cannot be simply combined into a single test.)

    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod

    Hey mumphrey, I'm on macros 1.11.2's older version (latest version has an issue with the text editor's slider, so I reverted). I was wondering if the following behaviour was intended (documentation states that FILTER is supposed to terminate), and if there's a way to work around it:


    Say there was a chat message "1". I wish for the chat filter script to end after the first FILTER, as my chat filter script is rather long and starts to lag me by running unnecessary tests. Yet, the following code still logs both "text1" and "text2", meaning the script appears to not terminate. I understand that "text3" will not log, because FILTER still somewhat terminates. My understanding of "terminate" is that the entire chat filter instance for that particular chat message will stop running, similar to STOP in a txt file.

    ifmatches(%CHATCLEAN%,"1")
    filter
    log("text3")
    endif
    
    ifmatches(%CHATCLEAN%,"2")
    filter
    else
    log("text1")
    endif
    
    log("text2")


    Is there a way to not run the second IFMATCHES test altogether, if the chat message already gets filtered? (I understand that "[12]" simple regex would work, but the above code is just to demonstrate the issue. I actually have a bunch more different IFMATCHES tests that cannot be simply combined into a single test.)

    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod

    Hey there, I was wondering if there was a way to do non-integer calculations in the macros mod? Eg, to get a percentage.

    #perca = HELMDURABILITY / HELMDAMAGE
    #percax = #perca * 100

    Where #perca would end up something like 0.5 and then #percax would be 50 (percent).


    I had to use #perca to temporarily hold the value after the first division because "#percax = HELMDURABILITY / HELMDAMAGE * 100" doesn't appear to work.

    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Quote from SPThiel»

    @Joel yes that is possible however not that easy

    1st go to unicode-table.com

    2nd paste your char into the searchbar

    3rd copy the unicode number (there should somewhere be sth like U+1234 written, only copy the numbers)

    4th




    ifmatches(%CHAT%,"\u[Number you got above]")

    log("Char is in the String")

    endif



    For your char:

    Unicode-number = U+2666

    -> 2666

    ->



    ifmatches(%CHAT%,"\u2666")

    log("There's a black diamind suit in the line")

    endif



    Thank you so much!
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod

    Hey there, is it possible to test for symbols in the chat filter, such as ♦?

    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod

    Hey there, I realised that putting a semicolon anywhere inside a command will cause the command to cease functionality.

    For example, this command here for replacing all semicolons with 0:

    replace(&chat,;,0)


    will break and act like this incomplete command, thus not working:

    replace(&chat,;


    Is it possible to use semicolons in commands through some form of workaround? Because similarly, attempting to log anything with a semicolon inside breaks the command.

    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod

    Hey there, is there a way to "transfer" array data?


    For example, &local[] consists of:

    &local[0] being 1

    &local[1] being 2


    How would I transfer this data into @&global[], such that:

    @&global[0] is 1

    @&global[1] is 2

    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Quote from SPThiel»

    if(CHATCLEAN == "<cloud7050> test") //best way to do
    if(%CHATCLEAN% == "<cloud7050> test") //works to
    if(%CHATCLEAN% = "<cloud7050> test") //also works
    if(CHATCLEAN = "<cloud7050> test") //I think this works too, don't know though

    the thing is, if there's a leading space or if the text ends with a space this won't work.
    You can test that if you do
    ifmatches(%CHATCLEAN%,"^<cloud7050> test$")

    if this is false there's a space somewhere

    Strangely, the four ways to use IF that you said should work, don't work in the chat filter. However, the IFMATCHES that you brought up using ^$ was exactly what I needed (just tried it, it worked for "test" but not "testing"). Thanks!
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod

    Hey there, I've tried experimenting with a variety of onChat IF tests and I can't get it to work. I've tried:


    if(CHATCLEAN == "<cloud7050> test")
    if(%CHATCLEAN% == "<cloud7050> test")
    if(CHATCLEAN == <cloud7050> test)
    if(%CHATCLEAN% == <cloud7050> test)

    However unfortunately none of these worked.


    The only way I managed to make it work was with IFMATCHES:

    ifmatches(%CHATCLEAN%,"<cloud7050> test")

    But this meant "<cloud7050> testing" would also return positive results as the word "testing" contains "test". So I had to do this which is inconvenient as it required more code for each test:

    ifmatches(%CHATCLEAN%,"[\s\S]+<cloud7050> test[\s\S]+")
    else
    ifmatches(%CHATCLEAN%,"test")

    Any help with getting IF to work would be much appreciated. Thanks in advance!

    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod

    Anyone else having the same issue or knows if this affects? I have macros 1.11 with optifine 1.11 added as a forge mod, but my optifine cape doesn't show up. It used to on macros 1.8.

    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Quote from Cloud7050»

    Still stuck on this, any help would be much appreciated! :)








    Hey I was wondering how to divide a number (including big numbers). I know a way to do this would be to minus the denominator each time till the value is < the denominator, to obtain a remainder, but for big numbers that's very slow so I was wondering how to do something like this:


    #number is 13, I wish to divide it by 3. How would I obtain 4 as the answer and 1 as the remainder?




    Yeah still stuck :(
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Quote from Cloud7050»

    Hey I was wondering how to divide a number (including big numbers). I know a way to do this would be to minus the denominator each time till the value is < the denominator, to obtain a remainder, but for big numbers that's very slow so I was wondering how to do something like this:


    #number is 13, I wish to divide it by 3. How would I obtain 4 as the answer and 1 as the remainder?


    Still stuck on this, any help would be much appreciated! :)
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Quote from Treuce»

    Could anyone help me with chat filter? How can I achieve that when I type anything in chat it'll use a color code by default and I don't have to type the color code every time? Tried it with "OnChat" but that didn't work. I don't want to have a macro coming up every time I want to type something.


    OnSendChatMessage or something like that is what you need to modify chat packets I believe. onchat and chat filter only filter what has already been sent, just that one acts before the message shows and the other acts after the message shows.
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod

    Hey I was wondering how to divide a number (including big numbers). I know a way to do this would be to minus the denominator each time till the value is < the denominator, to obtain a remainder, but for big numbers that's very slow so I was wondering how to do something like this:


    #number is 13, I wish to divide it by 3. How would I obtain 4 as the answer and 1 as the remainder?

    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod

    Hey mumfrey I may have found a bug. In macros 1.11.2, PLAYSOUND doesn't appear to work, both via chat filter and via keybind.


    I used $${playsound(tile.piston.in)}$$ for the keybind. I have checked sound settings. A manual piston can produce the sound but the macro cannot.

    Posted in: Minecraft Mods
  • To post a comment, please .