So this applies to the memoryRead functions.
What is a good way to gracefully exit and report a custom error message to the user instead of having:
I'm guessing that maybe an assert would be used.
Memory Error Handling
Forum rules
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Memory Error Handling
Somewhere at the initialisation of your script, call showWarnings(false); to hide the warnings. Then just check the return values on your memory read operations, and return an error if something out of the ordinary happens.
You probably will need to upgrade your MicroMacro for showWarnings() to be available.
Code: Select all
local val, success = memoryReadInt(...);
if( not success ) then
error("Memory read error!\n", 0);
end
Re: Memory Error Handling
Cool, thanks. I'll give it a try when I get round to it.
Who is online
Users browsing this forum: Bing [Bot] and 4 guests