Jump to content
  • 0

Lua script


LowKee
 Share

Question

Hi all.

I'm trying to write a script to search for a group of numbers and edit them, I've spent most of the day looking at the commands and trying them out but I'm not having much luck.

	gg.setRanges(gg.REGION_ANONYMOUS)

gg.searchNumber('1053;45;897;702;1053', gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)

h = gg.getResultCount()

if gg.getResultCount()  then 
	gg.getResults(1) 
	gg.editAll('9999999', gg.TYPE_FLOAT)
	goto endall 
	else gg.toast(h) 
	gg.alert('Too many values found, go ingame and change the value, then tap on gameguardian icon again to continue')
	end 

I grabbed a few scripts from the site and have been changing them around to do what I need them to do. As I am working from someones elses script theres a few bits I'm not sure how to change, mainly the getResultCount. The orignal had ==1 which I beleive means, if theres 1 result then Getresults. As there was more than 1 result I took that part out but I'm not sure if thats stopped it from working.

Link to comment
Share on other sites

Recommended Posts

  • 0
-- Idle MoonBase 1.29c Hack Script by Backlift/Edited by LowKee

print('INFO: Idle MoonBase 1.29c Hack Script by Backlift/Edited by LowKee') 

if gg.VERSION_INT < 83000 then
	print('ERROR: You need a newer version of GameGuardian app to run this script. At least v8.30.0, Head to the website to update your app.') 
	goto endall
	end

gg.clearResults()

::restart::

if gg.isVisible(true) then
	gg.setVisible(false)
	end


gg.searchNumber('1053;45;897;702;1053', gg.TYPE_FLOAT)
gg.getResults(100) 
gg.editAll('9999999', gg.TYPE_FLOAT)
gg.clearResults()

gg.searchNumber('1141;45;764;780;1141', gg.TYPE_FLOAT)
gg.getResults(100) 
gg.editAll('9999999', gg.TYPE_FLOAT)
gg.clearResults()

gg.searchNumber('1075;58;803;780;1075', gg.TYPE_FLOAT)
gg.getResults(100) 
gg.editAll('9999999', gg.TYPE_FLOAT)
gg.clearResults()

gg.searchNumber('1019;76;874;749;1019', gg.TYPE_FLOAT)
gg.getResults(100) 
gg.editAll('9999999', gg.TYPE_FLOAT)
gg.clearResults()

gg.searchNumber('1128;58;798;766;1128', gg.TYPE_FLOAT)
gg.getResults(100) 
gg.editAll('9999999', gg.TYPE_FLOAT)
gg.clearResults()



::loop:: 

if not gg.isVisible() then 
	goto loop 
	else goto restart
	end

print('INFO: Thanks Backlift & Enyby')

::endall::

This does exactly what I want.

Once it's run and edited the stats it seems stuck, if I go to the game then press the GG icon it just starts the searching again. Is there anything I should change?

Thanks again.

Link to comment
Share on other sites

  • 0

@LowKee that script is for a particular game, some of the parts are not suited for your code.

 

You should:

1_remove line 5 (::restart::) as it's not needed for your code

2_remove this part

::loop:: 

if not gg.isVisible() then 
	goto loop 
	else goto restart
	end

As it's not needed for you code.

 

A tip from me: don't just edit scripts, learn from them and write new ones.

 

Link to comment
Share on other sites

  • 0

Thanks.

It's been pretty fun trying to figure it all out, unfortunately I turned on speedhack by mistake and just got myself banned, so I'll have to rewrite it as I don't have any of those characters now.

Although it does give me an idea for a bit in the script that takes the stats from elsewhere in the game and adds them for you, or gives you the option to manually enter them.

Link to comment
Share on other sites

  • 0
15 minutes ago, LowKee said:

Thanks.

Your welcome. ?

Quote

Although it does give me an idea for a bit in the script that takes the stats from elsewhere in the game and adds them for you, or gives you the option to manually enter them.

This code gives the user, option to enter a value manually:

 v = gg.prompt({i='Enter Value'}, {i='0'}) 

Then you can search for that using:

 gg.searchNumber(v['i'], gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) 

Take a look at This script. It does teaches you many things.

Link to comment
Share on other sites

  • 0
Just now, Backlift said:

 


 v = gg.prompt({i='Enter Value'}, {i='0'}) 

 

Then you can search for that using:


 gg.searchNumber(v['i'], gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) 

 

I saw that initally and was going to use it but as it uses 5 stats to search for I thought it easier to put the stats into the script.

Can you put multiple numbers into the prompt?

Link to comment
Share on other sites

  • 0
::Hax::

v = gg.prompt({i='Enter MaxHP;Max Rush;Atk;Def;CurrentHP'}, {i='0'})

if v == nil then 
	print('Hacked') 
	goto endall 
	end 
	
gg.searchNumber(v['i'], gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(10)
gg.editAll('9999', gg.TYPE_FLOAT)
gg.clearResults()
goto Hax

::endall::

Tried to make a loop so that you input first characters stats, then if you want you put the next ones stats, when you're finished you just hit enter on the 0 in the prompt to exit, but when pressing enter on 0 it still searches?

Link to comment
Share on other sites

  • 0

Hello sir

Is there a function to detect gold from game.

Example i have gold in a game 1000G

Search 1000

And then I bought an item 200G

Remaining 800G

Then refine code 800 then edit all to 999999

How i code in lua script? Refine code with remaining gold. Because every gold in the player is different 

 

 

Edited by shinobi97
Link to comment
Share on other sites

  • 0

Morning all.

It turns out I wasn't banned from TWD, using speed hacks throws it into a reset loop for some reason. Anyway its solved itself now so I'm able to carry on with the original script.

I've stumbled onto a slight problem. If your enemy has any of the characters you have on their team, the script edits their characters too. I know editall will change every result it collected, can you change what edits?

Link to comment
Share on other sites

  • 0

First:

gg.searchNumber('1000', gg.TYPE_DWORD)

(Can it give time before search to second code?)

Second:

gg.searchNumber('800', gg.TYPE_DWORD) gg.getResults(100) gg.editAll('9999999', gg.TYPE_DWORD)

Link to comment
Share on other sites

  • 0
26 minutes ago, shinobi97 said:

First:

gg.searchNumber('1000', gg.TYPE_DWORD)

(Can it give time before search to second code?)

Second:

gg.searchNumber('800', gg.TYPE_DWORD) gg.getResults(100) gg.editAll('9999999', gg.TYPE_DWORD)

You are going to hack gold in game, it's not necessarily 1000 for every person,

So you should add something more specific.

Go "lua scripts" section and view my simple script and one more script to understand how they work.

Look at idle TD script for example.

Link to comment
Share on other sites

  • 0
40 minutes ago, Backlift said:

You are going to hack gold in game, it's not necessarily 1000 for every person,

So you should add something more specific.

Go "lua scripts" section and view my simple script and one more script to understand how they work.

Look at idle TD script for example.

Yes i've read simple lua script by you. But still do not understand how. Refine code if gold each player is different

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

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