View previous topic :: View next topic |
Author |
Message |
Frouk Master Cheater Reputation: 5
Joined: 22 Jun 2021 Posts: 489 Location: mov dword ptr [Ukraine]
|
Posted: Sat Jul 24, 2021 2:00 pm Post subject: While condition |
|
|
Code: | while stop == 0 do
print("Test");
if isKeyPressed(VK_ESCAPE) then
stop = 1
break
end
sleep(100)
end
|
If i don't stop this in lua engine, CE will freeze
And if i write a simple lua script
Last edited by Frouk on Sat Jul 24, 2021 2:07 pm; edited 1 time in total |
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Sat Jul 24, 2021 2:06 pm Post subject: |
|
|
You're putting the main thread in an infinite loop. You should use a thread or timer.
_________________
|
|
Back to top |
|
|
Frouk Master Cheater Reputation: 5
Joined: 22 Jun 2021 Posts: 489 Location: mov dword ptr [Ukraine]
|
Posted: Sat Jul 24, 2021 2:07 pm Post subject: |
|
|
Is there's way to avoid this?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25291 Location: The netherlands
|
Posted: Sat Jul 24, 2021 2:15 pm Post subject: |
|
|
yes, don't use infinite while loops in the main thread. Always stop them
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Frouk Master Cheater Reputation: 5
Joined: 22 Jun 2021 Posts: 489 Location: mov dword ptr [Ukraine]
|
Posted: Sat Jul 24, 2021 2:24 pm Post subject: |
|
|
Creating new thread will avoid this crash?
P.S: Got an idea to make function OnUpdate (kinda)
|
|
Back to top |
|
|
ByTransient Expert Cheater Reputation: 5
Joined: 05 Sep 2020 Posts: 240
|
|
Back to top |
|
|
Frouk Master Cheater Reputation: 5
Joined: 22 Jun 2021 Posts: 489 Location: mov dword ptr [Ukraine]
|
Posted: Sat Jul 24, 2021 11:47 pm Post subject: |
|
|
New thread require an address, what to do?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25291 Location: The netherlands
|
Posted: Sun Jul 25, 2021 12:38 am Post subject: |
|
|
use lua createThread not Autoassembler CreateThread
it takes a function
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Frouk Master Cheater Reputation: 5
Joined: 22 Jun 2021 Posts: 489 Location: mov dword ptr [Ukraine]
|
Posted: Sun Jul 25, 2021 11:01 am Post subject: |
|
|
Thanks for help
|
|
Back to top |
|
|
|