• 0

    posted a message on Macro / Keybind Mod
    XPOS does not seem to be reporting any value.

    log(%XPOS%); returned the xcoord before...now it only returns "XPOS"

    Is there a new function for grabbing your current coordinates?
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Quote from MattBDEV

    I'm not sure but I believe potions are stored with metadata. So you need to get the item's metadata to determine what potion it is.


    Is it possible to acquire said data with macromod?
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Quote from MattBDEV

    Well he just told you it is no longer an integer it is a string. So you need to use &id because the '&' symbol represents a string. The '#' represents an integer and id's are no longer integers.


    Yea, just realized that one.

    One other question, I can't seem to find names for specific potions. Drawing the name from the getslotitem simply says 'potion'. Is there no way to differentiate between potions anymore?
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Quote from MegaSniperB

    In 1.7 and on there is no longer block ids, they are now there name, for example minecraft:stone. This means that the id is now the name and it is no longer an integer it is a string. I hope this helps.


    It should still be assigning the name to it though right? If I add a log(%#id%) afterward, I simply get a '1' if an item is there. What do I put in the place of the #id to capture the item name to use farther down the loop?
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Can confirm:

    getslotitem(slot,#id,#stack)

    Is not attaching a value to the #id variable.
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Quote from Mumfrey

    INDEXOF(&test[],#pos,"%#chat[2]%");
    IF(#pos > -1)
    // player is in the array
    ELSE
    // player is not in the array
    ENDIF;



    I have no idea.


    No, it still needs valid tokens for each expression, you still need to expand #j to its value prior to parsing so
    IF(&test[%#j%] = &chat[2]);

    is the correct syntax.


    This worked beautifully. My next question is, since I am preforming all this using an ONCHAT macro, is it possible to make the macro wait until it finishes to run again? My problem is that it goes for about 2 minutes. Someone else can message in that time, and steal the variable chat[2] and end up catching the second half of the macro instead of the original player who messaged.
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Quote from Mumfrey

    INDEXOF(&test[],#pos,"%#chat[2]%");
    IF(#pos > -1)
    // player is in the array
    ELSE
    // player is not in the array
    ENDIF;



    I have no idea.


    No, it still needs valid tokens for each expression, you still need to expand #j to its value prior to parsing so
    IF(&test[%#j%] = &chat[2]);

    is the correct syntax.


    Thank you so much Mumfrey for the quick response and help. This mod has allowed me to play so little minecraft while playing so much minecraft! Keep up the amazing work. I will test all this when I get home from work.
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Quote from Mumfrey

    The problem is, it won't actually stop the idiots posting, because they never read the thread beforehand and I get the impression many don't even read the replies, so there's always the barrage of stupid and any measure of context or sense is just lost on them. The thing about having an angry image macro to post is that at least it provides some catharsis for me.


    Expansion inside conditionals works differently to expansion elsewhere, so what looks right when you LOG it is not providing the result you want because it's expanding to the wrong thing:

    Basically the condition engine works with numbers only, so for string comparisons it actually assigns each new string a unique ID number and compares those, so if you have two strings "foo" and "bar" imagine that the condition engine assigns random numbers to the strings and works it out like this:
    IF("foo" = "bar");
    becomes
    IF(2347224 = 3249872);

    so it's true or false, which is why
    IF("foo" > "bar");

    could produce a random result (it probably won't because the "random number" is from a fixed pool).

    The % sign expansion operator recursively expands a variable to a string representation of itself and in most places in the script engine this means it converts a variable to its literal value. However conditionals act on variable names as tokens in order to preserve the symantics of the expression for as long as possible, this means that in expression unless you really mean it you should not use the expansion operator. The reason is, a string could contain (for example) the text "6 > 7" but expanding the variable in-place would actually change the meaning of the expression, thus a variable &foo which contains that text would yield:
    IF(&foo = "6 > 7"); // pre-processing
    IF(&foo = 2348674); // literal token replacement
    IF(2348674 = 2348674); // value of variable inserted, replaced with string literal token

    The behaviour for the expansion operator when used inside a conditional thus forcibly quotes the contents of any string variables, so the following happens:
    IF(%&foo% = "6 > 7"); // pre-processing
    IF("6 > 7" = "6 > 7"); // after expansion
    IF(2348674 = 2348674); // literal token replacement

    Now you know this, you can see that using %'s in your string comparison is actually messing up the expression, because you're quoting a replacement which is causing it to be treated as a string, doubling up on the quotes when the variable is expanded:
    IF(%&test[%#j%]% = "%&chat[2]%");
    IF("player" = ""player""); // FALSE


    EDIT:: Also, you could just replace the whole loop with an INDEXOF


    Could you show me the format of how I would use that INDEXOF?

    Also, I still don't quite understand why it is replying them as being equal. I thought it would default to it being false.

    Would

    IF(&test[#j] = &chat[2]);


    provide the result I am looking for?
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Quote from Mart3323

    You have quotation marks around %&chat[2]% but not around %&test[%#j%]%

    Be consistent, have them around both or neither (i'm not sure if that causes errors but it might be it)


    Besides that, i was confused as to the purpose of the #b = 1


    I left out a lot of the code because it is quite lengthy. It essentially sets that variable equal to 1 to confirm that said person is already on the list and should be denied access. It is used later on in an if loop to run the actual commands necessary for access. It is a tool I used to make the code more modular while I tested what was going wrong. I still don't really understand why I would get positive results from the above code over and over. It claims that each time the two sides are equal and outputs #b = 1. I am overall a bit confused about the process of comparing strings.

    I will test the quotes when I get home later.

    Thanks!
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    I am working on a macro for a bot in which people message me to get access to a group temporarily.

    My problem I am running into is comparing strings.

    My macro builds an array of players that message me that I empty daily manually. The script runs through this array 1 item at a time and compares the names to the person that just messaged me. If it matches, it denies them access. For some reason, it is declaring that it always matches and I think the issue is in my comparison of two strings.

    Here is the problematic section:

    FOR(#j,0,%#c%);
    log(test = %&test[%#j%]%);
    log(chat = %&chat[2]%);
    IF(%&test[%#j%]% = "%&chat[2]%");
    #b = 1
    LOG(CAN'T GET ACCESS);
    ELSE;
    log(CAN GET ACCESS);
    ENDIF;
    NEXT;


    '&test' is the array with the saved names from previous requests
    '&chat' is the player who just messaged me.

    The 'log' commands I have just before output properly showing for example:

    test = player1
    chat = player2

    Yet, it will output #b = 1 saying that player 1 = player 2.



    I hope I am simply messing up comparing strings.

    Thanks!
    Posted in: Minecraft Mods
  • 0

    posted a message on TabbyChat v1.10.00 - SMP Chat Overhaul
    Is there a way to install this 'standalone version' alongside forge and liteloader mods? I currently launch using my Liteloader which is tied to the Forge jar.
    Posted in: Minecraft Mods
  • 0

    posted a message on [1.4.6] ʊHostile-PvPʊ ✔ FACTIONS ✔ RAIDING ✔ GRIEFING ✔ NO WHITELIST ✔
    Quote from Aceyoi

    Ign: Aceyoi

    Promoted.
    Posted in: PC Servers
  • 0

    posted a message on [1.4.6] ʊHostile-PvPʊ ✔ FACTIONS ✔ RAIDING ✔ GRIEFING ✔ NO WHITELIST ✔
    Quote from jonah876

    smile17 is my friend, can i post his and you give him his?

    Promoted
    Quote from 8mileroad

    Take a guess

    Promoted
    Quote from koolboi22

    IGN: koolboi22

    Promoted
    Posted in: PC Servers
  • 0

    posted a message on Fixing Lag and Freezing when Joining a MP Server
    Been dying with this issue for months! This works!!!! Thanks. Trying to forward more people here.
    Posted in: Java Edition Support
  • To post a comment, please .