Memory Error Handling

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
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.
Post Reply
Message
Author
zer0
Posts: 213
Joined: Sat Feb 16, 2008 11:55 pm

Memory Error Handling

#1 Post by zer0 » Sun Sep 21, 2008 10:17 pm

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:

Image

I'm guessing that maybe an assert would be used. :?

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Memory Error Handling

#2 Post by Administrator » Sun Sep 21, 2008 11:32 pm

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.

Code: Select all

  local val, success = memoryReadInt(...);
  if( not success ) then
    error("Memory read error!\n", 0);
  end
You probably will need to upgrade your MicroMacro for showWarnings() to be available.

zer0
Posts: 213
Joined: Sat Feb 16, 2008 11:55 pm

Re: Memory Error Handling

#3 Post by zer0 » Mon Sep 22, 2008 10:40 pm

Cool, thanks. I'll give it a try when I get round to it. :)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests