Jump to content

CmP

Ascended
  • Content Count

    308
  • Donations

    $0.00 
  • Joined

  • Last visited

  • Days Won

    17

CmP last won the day on February 18

CmP had the most liked content!

Community Reputation

331 Boss

About CmP

  • Rank
    Experienced Member

Additional Information

  • Android
    7.x (Nougat)
  • Device
    Xiaomi Redmi Note 4X

Recent Profile Visitors

7,118 profile views
  1. CmP

    how to track value change

    Identically to the code for one value, just different actions in "if" blocks. For example: local v = gg.getResults(2) gg.setVisible(false) while not gg.isVisible() do local old1 = v[1].value local old2 = v[2].value v = gg.getValues(v) if old1 ~= v[1].value then gg.setSpeed(1.0) gg.toast('First value has changed: ' .. old1 .. ' -> ' .. v[1].value) end if old2 ~= v[2].value then gg.setSpeed(90.0) gg.toast('Second value has changed: ' .. old2 .. ' -> ' .. v[2].value) end gg.sleep(100) end
  2. CmP

    how to track value change

    The idea is same for tracking changes of multiple values. Just few things need to be changed in the code: 1. Build/get a table with all required values, not just one. Example: local t = gg.getResults(2) -- Using first two results t[#t + 1] = {address = 0x11223344, flags = gg.TYPE_DWORD} -- And a value at custom address 2. Save old values of table elements before entering loop. Custom field can be used for that. Example: t = gg.getValues(t) for i, v in ipairs(t) do v.old_value = v.value end 3. Process all elements of the table in loop. Example: while not gg.isVisible() do t = gg.getValues(t) for i, v in ipairs(t) do if v.value ~= v.old_value then -- do something v.old_value = v.value end end gg.sleep(100) end
  3. The following code may have identical effect to the code you have logged: gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber('256;100F;30F::65', gg.TYPE_DWORD) gg.refineNumber('256', gg.TYPE_DWORD) local results = gg.getResults(1) results[1].value = 1 results[1].freeze = true results[2] = {address = results[1].address + 12, flags = gg.TYPE_DWORD, value = 0, freeze = true} gg.addListItems(results)
  4. 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.
  5. 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.
  6. Yeah, absolutely, thanks for pointing that out.
  7. 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)
  8. The answer is present in the description of returned value of prompt function from the documentation. In your case the call to the function (if dialog was not cancelled) returns a table with one element that has the key 1. Here is an example of how such table may look like: t = {[1] = 'Value from the field'} To access value that is associated with key, you need to index the table with that key. For the example above it would be: t[1] So in your code, you need to change usages of returned value by "prompt" function to access value of table element, not the table itself. For example: gg.searchNumber(prompt[1], gg.TYPE_DOUBLE)
  9. Such statements require proofs. You can say anything, but without proofs your words won't have any value. Being able to steal data does not mean that application does it. If it was so, one could say that all applications with root access are viruses and steal data. Obviously, it doesn't work like this and if you think it does, just don't use such applications. Moreover, don't use any applications with internet access, they can also steal your data.
  10. Noted, thanks for the advice. That's great.
  11. Well, maybe not by many, but at least by some for sure. In this topic I mentioned "some trigger of action when GG interface is active" and that it may be useful for helper scripts (the ones that help user in process of using GG). Yes, I have not offered any solution for such trigger, but you have found one and implemented it in the last update. I think that this new feature will be useful at least for some script developers (including me), so I wrote previous message to thank you for coming up with your solution for trigger of action for scripts.
  12. Long-awaited feature by many script developers, thank you!
  13. CmP

    LUA scripting

    @Puje you need to call "getValues" function to update the values. See this example: Examples of Lua scripts (#4rb1nadf)
  14. @ohright, this seems to be the chunk with the actual script. You can try to decompile it using any methods that you are aware of. load_0002005.lua
  15. This approach is correct, but there is one detail that is not considered: string that represents a number and an actual number is not the same key in a table. For example, r[1] and r['1'] refer to two different values in the table. So if you have string that represents a number, just convert it to an actual number using "tonumber" function (or any other way), then use that number to index the table with values for group search (table "p" in your case). Something like this: gg.searchNumber(r[1]..';100;'..p[tonumber(r[1])]..';1000:', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1) And that's it, you don't need bad list anymore. Also don't forget that "prompt" function can return nil and this case should be handled in order to avoid errors.
×
×
  • Create New...