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 


Lua - Info/Error Popup Window

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

Joined: 20 Jul 2017
Posts: 152

PostPosted: Tue Nov 14, 2017 11:03 am    Post subject: Lua - Info/Error Popup Window Reply with quote

It happened quite a few times now, but whenever I get an error causing that popup window to loop/print a particular error (either caused by a typo, unfinished function, etc), it becomes impossible to continue.
The error keeps displaying and either I need to kill CE (sometimes not even possible), log off (best case) or restart/reboot...

It would be nice if that particular window had an option to "halt" any reporting (button, tickbox, etc), so one can gracefully save/quit CE. Or actually correct the problem, then continue...

Anyways: did some searching, but could not find anything related to this (except more mentioning of the same situation). If there is a graceful workaround, surely let me/us know.

ps: happened to me 3x last weekend; obviously losing my progress on each occassion (bummer)...

some examples:
- added {luacall(LocationTimer("Welcome"))} (without {}) but mistyped 'Welcome'
- added {addrXY = getAddress("XYstepVal")}: same thing; typo
- plenty more Cool


PS2:up to last week, I got constant Cloudflare warnings; and could not post a single thing. Seem to be solved now?! (... Ray ID: 3b97dbeea59a442d)
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Tue Nov 14, 2017 12:20 pm    Post subject: Reply with quote

paul44 wrote:
It would be nice if that particular window had an option to "halt" any reporting (button, tickbox, etc), so one can gracefully save/quit CE.

Do you mean you don't want the window to move to the foreground on print? If so, disable the menu item View -> Show on "print" in the Lua Engine window.

If you don't want it repeatedly showing errors, then try testing your code. If it doesn't work, don't place it in a timer where it'll give you the same error every time the timer calls Lua code to run.

You could also hook createTimer to do something like this:
Code:
createTimer_old = createTimer_old or createTimer

timer_hook_mt = {
  __index = function(self, k)
    return self.rawtimer[k]
  end,
  __newindex = function(self, k, v)
    if string.lower(k) == 'ontimer' then
      self.rawtimer.OnTimer = function(...)
        local success, msg = pcall(v, ...)
        if not success then
          self.rawtimer.Enabled = false
          error(msg)
        end
      end
    else
      self.rawtimer[k] = v
    end
  end,
}

createTimer = function(...)
  return setmetatable({ rawtimer = createTimer_old(...) }, timer_hook_mt)
end

This way, when there's an error, the timer is disabled. Note that this is not a solution for a problem: it is a way for you to diagnose what the problem is.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
paul44
Expert Cheater
Reputation: 2

Joined: 20 Jul 2017
Posts: 152

PostPosted: Tue Nov 14, 2017 1:30 pm    Post subject: Error looping Reply with quote

I do want it to print (for me a common practice to figure out if I'm working with/getting the right values), when appropriate. Ie when I am using print statements. The situation I have - and I have come across others mentioning this when searching for a solution - is when one simply misses, or mistypes, or forget to update, etc.
In one particular case: I was creating a new entry, based on an existing/working entry in the addreslist. Unfortunately, I got a mistype... and off it goes... In another case, I changed the entryname in the addresslist, but - almost obviously - forgot to update the lua script... Shocked

And indeed, I'm using a 'timer' function here.

Bottomline: usually a 'pain in the butt', and 7/10 I can kill CE without the need to reset my cpu. but I would definitely appreciate some/any way to pause that window when it starts 'print-looping' errors...
_______
Example: [ imgur_com/a/Zejdl ] (I just slightly changed the entry_name in a 'getAddressList()' to something else ~ clicking very fast Wink on the CE title [x] can get me quit CE sometimes)

-EDIT-
I have not forgotten this; just did not yet encounter an "extreme" case. But to be honest, it does seem to do exactly what you stated... and what I wanted.


Last edited by paul44 on Tue Nov 28, 2017 12:52 pm; edited 1 time in total
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Tue Nov 14, 2017 1:49 pm    Post subject: Reply with quote

Cheat Engine can't protect you from yourself, and neither can anyone else if you don't take other people's suggestions.

As I have already said, disable the menu item View -> Show on "print" in the Lua Engine window if you want to stop bringing the Lua engine window to the foreground.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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 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