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 


Can't seem to get my script right.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Flux.
Advanced Cheater
Reputation: 0

Joined: 10 Nov 2016
Posts: 88
Location: Another World - N5X2 106311411+2123518

PostPosted: Fri Nov 20, 2020 1:15 pm    Post subject: Can't seem to get my script right. Reply with quote

Hello all,
my script is based on an old script DarkByte posted a while ago, i was trying to repurpose it, but can't seem to get it perfect.
The Script works but the problem is, the first execute in the lua console is fine, but the second time you run it you have to close the hotkey function twice, and the third time three times and so on, can anyone tell me what i am missing please.
Also is it possible to close a message window from script, so that when i use the hotkey that's the only message window left showing ?
Code:
function hk()
i=5
showMessage('Crisis Averted')
end
createHotkey(hk, VK_F8)

i = 0
function countdown()
  while (i < 5) do
  i = i+1
  sleep(1000)
  showMessage(i..' Attempt(s) used (of 5) to push F8')
    if i == 5 then nt.destroy();nt=nil
    hk.destroy();hk=nil
    break end
  end
end
nt = createNativeThread(countdown)
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