Jump to content

CmP

Contributor
  • Posts

    640
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by CmP

  1. But there is no need to load saved values as search results in the first place. The same can be accomplished without such redundancy using "gg.setValues" function: local items = gg.getListItems() for i, v in ipairs(items) do if v.flags == gg.TYPE_FLOAT then v.value = "0.10000000149" end end gg.setValues(items)
  2. has which data type? If this is known of course. Can you get encrypted value (interpreted as dword) that corresponds to real value in game being 0?
  3. Even if encrypted value is interpreted as float by the game, one still needs to know exact values to be able to analyze how values in the pairs you provided are related. That's why you were asked to provide the values interpreted as dword.
  4. Alternatively to the solution above by ItsSC, the following function can be used to swap endianness of a string that represents 4-byte hex value: function swapEndianness(str) return (str:gsub('(..)(..)(..)(..)', '%4%3%2%1')) end
  5. Check if the following solution suffices for your case: How to goto a pointer in a script? (#7hphwlq4)
  6. In "offset" function: And right after the call to it: Instead of adding table of tables to "vPool" table, add just tables that contain info about a particular memory item. For example, in your code instead of addItem(vPool, r) do addItem(vPool, r[1])
  7. To fix what? You forgot to describe the problem. From the screenshot you attached it is in no way obvious what the problem is. If you wonder why second and third elements of "vPool" table are references to the same table, that's because your code calls "addItem" function with the same arguments twice.
  8. In case of modifying value by freezing it to a new value "addListItems" can be used, but in case of just changing value without freezing it "setValues" function is the one to use. Generally, you shouldn't use "addListItems" on values that you don't want to be added to saved list. Values that are needed to be frozen is exception, because in GG a value can't be frozen without it being added to saved list.
  9. That's because you use "setValues" function. "addListItems" is the one you need to use to freeze a value.
  10. You don't need a loop here. Extract the code from loop body and change all references to "v" to "vPool" and it might work as you expect.
  11. The answer above from @SAGEPAPI is exactly what you wanted to know. 5th and 6th parameters of "searchNumber" function are used to set lower and upper bound of range of addresses to perform search in. This is written in the documentation to the function which can be found here. Don't hesitate to check the documentation when you have GG API-related questions.
  12. CmP

    HELP ME PLEASE!!!

    Just check if table returned by "getListItems" function contains any elements. local t = gg.getListItems() if #t == 0 then print('Saved list is empty') else print('Saved list is not empty') end
  13. This way the values won't be frozen. Need to call "addListItems" function after the loop that sets "freeze" field to "true".
  14. "freezeType" parameter has default value of "gg.FREEZE_NORMAL", so it's not necessary to explicitly specify it. However, you are absolutely correct about missing call to "addListItems" function that is required to save values to saved list.
  15. CmP

    Cheat Engine server

    It is needed in all cases if you want to use Cheat Engine from PC as client to the server that is running on your android device. Here you can find the description of what the command does: https://developer.android.com/studio/command-line/adb#forwardports
  16. Then you should be grateful that someone who can see the comments pointed you to the answer to your question, shouldn't you? And the explanation may be still useful for someone else.
  17. This question is answered in the comment above yours, but it seems that you don't understand how nearby search works, so I will try to clarify. Nearby search works just like normal search, but it only searches for values at within certain distance before and/or after target value. For example, target value's address is 12345000 in hex. If you choose distance 1000 (also in hex) and select "Before" and "After", then the search will be performed only in the following range of addresses: [12345000 - 1000; 12345000 + 1000], i.e. from 12344000 to 12346000. You can achieve the same effect by inputting these numbers in "From" and "To" fields of the normal search dialog. At this point it should be obvious, how can you use this feature in script. If it's not, read the comment above yours, then try to find the answer in documentation for "searchNumber" function.
  18. I did not mean it and why do you think that he did it wrong? The only mistake in the code from the message you quoted was pointed out by Enyby several posts above. As per my suggestion, he did exactly what I described.
  19. You don't need to search for values each time, so move the code for searching values (and the call to "getResults" function) outside the function. It should be executed once before the first call to "doAction" function, so you can insert it, for example, right before the line with "while true do" code.
  20. There is an example of the code for performing an action by clicking on GG icon: Examples of Lua scripts (#d2j0lrom) It's not a complete solution for your task, but may be a good starting point.
  21. CmP

    LUA scripting

    You have quoted old message. "REGION_VIDEO" constant was not present in the API back then. As for you question. Of course there is a number associated with this constant. You can print it with the following code: print("gg.REGION_VIDEO:", gg.REGION_VIDEO)
  22. It's not the only way, but it is suitable for your case. The most efficient implementation of this way from the ones proposed in this topic can be found in this post: How to group values to edit in a search? (#2mhgpa6) It reuses the table returned by "getResults" function that leads to better performance of the code, but as it was mentioned above, it does not really matter when results count is relatively small.
  23. Oh, that's a good idea, haven't thought about it. Just like it was mentioned few posts above, another thing has been learned. It's amazing that new things can be learned even about the topics that looks easy.
  24. Yeah, absolutely, thanks for pointing that out.
  25. The group search is not ordered, so I would prefer second approach from those Enyby mentioned. For this case it would be something like the following: gg.setRanges(gg.REGION_ANONYMOUS) gg.clearResults() gg.searchNumber('1014350479;1012202996;1083179008;1050253722;1031127695;1065353216;1065353216;1067282596:61', gg.TYPE_DWORD) local results = gg.getResults(5000) local edited = {} for i, v in ipairs(results) do if v.value == 1014350479 then edited[#edited + 1] = {address = v.address, flags = v.flags, value = 1011011011} elseif v.value == 1050253722 or v.value == 1031127695 then edited[#edited + 1] = {address = v.address, flags = v.flags, value = 1} end end gg.setValues(edited)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.