Jump to content

Question

Posted

I have game with 3 version , i want to make an automatic go to function by detected the game version

v=gg.getTargetInfo() -- get the target
VN1="1.14.3.5.419705" -- game version 1
VN2="1.14.3.7.436693" -- game version 2
VN3="1.14.3.9.439281" -- game version 3

if v.processName~=VN1 then
   HOME1() -- goto function game version 1
   then else -- idk exactly the next command
if v.processName~=VN2 then
   HOME2() -- goto function game version 2
   then else -- idk exactly the next command
if v.processName~=VN3 then
   HOME3() -- goto function game version 3
   then else -- idk exactly the next command
os.exit() -- if all wrong os exit
end end
  
function HOME1() -- v1.14.3.5.419705
function HOME2() -- v1.14.3.7.436693
function HOME3() -- v1.14.3.9.439281

 

15 answers to this question

Recommended Posts

  • 2
Posted

I guess you should use "versionName" field for that: 

-- ...

if v.versionName == VN1 then
  HOME1() -- Functions HOME1, HOME2, HOME3 need to be defined before they are used
elseif v.versionName == VN2 then
  HOME2()
elseif v.versionName == VN3 then
  HOME3()
else
  os.exit()
end
  • 0
Posted (edited)
13 hours ago, CmP said:

I guess you should use "versionName" field for that: 

-- ...

if v.versionName == VN1 then
  HOME1() -- Functions HOME1, HOME2, HOME3 need to be defined before they are used
elseif v.versionName == VN2 then
  HOME2()
elseif v.versionName == VN3 then
  HOME3()
else
  os.exit()
end

Ah sorry, i did "versionName", in this post i just forget, my bad

Tanks btw

Edited by SamePerson
  • 0
Posted
On 6/28/2023 at 11:01 PM, CmP said:

I guess you should use "versionName" field for that: 

-- ...

if v.versionName == VN1 then
  HOME1() -- Functions HOME1, HOME2, HOME3 need to be defined before they are used
elseif v.versionName == VN2 then
  HOME2()
elseif v.versionName == VN3 then
  HOME3()
else
  os.exit()
end

I got an error at line 9220230630_170006.thumb.jpg.168d2a7966b55c02fb1c13db82aa2ae8.jpg

  • 0
Posted
4 hours ago, SamePerson said:

I got an error at line 9220230630_170006.thumb.jpg.168d2a7966b55c02fb1c13db82aa2ae8.jpg

what's the error said ? can u ss it ?

  • 0
Posted
6 hours ago, SamePerson said:

I got an error at line 92

Because you need to define the functions before calling them as has been mentioned in the comment in the code above. For example: 

function HOME1()
  -- ...
end

HOME1()

And not: 

HOME1()

function HOME1()
  -- ...
end
  • 0
Posted
3 hours ago, CmP said:

Because you need to define the functions before calling them as has been mentioned in the comment in the code above. For example: 

function HOME1()
  -- ...
end

HOME1()

And not: 

HOME1()

function HOME1()
  -- ...
end

I'm so confuse now 😞

20230701_035029.jpg

20230701_035105.jpg

  • 0
Posted

Again, the same reason, function "BP1" needs to be defined before it is called. If you don't want to reorder all of the functions, then moving block of code from lines 135-143 to the end of the file may work.

  • 0
Posted (edited)

these functions aren't declaired or a typo error when calling a function in lua it's case sensitive
also you need to declaire a function then you call it , not calling a function then declairing it 

image.thumb.png.f8e26ffd34d245fdc8e3d20cd83aaf04.png this is wrong 


 

Edited by XEKEX
  • 0
Posted (edited)

[ @SamePerson ]
---
Most language are ordered from up to down and left to right. This is common concept that you should declare something before it's called. It includes function and variable. Consider moving all the function block to upper script (including global variable). Perhaps you should attach your script here so others can fix the problem.
---
If your script is for personal use only, you can send the script through Direct Message. We can't fix all the errors from your script only based a few screenshots.

Edited by Xaviesz
  • 0
Posted
16 hours ago, CmP said:

Again, the same reason, function "BP1" needs to be defined before it is called. If you don't want to reorder all of the functions, then moving block of code from lines 135-143 to the end of the file may work.

Ahh i see, thanks to all for your help. I appreciate that

  • 0
Posted

I have no idea with this

function HOME1()
---
HMM=-1 -- ???
end

function HOME2()
---
HMM=-1 -- ???
end

function HOME3()
---
HMM=-1 -- ???
end

-- not following v.versionName
while true do
if gg.isVisible(true) then
HMM = 1 -- ???
gg.setVisible(false)
end
if FL84 == 1 then
HOME1() -- ???
end
end

 

  • 0
Posted (edited)

[ @SamePerson ]
---

if gg.isVisible(true) then
HMM = 1 --Also change "HMM" variable to 1
gg.setVisible(false) --Hide Game Guardian UI
end

The script will try to Hide Game Guardian UI if it's being showed on the screen. It is also changing variable "HMM" to 1 if the UI is being showed. I'm not sure what's variable "HMM" being used for as you don't show us the full script. Perhaps you need to find something like:

if HMM ==

or any reference to variable "HMM" to really see what's going on.
---
I suggest you to send the script to my Private Message. I'm more than happy to help. Here's some reference:

Edited by Xaviesz
reference
  • 0
Posted
14 hours ago, Xaviesz said:

[ @SamePerson ]
---

if gg.isVisible(true) then
HMM = 1 --Also change "HMM" variable to 1
gg.setVisible(false) --Hide Game Guardian UI
end

The script will try to Hide Game Guardian UI if it's being showed on the screen. It is also changing variable "HMM" to 1 if the UI is being showed. I'm not sure what's variable "HMM" being used for as you don't show us the full script. Perhaps you need to find something like:

if HMM ==

or any reference to variable "HMM" to really see what's going on.
---
I suggest you to send the script to my Private Message. I'm more than happy to help. Here's some reference:

Here's the script

Test.lua

  • 0
Posted
1 hour ago, MonkeySAN said:

sorry to interfere.

does this really important/necessity or we can get rid it all together.

Screenshot_2023-07-02-14-40-52-208_com.rhmsoft.edit-edit.thumb.jpg.71a61a605b5d7814c6f408692e9692a6.jpg

doesnt below alone will work just enough.

Screenshot_2023-07-02-14-41-19-459_com.rhmsoft.edit-edit.thumb.jpg.35fc185b1c54f50bcae77621f22cb599.jpg

im just curious.

Already fixed thanks

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