Jump to content
  • 1

Global varibiable confusion


Aanon007

Question

So,I'm kind of a noob and i need your help as you can see from the lua script below...i want to make the "hold" a global varibiable so i can use it to change the speed() without scanning the hold again and doing it with a method of changing the value of speed wich is present with hold in goto and by calculating offset getting the address of speed(can't do it directly with address because not static address)

 

function Hold()
gg.clearResults()
gg.searchNumber("1100;12;13;16::13", gg.TYPE_DWORD)
gg.refineNumber("1100", gg.TYPE_DWORD)
hold = gg.getResults(1)
hold = 12
local hld = {}
hld[1] = hold[1]
hld[1].flags = gg.TYPE_DWORD
hld[1].value = 999999999
hld[1].freeze = true
gg.addListItems(hold)
gg.clearResults()
end

function speed()
gg.clearResults()
local spd = {}
spd[1] = {}
spd[1].address = hold[12].address + 0x4
spd[1].flags = gg.TYPE_DWORD
spd[1].value = 99
spd[1].freeze = true
gg.addListItems(hold)
gg.clearResults()
end

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

 

On 10/3/2022 at 5:14 PM, Collen said:
function hold()
	gg.searchNumber("1100;12;13;16::13", gg.TYPE_DWORD)
	gg.refineNumber("1100", gg.TYPE_DWORD)
	list_hold = gg.getResults(500, nil, nil, nil, nil, nil, nil, nil, nil)
	gg.addListItems(list_hold)
	gg.clearResults()
end
--
function speed()
	o = {}
	for i=1, #list_hold do
		o[i] = {}
		o[i].address = list_hold[i].address + 0x4
		o[i].flags = gg.TYPE_DWORD
		o[i].value = 99
	end
	gg.setValues(o)
	gg.toast ("SPEED HACK - ON!")
end

Like this?

Thanks, after a lot of trial, errors and corrections i somehow made the script work ☺️ . Just in case ur curious ↓ i attached the file

 

com.herocraft.game.tempest.lite.lua

Link to comment
Share on other sites

  • Moderators
1 hour ago, Aanon007 said:

So,I'm kind of a noob and i need your help as you can see from the lua script below...i want to make the "hold" a global varibiable so i can use it to change the speed() without scanning the hold again and doing it with a method of changing the value of speed wich is present with hold in goto and by calculating offset getting the address of speed(can't do it directly with address because not static address)

 

function Hold()
gg.clearResults()
gg.searchNumber("1100;12;13;16::13", gg.TYPE_DWORD)
gg.refineNumber("1100", gg.TYPE_DWORD)
hold = gg.getResults(1)
hold = 12
local hld = {}
hld[1] = hold[1]
hld[1].flags = gg.TYPE_DWORD
hld[1].value = 999999999
hld[1].freeze = true
gg.addListItems(hold)
gg.clearResults()
end

function speed()
gg.clearResults()
local spd = {}
spd[1] = {}
spd[1].address = hold[12].address + 0x4
spd[1].flags = gg.TYPE_DWORD
spd[1].value = 99
spd[1].freeze = true
gg.addListItems(hold)
gg.clearResults()
end

function hold()
	gg.searchNumber("1100;12;13;16::13", gg.TYPE_DWORD)
	gg.refineNumber("1100", gg.TYPE_DWORD)
	list_hold = gg.getResults(500, nil, nil, nil, nil, nil, nil, nil, nil)
	gg.addListItems(list_hold)
	gg.clearResults()
end
--
function speed()
	o = {}
	for i=1, #list_hold do
		o[i] = {}
		o[i].address = list_hold[i].address + 0x4
		o[i].flags = gg.TYPE_DWORD
		o[i].value = 99
	end
	gg.setValues(o)
	gg.toast ("SPEED HACK - ON!")
end

Like this?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.