using MM to pass information to addon?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: using MM to pass information to addon?

#41 Post by lisa » Fri Aug 03, 2012 3:12 am

you will probably find if you change the value it will update automatically back, in order to stop the updates you would need to stop the function that updates the value.
Like how the attack works now or swimhack.
It removes the code that updates the value and then once you are done with it then puts the function back the way it was.

It can get complicated but I think I might see where you are going with it, for instance farming to not need a reseter.
I seriously doubt you could do honor parties like this as it would have checks for party member lvl aswell.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
silinky
Posts: 213
Joined: Mon Nov 23, 2009 5:07 am

Re: using MM to pass information to addon?

#42 Post by silinky » Fri Aug 03, 2012 3:33 am

yeah, this would be a possibility also.
for now i am only interested about the theory behind this so i could be able to find these things alone and not be forced to wait for the experts to mouth-feed me with every trivial task :)
lisa you have a PM also please check it :)

User avatar
silinky
Posts: 213
Joined: Mon Nov 23, 2009 5:07 am

Re: using MM to pass information to addon?

#43 Post by silinky » Sat Aug 04, 2012 3:35 am

rock5 wrote:You could create a bot function or waypoint onload code that keeps checking if the player has a target. If so, the easy solution would be to change a variable in game, eg

Code: Select all

RoMScript("} targetdistance = "..distance.." a={")
Then just have the addon use that value when it's there.

But to get faster speed than using a RoMScript you could write to a macro instead, eg.

Code: Select all

writeToMacro(macroNum, distance)
Then you can have the addon read the macro using GetMacroInfo function. Of course you would have to make sure they use the same macro.
i finally reached the point when this has made sence, and i could use successfully the first one, but this does not work:

Code: Select all

writeToMacro(7, targetdistance)
targetdistance is printed in mm window so it is ok.
is there anything i should do for macro slot 7?
should there be an empty macro created? or is it a problem if it already has some value? has to be clear?

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: using MM to pass information to addon?

#44 Post by lisa » Sat Aug 04, 2012 4:03 am

my guess is you missed this step
Then you can have the addon read the macro using GetMacroInfo function. Of course you would have to make sure they use the same macro.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
silinky
Posts: 213
Joined: Mon Nov 23, 2009 5:07 am

Re: using MM to pass information to addon?

#45 Post by silinky » Sat Aug 04, 2012 6:09 am

oh, no, i did this step :)
and when i write smtg in that macro slot, the getmacroinfo is printing my macro text.

it's just that MM does not update that text.
and i cannot figure out why bc it gives me no error message

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: using MM to pass information to addon?

#46 Post by rock5 » Sat Aug 04, 2012 6:35 am

It doesn't update itself. You have to keep updating it. Here's an example in a waypoint onload.

Code: Select all

<waypoints>
<onLoad>
repeat
    player:update()
    local target = player:getTarget()
    if target then
        local dist = distance(player.X,player.Z,target.X,target.Z)
        writeToMacro(7, dist)
    else
        writeToMacro(7, nil)
    end
    yrest(200)
until false
</onLoad>
</waypoints>
So while this waypoint file is running, when you read the macro with your addon, it will have an updated distance to the target or nil if you don't have a target.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
silinky
Posts: 213
Joined: Mon Nov 23, 2009 5:07 am

Re: using MM to pass information to addon?

#47 Post by silinky » Sat Aug 04, 2012 6:48 am

i have it in a loop :)
i think something else is wrong there, the function just does nothing in my wp.

i wil try to get a gode that updates it, maybe this one you posted and try to find out what is keeping it from working

User avatar
silinky
Posts: 213
Joined: Mon Nov 23, 2009 5:07 am

Re: using MM to pass information to addon?

#48 Post by silinky » Mon Aug 13, 2012 5:07 pm

progress is going OK, but i need another info, if available.
how can i check an object's buff? before targeting. so me targeting it depends on what buffs it has.
thx :)

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: using MM to pass information to addon?

#49 Post by lisa » Mon Aug 13, 2012 6:04 pm

you need to create a pawn of the object and that is pretty much it.

Code: Select all

local mob = CPawn(obj.Address)
if mob:hasBuff(buffname, count) then
--do stuff
end
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
silinky
Posts: 213
Joined: Mon Nov 23, 2009 5:07 am

Re: using MM to pass information to addon?

#50 Post by silinky » Tue Aug 14, 2012 1:40 am

thank you lisa :)
i didn't know that i could do that.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: using MM to pass information to addon?

#51 Post by lisa » Tue Aug 14, 2012 1:57 am

In a nut shell, if you use any code that uses the objectlist,like findNearestNameOrId, it will have these variables.

Code: Select all

		self.Address = ptr;
		self.Name = "<UNKNOWN>";
		self.Id = 0;
		self.Type = PT_NONE;
		self.X = 0.0;
		self.Y = 0.0;
		self.Z = 0.0;
If you want any more info than that from a mob/npc/obj then you need to make it a pawn using it's address, once you do that then you have all the info in pawn.lua.
Not going to post it as it is pretty long and I am sure you know how to have a look in the file =)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Bubi
Posts: 57
Joined: Tue May 04, 2010 3:51 pm

Re: using MM to pass information to addon?

#52 Post by Bubi » Mon Sep 24, 2012 3:27 pm

Hi Lisa,
I used the userfunction "pawnlog" and got the info i want. Now I try to write a different value to the memory. I looked at the swimhack userfunktion but its not working that way for me Image

thats the pawnlog I got

Code: Select all

Bits,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,1,1,0,0,0, XXXX
thats what I want to write to memory

Code: Select all

Bits,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,1,1,1,0,0,0
so in Code:

Code: Select all

if (bitAnd(inp,0x8000000) and bitAnd(inp,0x2000000)) then 
???
memoryWriteIntPtr(getProc(), obj.Address, addresses.pawnAttackable_offset, active);
""0x4000000=0"" 
???
end
Thanks for your help

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: using MM to pass information to addon?

#53 Post by rock5 » Mon Sep 24, 2012 3:40 pm

I did something similar recently so I know how to do it.

If inp is the byte that you read from memory and 0x8000000 is the bit you want to add or remove then.

To add a bit you can just do

Code: Select all

inp = bitOr(inp,0x8000000)
It will only add the bit if it doesn't already exist.

To remove a bit you can just minus the value but you have to check that is exists first

Code: Select all

if bitAnd(inp,0x8000000) then
    inp = inp - 0x8000000
end
You can also add the bit in this way too

Code: Select all

if bitAnd(inp,0x8000000) then
    inp = inp + 0x8000000
end
Then just rewrite the byte back to memory.

Hope that helps.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Bubi
Posts: 57
Joined: Tue May 04, 2010 3:51 pm

Re: using MM to pass information to addon?

#54 Post by Bubi » Mon Sep 24, 2012 4:06 pm

Hi Rock5,
thanks allot for the fast answer.
Just one more noob question.
rock5 wrote:Then just rewrite the byte back to memory.
how to rewrite back to memory? Image

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: using MM to pass information to addon?

#55 Post by rock5 » Mon Sep 24, 2012 4:20 pm

Writing is similar to reading but I see you made a mistake in that too. So I'll just point you to the wiki.
http://www.solarstrike.net/wiki/index.p ... _Functions
Note: Some functions are for pointers and others are not. Learn the difference.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Bubi
Posts: 57
Joined: Tue May 04, 2010 3:51 pm

Re: using MM to pass information to addon?

#56 Post by Bubi » Mon Sep 24, 2012 4:23 pm

rock5 wrote:Note: Some functions are for pointers and others are not. Learn the difference.
I will Image

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 5 guests