Planting

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: Planting

#21 Post by lisa » Sun Jul 03, 2011 4:11 am

Well things are looking good, or they were lol
I have an issue, I can target the pot in memory and I can even use the attack skill to move close to it, trouble is I need to actually click it to open the plant interface, can't find any functions to open the interface without clicking it, so I am kinda stumped.

Any thoughts?
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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Planting

#22 Post by lisa » Sun Jul 03, 2011 4:45 am

I deff have it targeted in memory
Here is snippet of code

Code: Select all

	for k,v in pairs(pots) do
	printf(v)
	player:target(v)
	memoryWriteInt(getProc(), player.Address + addresses.pawnTargetPtr_offset, v);
	RoMScript("UseSkill(1,1)"); yrest(50);
	local target = player:getTarget();
	printf(target.Name)
	RoMScript("UseSkill(1,1)"); yrest(50);
	printf(target.Id)
	RoMScript("UseSkill(1,1)"); yrest(50);
Attempted to use attack skill a few times just in case it did actually target/open frame lol
Here is prints

Code: Select all

853309440Large Mayan Plant Pot203838
853312000Large Mayan Plant Pot203838
2 pots same name, same id, diff address. so i know it works as far as that goes. Just need to be able to open the plant interface or actually click the pot.
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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Planting

#23 Post by lisa » Sun Jul 03, 2011 5:55 am

Ok little update,

Seems the character doesn't actually target the pot, even by clicking it.

So basically I will need to find a function that opens the potcare frame, which isn't listed in wiki.

Only other option is to use mouse click on the pot which would mean RoM client would have to be in focus, so couldnt run in background.

Obviously first option is best.
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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Planting

#24 Post by rock5 » Sun Jul 03, 2011 6:14 am

I long suspected, in regards to functions, the wiki is not kept up to date. How do you normally open it? You click it, the interface opens, but it doesn't get targeted? Is that right?
  • 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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Planting

#25 Post by rock5 » Sun Jul 03, 2011 6:30 am

This should give you a few clues. I found them in interface.fdb.
Attachments
planframe.zip
(5.47 KiB) Downloaded 135 times
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Planting

#26 Post by lisa » Sun Jul 03, 2011 7:28 am

awesome, I needed this

Code: Select all

RoMScript("ShowUIPanel(PlantFrame);")
which in hindsite is kinda obvious lol
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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Planting

#27 Post by lisa » Sun Jul 03, 2011 9:55 am

Ok this is getting annoying now.

Seems house furniture is very special, behaves like no other items/npc.

An example would be the storage chest, you can "harvest" it and it says it found the item and will try to harvest it but unless you have your mouse pointing at the storage chest nothing will happen.

So we can either accept the fact that this will only happen if you hover mouse over each pot when opening frame, otherwise need to find a way to trick it into thinking the mouse is pointing at the pots.

Don't need to have the window in focus, just need it to have the mouse over appear, like when name appears next to mouse.

Spoke to soon, on further testing, storage box you don't need window in focus but pots you do, just gets worse lol
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
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Planting

#28 Post by MiesterMan » Sun Jul 03, 2011 11:55 am

I'm going to look at this right now but you might try the reload trick.

When you're harvesting something and do a /script ReloadUI(); the object appears in the target frame after it finishes reloading. This could tell you if it's targetting it properly or not.

Edit: Nevermind, tried it, doesn't work.

Edit2: The reload trick works if you use target object before reloading. Hehe, didn't really help but still. I think I've got a method for you. (Doesn't always work)

nokirk
Posts: 73
Joined: Sat Jul 03, 2010 2:26 pm

Re: Planting

#29 Post by nokirk » Sun Jul 03, 2011 3:51 pm

lisa wrote:Spoke to soon, on further testing, storage box you don't need window in focus but pots you do, just gets worse lol
Maybe it's got something to do with the fact that rombot doesn't really target objects? Cause sometimes you attack and kill a mob but don't even have it in target? And as a solution, is it possible to add something to the targeting function so rombot really takes it in target? It should be possible to open the pot interface then, shouldn't it?

Edit: which wouldn't solve the problem with the pots having the same id..

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

Re: Planting

#30 Post by lisa » Sun Jul 03, 2011 7:50 pm

The id being same isn't important as we use the address anyway.

I can target it via memory using player:target(address) and if you use attack skill on the item and also have mouse over object then it works perfectly in all aspects.
If you don't mouse over or you don't use attack skill then it doesn't get info from that pot. (it also only gets info from the moused over pot regardless of what is targeted in memory but you still need to target a pot in memory to make it work)

The plant frame can be forced to appear using showui but without actually doing the target/attack/mouseover the plant frame will have no data or the data from the last time it was opened.

Been trying to find the section of memory for the items but I am kinda lost on that bit. I get a print of the addresses for the items but it makes no sence to me. Even print of address of player or housemaid I can't see the relation to the memory address.

Code: Select all

2:      table: 03D21170
        Id:     203832
        Type:   0
        Name:   Flowery Plant Pot
        Address:        34931968
3:      table: 03D211E8
        Id:     113809
        Type:   0
        Name:   (housemaid for pots**edited)
        Address:        34934528
4:      table: 03D21210
        Id:     1000
        Type:   1
        Name:   (Charname**edited)
        Address:        442134016
8:      table: 03D212D8
        Id:     203838
        Type:   0
        Name:   Large Mayan Plant Pot
        Address:        442142976
9:      table: 03D21350
        Id:     110758
        Type:   0
        Name:   Housekeeper
11:     table: 03D213C8
        Id:     203838
        Type:   0
        Name:   Large Mayan Plant Pot
        Address:        442158336
12:     table: 03D21328
        Id:     203906
        Type:   0
        Name:   Sea Wave Plant Pot
        Address:        442159616
13:     table: 03D21440
        Id:     203832
        Type:   0
        Name:   Flowery Plant Pot
        Address:        442162176
14:     table: 03D21490
        Id:     201383
        Type:   0
        Name:   Storage Chest
        Address:        442169856
Ohh yeah reloadUI did show the target, but I knew I had it targeted anyway from other testing =)
Attachments
pottarget.jpg
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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Planting

