Attempt to perform an Arithmetic on Global

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
chaoticxistence
Posts: 2
Joined: Tue Nov 16, 2010 7:13 am

Attempt to perform an Arithmetic on Global

#1 Post by chaoticxistence » Tue Nov 16, 2010 7:26 am

Hi, Im begining scripting with MicroMacro and i have a mistake that i can't solve.
This is the extraction of the code.

Code: Select all

HPPercent = 75;
HPCurrent = memoryReadInt( MyProcess, HPCurrentAddress);
HPMax = memoryReadInt( MyProcess, HPMaxAddress);
printf("Found HP Current [%d] \n", HPCurrent);
printf("Found HP Max [%d] \n", HPMax);
if( HPPercent > ((HpCurrent*100)/HPMax) ) then
    keyboardPress(key.VK_8);
  end
The error i got its attempt to perform an Arithmetic on Global HPCurrent a nil value. I see the Hp Current and HP max results correctly.
Anyone can tell me a clue?
Thanks in advance.

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

Re: Attempt to perform an Arithmetic on Global

#2 Post by Administrator » Tue Nov 16, 2010 9:21 pm

On which line does the error come from?

If it's this:

Code: Select all

if( HPPercent > ((HpCurrent*100)/HPMax) ) then
then your problem is that HpCurrent is not the same as HPCurrent.

chaoticxistence
Posts: 2
Joined: Tue Nov 16, 2010 7:13 am

Re: Attempt to perform an Arithmetic on Global

#3 Post by chaoticxistence » Tue Nov 16, 2010 11:21 pm

Sorry about i forgot the line that have the error. Yes, you are right about this line. Never thought that the var can be diferent because i only used one var with this name. I checked the var and wasn,t empty.
Maybe i must to investigate about it and learn more about the variables. Maybe i,m not so clear with my english.
Thanks for your fastest answer.

-- Edit:
Problem solved. Only was that you say, the var didn't be the same. But this made me learn another ways to code it and i think i improved it. Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests