Jump to content

LUA scripting


Enyby
 Share

Recommended Posts

@Enyby the situation is like this:

There is a game with more than 1 parameter that are Hackable, for example this game:

A game that has, gems,mana,gold and silver (like Cower Defense or WRB) 

but this game saves values each in a different region than other, they are different type.

User MAY want to hack only one value , for this instance of the game.

I could do it by using this trick:

(It's part of my next script, 50% finished)

(on phone, no code button to submit it as a code, so it may be a bit messy)

>>>

x = gg.prompt({z='Wich value you want to be hacked? (1=mana,2=gold,3=gems,4=silver)'}, {z='0'})

if x == 1 then

goto mana

end

if x == 2 then

goto gold

end

if x == 3 then

goto gems

end

if x == 4 then

goto silver

end

<<<

 

Making a button that user choose what he/she wants is more convenient.

 

 

Link to comment
Share on other sites

36 minutes ago, Backlift said:

@Enyby the situation is like this:

There is a game with more than 1 parameter that are Hackable, for example this game:

A game that has, gems,mana,gold and silver (like Cower Defense or WRB) 

but this game saves values each in a different region than other, they are different type.

User MAY want to hack only one value , for this instance of the game.

I could do it by using this trick:

(It's part of my next script, 50% finished)

(on phone, no code button to submit it as a code, so it may be a bit messy)

>>>

x = gg.prompt({z='Wich value you want to be hacked? (1=mana,2=gold,3=gems,4=silver)'}, {z='0'})

if x == 1 then

goto mana

end

if x == 2 then

goto gold

end

if x == 3 then

goto gems

end

if x == 4 then

goto silver

end

<<<

 

Making a button that user choose what he/she wants is more convenient.

 

 

x = gg.prompt({z='Which value you want to be hack? (1=mana,2=gold,3=gems,4=silver)'}, {z='0'})
gg.toast('Lua Scipt By Ankit007')
if x == 1 then
	gg.prompt({[1]='Enter Value of Mana',}, {[1]='123')
	gg.searchNumber(x[1], gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)
    gg.prompt({[2]='Enter Amount of Mana you Want',}, {[2]='123')
	gg.editAll(x[2], gg.TYPE_FLOAT)
end
if x == 2 then
	gg.prompt({[1]='Enter the Value of Gold'}, {[1]='456.39')
	gg.searchNumber(x[1], gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
	gg.editAll(x[2], gg.TYPE_DWORD)
    gg.prompt({[2]='Enter the Amount of Gold you want'}, {[2]='456.39')
end
if x == 3 then
	gg.prompt({[1]='Enter the Value of gems'}, {[1]='3658'})
	gg.searchNumber(x[1], gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
    gg.editAll(x[2], gg.TYPE_DWORD)
    gg.prompt({[2]='Enter the Amount of gems you want'}, {[2]='456')
end
if x == 4 then
gg.prompt({[1]='Enter the Value of silver'}, {[1]='3658'})
gg.searchNumber(x[1], gg.TYPE_DOUBLE, false, gg.SIGN_EQUAL, 0, -1)
gg.editAll(x[2], gg.TYPE_DOUBLE)
gg.prompt({[2]='Enter the amount of silver you want'}, {[2]='3658'})
end
if x~=1 and z~=2 and x~= x~= 4 then
            gg.toast('Not seleced following option please select one option')
end

As gg does not allow the buttons so i think you should try this 

and above code is not tested but i think its the think you are searching for

you can correct some and use it

Edited by ankit007
Link to comment
Share on other sites

33 minutes ago, ankit007 said:

x = gg.prompt({z='Which value you want to be hack? (1=mana,2=gold,3=gems,4=silver)'}, {z='0'})
gg.toast('Lua Scipt By Ankit007')
if x == 1 then
	gg.prompt({[1]='Enter Value of Mana',}, {[1]='123')
	gg.searchNumber(x[1], gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)
    gg.prompt({[2]='Enter Amount of Mana you Want',}, {[2]='123')
	gg.editAll(x[2], gg.TYPE_FLOAT)
end
if x == 2 then
	gg.prompt({[1]='Enter the Value of Gold'}, {[1]='456.39')
	gg.searchNumber(x[1], gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
	gg.editAll(x[2], gg.TYPE_DWORD)
    gg.prompt({[2]='Enter the Amount of Gold you want'}, {[2]='456.39')
end
if x == 3 then
	gg.prompt({[1]='Enter the Value of gems'}, {[1]='3658'})
	gg.searchNumber(x[1], gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
    gg.editAll(x[2], gg.TYPE_DWORD)
    gg.prompt({[2]='Enter the Amount of gems you want'}, {[2]='456')
end
if x == 4 then
gg.prompt({[1]='Enter the Value of silver'}, {[1]='3658'})
gg.searchNumber(x[1], gg.TYPE_DOUBLE, false, gg.SIGN_EQUAL, 0, -1)
gg.editAll(x[2], gg.TYPE_DOUBLE)
gg.prompt({[2]='Enter the amount of silver you want'}, {[2]='3658'})
end
if x~=1 and z~=2 and x~= x~= 4 then
            gg.toast('Not seleced following option please select one option')
end

As gg does not allow the buttons so i think you should try this 

and above code is not tested but i think its the think you are searching for

you can correct some and use it

I am using that code already.

Having buttons will ease the situation a bit more, and I have some other nice things to do with buttons.

Link to comment
Share on other sites

  • Administrators
3 hours ago, Backlift said:

on phone, no code button to submit it as a code, so it may be a bit messy

Write code in square brackets before and /code in square brackets after. Like that:

[code]some text

[/code]

You get:

some text

_______________________________________________
added 4 minutes later
4 hours ago, Backlift said:

User MAY want to hack only one value , for this instance of the game.

Use gg.alert with params for buttons. You can set up to 3 buttons and check return value. 

Link to comment
Share on other sites

  • Administrators
On 17.07.2017 at 5:08 AM, Enyby said:

t] = function: alert /* gg.alert(string text[, string positive[, string negative[, string neutral]]]) -> int: 0 = cancel, 1 = positive, 2 = negative, 3 = neutral */

local answer = gg.alert('Select letter:', 'A', 'B', 'C')
print(answer)

scr_1500657319.jpgscr_1500657324.jpg

Link to comment
Share on other sites

@Enyby im trying to group search with:

x = (100 - v['i']) + 684, 100 - v['i']

so if v = 53 i must have results of 47 and 731

 

but i have 2 situations:

1_when its:

x = (100 - v['i']) + 684, 100 - v['i']

i get only 731

 

2_when its:

x = 100 - v['i'], (100 - v['i']) + 684

i get inly 43

 

how to group search?

how to set range?

i actually want to run this parameter:

684+value;value::9

 

Link to comment
Share on other sites

  • Administrators
1 minute ago, Backlift said:

684+value;value::9

local s = (684 + value) .. ';' .. value .. '::9'
gg.searchNumber (s, gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

 

Link to comment
Share on other sites

 

@Enyby we are using a method to not get crash by user not entering a value, however this seems a crash to user:

Screenshot_20170721-230103.thumb.png.291d20fae8171b22334dd41aba2e365e.png

how to make script end without log?

 if v == nil then 
	os.exit
	end 
Edited by Backlift
Link to comment
Share on other sites

  • Administrators

No option. User must know about script execution end.

Any end script show log with execution.

You can alert user about that. Or use go to end script.

Or write here something "all ok".

Link to comment
Share on other sites

2 minutes ago, Enyby said:

No option. User must know about script execution end.

Any end script show log with execution.

You can alert user about that. Or use go to end script.

Or write here something "all ok".

it does have an alert before it that says:

hacking done.

 

i will use goto end then.

Link to comment
Share on other sites

  • Administrators

Of course I mean go to label placed at the end of the script. It must have some name.

_______________________________________________
added 2 minutes later

Also you can use function and return.

function main()
	-- do something
	
	if need_exit == 1 then
		return
	end

	-- do something
end

main()

 

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.