#31 Post by lisa » Sun Jul 03, 2011 8:36 pm

At the moment I am trying to convince the client that the target is moused over using memory. That's why I am trying to find the region of memory so I can see if there is anything noticable for moused over objects.
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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Planting

#32 Post by rock5 » Sun Jul 03, 2011 9:00 pm

I found a pointer that shows the address of the item under the mouse
address 9C57EC offset 744

Initial attempts at changing it didn't work. It just reset to 0. The area around it seems to do with the mouse. A little above it I even saw some values that show the coordinates of the mouse.
  • 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
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Planting

#33 Post by MiesterMan » Sun Jul 03, 2011 9:29 pm

Sorry, I got sidetracked and lost most of the work I'd been doing.

It's a bit confusing but you're definately right about this being different than an attackable item.

I got very confused when experimenting with the events involved so I'll just give you what I made to help me figure out how it works.

These are functions that you would put in one of your custome RoM addons:

Code: Select all

function PlantFrame_OnEvent( this, event, arg1, arg2 )
	SendSystemChat("this:  " .. tostring(this));
	SendSystemChat("event:  " .. tostring(event));
	SendSystemChat("arg1:  " .. tostring(arg1));
	SendSystemChat("arg2:  " .. tostring(arg2));
	if ( event == "HOUSES_PLANT_OPEN" ) then
		ShowUIPanel(this);
		PlantFrame_Update();
		return;
	elseif ( event == "HOUSES_PLANT_CLOSE" or 
	         event == "HOUSESFRAME_HIDE"   ) then 
		 --event == "HOUSES_FURNITURE_CHANGED" ) then
		HideUIPanel(this);
		return;
	elseif ( event == "HOUSES_PLANT_CHANGED" ) then
		PlantFrame_Update();
		return;
	end
end

