CmP
Contributor-
Posts
663 -
Joined
-
Last visited
-
Days Won
49
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by CmP
-
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.
-
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.
-
That's because you use "setValues" function. "addListItems" is the one you need to use to freeze a value.
-
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.
-
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.
-
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
-
This way the values won't be frozen. Need to call "addListItems" function after the loop that sets "freeze" field to "true".
-
"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.
-
-
-
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.
-
How to change the value of some searched values when in game without having to pause.
CmP replied to CoyFanatic's question in Help
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. -
How to change the value of some searched values when in game without having to pause.
CmP replied to CoyFanatic's question in Help
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. -
How to change the value of some searched values when in game without having to pause.
CmP replied to CoyFanatic's question in Help
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. -
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)
-
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.
-
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.
-
Yeah, absolutely, thanks for pointing that out.
-
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)
-
90.0: Added UI button for scripts - GameGuardian
CmP commented on Enyby's gallery image in Video Tutorials
-
90.0: Added UI button for scripts - GameGuardian
CmP commented on Enyby's gallery image in Video Tutorials
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. -
90.0: Added UI button for scripts - GameGuardian
CmP commented on Enyby's gallery image in Video Tutorials
-
@Puje you need to call "getValues" function to update the values. See this example: Examples of Lua scripts (#4rb1nadf)
-
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.