Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Quern ~ "Hovering" the island - xyz coordinate man

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
paul44
Expert Cheater
Reputation: 2

Joined: 20 Jul 2017
Posts: 151

PostPosted: Thu Sep 07, 2017 12:32 pm    Post subject: Quern ~ "Hovering" the island - xyz coordinate man Reply with quote

I've used this game to get some hands-on regarding coordinate-manipulation. Long story short: got it working, but still some open issues...

info: [ imgur_com/a/pOpd1 ]
(table is/will be posted on fearlessrevolution ~ not sure if I can post link here?!)

Q:
1. Timer.interval: how does it influence user's action. I noticed that - upon increasing the interval - some keypresses seem to be skipped/missed?
Does it also have an impact on CPU cycle? If it does, in what way?
2. Show messages: I'd like to present 2 message boxes (eg using func 'showMessage()'); but somehow I'm not able to present this ONLY once (per CE session).
Upon enabling the "Gravity lock" script:
a. one message when getting the "if Z_Coord.Value == '??' then" test ~ coordinates must be filled !
(I've read some discussions to force a keypress (UP eg), but it seems not so obvious to pass this on to the game itself ~ one must move ingame to get the base struct address filled...)
I DO realise this is not "sound-proof", but at least I'm (user is) aware of the issue...
b. one message telling how to use the script: F2=up, F3=down, F4=end

I haven't posted this updated table to FearRev yet, as I would first like some feedback. If somebody do want the table now, let me know and I'll post it anyway...

PS: lua code primarily 'retrieved' from various discussions in this forum; so credit due to those contributors.
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Thu Sep 07, 2017 3:14 pm    Post subject: Reply with quote

1. You can think of a timer as something like this:
Code:
while self.valid
  sleep(self.interval)
  self:OnTimer()
end
so the longer the interval the longer the code sleeps before calling the function again. For hotkeys look into using the createHotkey function which takes a function and the VK code for the keys that activate it.

2. If you're referring to the if count == 0 check then make sure you're changing count so that it's not 0 anymore. Same for any other limited messages, make sure the variable checked to see if it should be displayed is changed when it's displayed, whether that's changing a boolean from true to false or 0 to 1 or increasing a timesShown variable by 1 so that a timesShown < 5 check later works as expected to only show the message 5 times.

paul44 wrote:
PS: lua code primarily 'retrieved' from various discussions in this forum; so credit due to those contributors.
(tiny rant lol) This is essentially meaningless... it's like saying "oh the code came from some people somewhere so credit goes to them you know?"... um, ok. whoever they are... Either list at least some names or say something like "I managed to cobble this together from what I've found on the forums, so thank you everyone who has helped others before me" which is close to what you said but without some implied notion of you actually giving credit to any specific people when you haven't.
Back to top
View user's profile Send private message
paul44
Expert Cheater
Reputation: 2

Joined: 20 Jul 2017
Posts: 151

PostPosted: Tue Sep 12, 2017 10:20 am    Post subject: Pass on multiple values from AA to lua Reply with quote

I'm trying to "finalize" this little project, and trying to find an elegant solution on how to pass on variables from AA to lua.

See pic: [ imgur_com/a/Rm524 ]

The first part (w/ red arrow ~ actual code in my current table) works fine. The string is passed on, and the entrylist will automatically/instantly disable (while still executing the 'Enabled' part).
However, seeing this can be done, I expect to - evt - come across situations where I'd like to pass on more then 1 value/variable...
* I could use labels (store values in alloc_memory); but I do not think this is practical when working with e.g. strings...
* I've seen several posts, using the createRef/getRef functions... but can't seem to get this working (index error)
* Other options/approaches ? Just thinking about: create a function, receiving those values, f.i. in an array; then storing them in global (?) variable(s)...? (have not tried this yet)

Antway: I will continue looking/searching/reading for a more elegant solution; but if someone can reference me to a (some) proper/plausible solution(s), that would be much appreciated.

PS: to humor #FreeER, most of the code I used was - primarily - either written or suggested by #Dark Byte....
PS2: on the subject, in another topic,#Dark Byte suggested using hotkeys to "circumvent" the 'clipping' issue. Noclip-functionality is now also added to the table.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites