Search the Community
Showing results for tags 'Nil'.
-
Having some issue. I have a gg.prompt menu. function mappedMemoryRangesJump(scatteredExecutable, compactExecutable) if #memoryMap == 3 then mainAddressPoint = {address = memoryMap[1]["start"] + startPointer[1]["value"] + compactExecutable} elseif #memoryMap >= 4 then mainAddressPoint = {address = memoryMap[1]["start"] + startPointer[1]["value"] + scatteredExecutable} end end function nonFoundValues() gg.toast("the values are not found yet, trying again in 10 sec") gg.sleep(1000) end function filterSettings(set, offset_0, offset_1, offset_2, dataTye_0, dataType_1, dataType_2) local resultTable = gg.getResults(gg.getResultsCount()) filterTable = {} for i, v in ipairs(resultTable) do local filter = {{address = resultTable[i]["address"] + offset_0, flags = dataTye_0}} local filter_1 = {{address = resultTable[i]["address"] + offset_1, flags = dataType_1}} filter = gg.getValues(filter) filter_1 = gg.getValues(filter_1) if set == 2 then if filter[1]["value"] == "2" and filter_1[1]["value"] ~= "0" then filterTable[#filterTable + 1] = {address = resultTable[i]["address"] + offset_2, flags = dataType_2} end end if set == 3 then if filter[1]["value"] == "2" then filterTable[#filterTable + 1] = {address = resultTable[i]["address"] + offset_2, flags = dataType_2} end end if set == 4 then if filter[1]["value"] == "1031127695" and filter_1[1]["value"] ~= "0" then filterTable[#filterTable + 1] = {address = resultTable[i]["address"] + offset_2, flags = dataType_2} end end end end local old = gg.getRanges() function jumpCounter() --features mappedMemoryRangesJump(0x269F60, 0x26A0D8) gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber(mainAddressPoint["address"], gg.TYPE_QWORD) jumpPointerCheck = mainAddressPoint["address"] local startPointerJump = gg.getResults(20) jumpCount = {} jumpPointer = {} gg.clearResults() for i, v in ipairs(startPointerJump) do local filter = {{address = startPointerJump[i]["address"] + 0x8, flags = gg.TYPE_DWORD}} filter = gg.getValues(filter) if filter[1]["value"] == "8" then jumpCount[#jumpCount + 1] = {address = startPointerJump[i]["address"] + 0x358, flags = gg.TYPE_DWORD} jumpPointer[#jumpPointer + 1] = {address = startPointerJump[i]["address"], flags = gg.TYPE_QWORD} end end jumpCount = gg.getValues(jumpCount) jumpPointer = gg.getValues(jumpPointer) if #jumpCount == 0 then nonFoundValues() jumpCounter() end gg.addListItems(jumpCount) end jumpCounter() function characterAnim() --features mappedMemoryRangesJump(0xCC64D8 ,0xCC6010) gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber(mainAddressPoint["address"], gg.TYPE_QWORD) filterSettings(2, 0x74, 0xB0, 0x8E0, gg.TYPE_DWORD, gg.TYPE_DWORD, gg.TYPE_FLOAT) gg.clearResults() characterAnimation = gg.getValues(filterTable) if #characterAnimation == 0 then nonFoundValues() characterAnim() end gg.addListItems(characterAnimation) end characterAnim() function fullGameSpeed() --features mappedMemoryRangesJump(0x27B548, 0x27B660) gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber(mainAddressPoint["address"], gg.TYPE_QWORD) filterSettings(3, 0x33, 0x0, 0x300, gg.TYPE_BYTE, gg.TYPE_BYTE, gg.TYPE_FLOAT) gg.clearResults() gameSpeedFull = gg.getValues(filterTable) if #gameSpeedFull == 0 then nonFoundValues() fullGameSpeed() end gg.addListItems(gameSpeedFull) end fullGameSpeed() function charsObjectSpeed() --features mappedMemoryRangesJump(0xC82268, 0xC81DA0) gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber(mainAddressPoint["address"], gg.TYPE_QWORD) filterSettings(4, 0x40, 0x58, 0x1640, gg.TYPE_DWORD, gg.TYPE_QWORD, gg.TYPE_FLOAT) gg.clearResults() characterObjectSpeed = gg.getValues(filterTable) if #characterObjectSpeed == 0 then nonFoundValues() charsObjectSpeed() end gg.addListItems(characterObjectSpeed) end charsObjectSpeed() function valueCheck() --features if jumpPointer[1]["value"] ~= jumpPointerCheck then -- all values have changed address gg.toast("Values have changed address, Script will auto search values again in 10 sec.") gg.sleep(10000) jumpCount[1]["freeze"] = false -- unfreeze to prevent crash gg.addListItems(jumpCount) jumpCounter() characterAnim() fullGameSpeed() charsObjectSpeed() gg.toast("Script ready") end end function START() --menu speed = gg.prompt ( {'Animation Speed | default value = 1 | [0.1; 10.0]', 'Game Speed | default value = 1 [0.1; 10.0]', 'Playerobject Speed | default value = 1 [0.1; 10.0]', 'Jump hack'}, {[1]='1', [2]='1', [3]='1'}, {'number', 'number', 'number', 'checkbox'} ) if speed == nil then noselect() else if speed[1] then for i = 1, #characterAnimation do characterAnimation[i]["value"] = speed[1] end gg.setValues(characterAnimation) end if speed[2] then for i = 1, #gameSpeedFull do gameSpeedFull[i]["value"] = speed[2] end gg.setValues(gameSpeedFull) end if speed[3] then for i = 1, #characterObjectSpeed do characterObjectSpeed[i]["value"] = speed[3] end gg.setValues(characterObjectSpeed) end if speed[4] then for i = 1, #jumpCount do jumpCount[i]["value"] = "0" jumpCount[i]["freeze"] = true gg.addListItems(jumpCount) end end end end function noselect() gg.toast('You not select anything') end START() while (true) do if gg.isVisible() then gg.setVisible(false) START() else --should only execute when user used a feature for first time. jumpPointer = gg.getValues(jumpPointer) valueCheck() end gg.sleep(200) end Currently the script executes the features first before it uses gg.prompt. i want the gg.prompt to run first and then make the features only run once, and then let the while loop take care of it. However the while loop as has issues. If the gg.prompt menu equals nil for the first time of opening it then it should not execute this else part in the while loop Untill the user has pressed his first feature in the menu, pressing "Ok" is also a feature. When user pressed a feature it won't matter anymore if menu was nil or not and the code after the else statement is then allowed to be executed: START() while (true) do if gg.isVisible() then gg.setVisible(false) START() else -- action after else should not be executed aslong user has used its first feature jumpPointer = gg.getValues(jumpPointer) valueCheck() end gg.sleep(200) end How to proceed?