function EnumerateArgs(_func,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)
	local _tr = {_1,_2,_3,_4,_5,_6,_7,_8,_9};
	_tr._1,_tr._2,_tr._3,_tr._4,_tr._5,_tr._6,_tr._7,_tr._8,_tr._9,_tr._10,_tr._11,_tr._12,_tr._13,_tr._14,_tr._15,_tr._16,_tr._17,_tr._18,_tr._19,_tr._20 = _func(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
	
	for i=1,20,1 do
		if _tr["_"..i] then
			SendSystemChat("Return " .. i .. ":  " .. tostring(_tr["_"..i]));
		end
	end
	
end
There's another thing you can do to find values that seem mysterious:

Code: Select all

/script for i,v in pairs(_G) do if tostring(value) == tostring(v) then SendSystemChat(tostring(i));end;end;
I know I should have been able to reason it out but that's how I figured out the first argument being sent to the event handler was PlantFrame.

Greenthumb.lua uses a number of house functions to find info on the pots. It's "FindPots" or something like that. Using the EnumerateArgs function I was able to find a ghost return value that is proportional to the last sent in the event. Houses_GetFurnitureItemInfo(slotnumber) is the one I think. It was the fifth or sixth value returned (the one right after the boolean "Placed" value). You subtract that number from 1000000 I think. Bah, hang on, I'll log back in and check again.

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

Re: Planting

#34 Post by lisa » Sun Jul 03, 2011 9:45 pm

Ahh nice find.

Seems to me offset 744 is reference to the items address and 746 747 are the indicators of moused over.
when I mouse over a pot I get this info.

442142976 (address printed by MM) and is also the value of 744
745 has value of 1727121
746 has value of 6747
747 has value of 26

442158336 = 744
1727181
6747
26

8 out of 10 objects, including npc person I pointed at had the same 746 and 747

Now where it gets tricky is when the address is very different the 746/747 change

34931968 = 744
136453
533
2

So when the address is very different it affects the 746 & 747

Also in 8/10 objects in my house the 745 was 1727*** the other 2 were 136***
Any of that make sence?
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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Planting

#35 Post by rock5 » Sun Jul 03, 2011 10:16 pm

I think you are getting a bit confused. The address at 744 is a 4 byte address. So it includes 745,756 and 747. Each of those single bytes has no meaning on its own.


Hm... interesting. A byte at offset 41 switches between 1 and 0 depending on whether the client is the active window or not. And offset 4bc and 4c0 alternate between 1 and 0 when clicking. Just tried simulating a mouse click. Didn't work.
  • 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
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Planting

#36 Post by MiesterMan » Sun Jul 03, 2011 10:43 pm

So, getting nowhere with my possible "RoMScript" method I decided to explore rock's pointer. When you debug and scan for what accesses the pointer there is a distinctly different access for clicking but it uses this thing I've often run into and can't find a reference that can explain it to me.

So it's like the attached picture. Can anyone explain to me what that code means? What's happening?
When you click on something...<br />std::_Init_locks... ???!?!?!?
When you click on something...
std::_Init_locks... ???!?!?!?

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

Re: Planting

#37 Post by lisa » Sun Jul 03, 2011 10:48 pm

lol yeah I did get a bit confused there, for some reason I have display set to byte hex by default, have to keep changing it to 4byte or I get confused

Ok so little update

memoryWriteBytePtr(getProc(), 0x9C57EC, 0x41, 1);

I added that into my function and did a timer for it. I checked on CE and it does set the value to 1 for the address, and it appears to be enough to make some of the code work but not all, actually returns values for the RoMScript("Plant_GetInfo();") which it wouldn't do unless I had RoM as focus window. So thats an improvement.

I also have this

memoryWriteBytePtr(getProc(), 0x9C57EC, 0x744, v.Address);

where v.Address is the address of a pot. I check CE and the value isn't changing for the 744 offset and not sure why.

Code: Select all

	function targetpot()
	memoryWriteBytePtr(getProc(), 0x9C57EC, 0x41, 1);
	memoryWriteBytePtr(getProc(), 0x9C57EC, 0x744, v.Address);
	end
	registerTimer("targetpot", 10, targetpot);
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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Planting

#38 Post by lisa » Sun Jul 03, 2011 10:53 pm

Hmm 4bc appears to be movement on Y axis
4co appears to be movent on X,Z axis

offset 490 appears to be the cursor type, changes when the mouse hovers something that alters the cursor. Like mousing over storage box you get the cog, mousing over npc you get the chat dialog cursor.

480 appears to be camera zoom

3B4 and 3B8 appear to be for mouse coords on screen (positioning)
3B4 left/right 3B8 up/down

3BC and 3B0 appear to be the alternate mouse clicks, for me atleast.
and do a quick switch 1 and 0. hold down left click and it stays switched until left click release. (same for both left and right click)
Edit: I belive this is actually the icon dissappearing and then having camera movement using mouse. Not actually clicking anything with mouse.
Last edited by lisa on Sun Jul 03, 2011 11:32 pm, edited 1 time in total.
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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Planting

#39 Post by rock5 » Sun Jul 03, 2011 11:13 pm

lisa wrote:Hmm 4bc appears to be movement on Y axis
4co appears to be movent on X,Z axis
Sorry I meant 3bc and 3c0. I was typing from memory.
lisa wrote:memoryWriteBytePtr(getProc(), 0x9C57EC, 0x744, v.Address);

where v.Address is the address of a pot. I check CE and the value isn't changing for the 744 offset and not sure why.
Maybe because it is always updating and it sees there isn't really anything under the mouse. Did you try freezing that too?
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Planting

#40 Post by lisa » Sun Jul 03, 2011 11:52 pm

Did you try freezing that too?
Do you mean 0x744 ?
yeah that is what isn't changing when I try

Code: Select all

   function targetpot()
   memoryWriteBytePtr(getProc(), 0x9C57EC, 0x41, 1);
   memoryWriteBytePtr(getProc(), 0x9C57EC, 0x744, v.Address);
   end
   registerTimer("targetpot", 10, targetpot);
0x41 stays as 1 but 0x744 doesn't appear to change at all.
Not sure which other offset to try freezing if you mean a different one.

sidenote:-
3BC and 3B0
I belive this is actually the icon dissappearing and then having camera movement using mouse. Not actually clicking anything with mouse.
So a switch to say move camera with mouse movement.
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

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests