Jump to content

CmP

Ascended
  • Content Count

    308
  • Donations

    $0.00 
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by CmP

  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.
  16. You can, but this would be redundant, if you already have a table with information about desired memory items (essentially, addresses and types). For your case it is enough to perform first step from my previous post once (per script run), then perform second step whenever it is needed. Therefore, you don't need to use "loadResults" at all.
  17. Basically, you can achieve that in 2 steps: Save information about desired memory items in a table. The table can be obtained using any of the following ways (or their combinations): - returned by "getResults" function; - returned by "getValues" function; - created or modified manually. Basic example: gg.searchNumber('123', gg.TYPE_DWORD) local results = gg.getResults(10) Use saved table to modify the values of desired memory items. The changes can be applied by calling "setValues" function with modified table as argument.. Basic example: -- Using the table from previous example for i, v in ipairs(results) do v.value = '456' end gg.setValues(results)
  18. This is because your usage of "getListItems" function is wrong. You pass an argument to it and don't store returned value, when in the documentation it is written that the function does not have parameters and returns a table of the saved list items (https://gameguardian.net/help/classgg.html#a4fd09c150fe2527816abb729dfea2801). Another moment is that when working with saved list items, you need a way to identify desired items. For example, it can be special names of those items. Also, I think that using saved list for your case is completely optional, because you can store tables with needed values in variables and use them whenever you need to modify those values.
  19. Because it's the .lasm file (disassembly). You get the .lua file when executing it. I have explained it in this post: Why Script Ended:Script Error ? (#cor0fe4l) From what I see on the video, official version of the launcher that you downloaded from BadCase's site finishes with an error right after you execute it. That's simply because it's not compatible with newest version of GG. Second script that you use is probably from this post. Both official version and this version contain the error of using "W" as second argument to "io.open" function, that is fixed in the file from this post. It should work properly, unless there are some other errors of which I am not aware. One thing you should understand that the launcher and a script for a particular game are two different scripts. The launcher downloads a script for some game and executes it, everything else is done by the downloaded script. If there is an error in the downloaded script, it has to be fixed and updated version has to be uploaded to the server before you can use it with the launcher. So just wait until the author of the script for your game will fix it and upload to the server. This video and screenshots clearly show that modified version of the launcher works fine for you, while the error occurs in the script for the game.
  20. @AliceAlmony this issue is not connected with the launcher being incompatible with the latest version of GG, so I can't help you with it. You will probably need to wait for BadCase to update the script for your game (as he has written above). You can use 87.3, because fixed version of the launcher is compatible with it. Not to mention that GG is continuously improving and each new version is better than previous one.
  21. The solution was "surprisingly" to replace that "W" with "w". I have already done it and posted the file in my previous post. Try it.
  22. It worked for me on the video, because not latest version of GG was used. Here is fixed version of the .lasm file to work on the currently latest version of GG (87.3): BadCaseScriptLauncher_fixed.lasm UPD: Did the same actions as in my video above, but with the file from this post and GG 87.3, script worked properly.
  23. @AliceAlmony I could not reproduce the error you are having: Make sure that you download and execute the file from my post.
  24. @AliceAlmony little confusion happened, because the file I have uploaded in the previous post is edited .lasm file (the one GG produces when "Disassemble" feature is used). When such file is executed, GG produces .lua file that corresponds to it and places it in the same folder. That's what happened when you executed it and received this output: Likely, you did it 2 times and that's why you have 2 of same .lua files produced by GG here: The files are equal, so you can leave only one of them and name it how you like. Then, when you execute the script produced by GG from .lasm file, GG asks the following: because the script needs Internet access to work. Obviously, if you don't allow the access, the script won't work, but if you will, the script will work fine. The decision of whether to allow the access depends on presence or absence of your trust to the script author and the file in particular. Since the version above is slightly different from original version of the script, you can compare their disassembly (.lasm files) produced by GG to make the decision.
×
×
  • Create New...