Jump to content

LUA scripting


Enyby
 Share

Recommended Posts

Hello. In certain RPG game I know that after the MP value has the value of the special bar that always starts at 0 and can go up to 1600. I do the DWORD search and find these two values followed by another 5 which are always random and then two more values that are magic and spirit. How should I put in the escript to look for 2 known values followed by 5 unknown and 2 more known? example:

192 (current MP)

0 (special bar at the start of the fight)

1.722.5 (random value)

1.723.5 (random value)

1.724.5 (random value)

1.725.5 (random value)

15.674.8 (random value)

150 (magic)

104 (spirit)

What I want to do is a script that looks for those numbers I know (mp, special bar, Magic and spirit) and the random ones so I can change the value of the special bar. I am not aware of programming, but with the help of the posts I have already been able to do some scripts. thank you all.

 

Link to comment
Share on other sites

But i only know four numbers, exemple: 192;0;x;x;x;x;x;150;104:2 cause all the "x" are always random, how group search to display in sequence know and unknow numbers? Thank you!

Edited by willkof2
Wrong word
Link to comment
Share on other sites

On 17/07/2017 at 7:22 PM, Enyby said:

Not bad script from one chinese user:

299f7f3c972b82645d3a881b6117d978.jpg

Can be used as example for make automated group search with edit values.

Can you give an example of how to use this?

Link to comment
Share on other sites

Enby, thanks for the answer. I have wrote the script I wanted and it works just fine. But I have some complain. I want to dismiss a final window of script automatically if there was nothing printed (I use print to catch errors such as there was nothing found). I can hide GG window so there is no need to press "Back" button but I want to not waste my taps to dismiss empty window ;)

 

PS. Adding LUA is soooo awsome. There is so much ways to make things easier. Thank you for your work!

Edited by AntonioOne
Link to comment
Share on other sites

  • Administrators

For me worked:

local debug = 0
print('debug:', debug)
if debug == 0 then
	print('debug off')
else
	print('debug on')
end

local debug = 1
print('debug:', debug)
if debug == 0 then
	print('debug off')
else
	print('debug on')
end

 

scr_1504366525.jpg

_______________________________________________
added 1 minute later
1 hour ago, Aufar_R said:

when debug == 1

It is not set. Set directive include only one sign char. You write test for equals ("=="), not set ("=").

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.