Page 2 of 3

Re: Goblin Mines - Phirius Potion farm

Posted: Fri Sep 14, 2012 12:16 pm
by RomJunkie
ongoing update:

on a lower level character (58) if she swims down to a box and gets attacked, she'll properly kill the attacker, but if she moves more than a couple of yards towards the attacker (and away from the box), she'll forget to loot the box after the fight.

Re: Goblin Mines - Phirius Potion farm

Posted: Thu Oct 11, 2012 1:37 pm
by Hidden
if (not player:hasBuff("506684")) then
inventory:useItem(207200);
end

Noticed it was buffing every time before it entered romoved the extra brackets on that code. Thanks Great share :)

if not player:hasBuff("506684") then
inventory:useItem(207200);
end

Re: Goblin Mines - Phirius Potion farm

Posted: Fri Oct 12, 2012 3:18 am
by Ego95
if (not player:hasBuff("506684")) then
inventory:useItem(207200);
end

Noticed it was buffing every time before it entered romoved the extra brackets on that code. Thanks Great share

if not player:hasBuff("506684") then
inventory:useItem(207200);
end
You are right. I didn't notice it, too, have to change that, thanks. I want to upload a newer version too, but at this time I'm busy with other things. And if I get the time I try to improve other scripts.

Re: Goblin Mines - Phirius Potion farm

Posted: Fri Oct 12, 2012 3:45 am
by rock5
I can't see how those extra brackets could make any difference.

Re: Goblin Mines - Phirius Potion farm

Posted: Fri Oct 12, 2012 8:56 am
by Ego95

Code: Select all

I can't see how those extra brackets could make any difference.
I've just tested it and it doesn't make any difference :D
Everything works like it should

Re: Goblin Mines - Phirius Potion farm

Posted: Fri Oct 12, 2012 11:30 am
by Hidden
Wasn't a big thing was just using an unbridled every time for me changed that and it was fine. Have noticed a few of my characters behaving erratically recently all using the same scripts but sometimes behave different. I've probably tweeked something somewhere.

Re: Goblin Mines - Phirius Potion farm

Posted: Mon Nov 12, 2012 12:25 pm
by zeljomir
can i ask whay he swim ?? whay not teleport? same like in old golden eag wp..

Re: Goblin Mines - Phirius Potion farm

Posted: Mon Nov 12, 2012 3:18 pm
by Ego95
Because teleporting is only useful for small distances between point A and B and not for long routes. Maybe I'll upload a new version soon, but I don't get it working. I want to make sure the bot opens the chests until they are unclickable like in rock's AT script but I don't get it working yet.

Bugs that will be fixed:
-player forgets to loot a chest because of getting aggro
-it will be possible to do the goblin script with chars of any level
-bot will wait until party member has accepted the invite before entering the game
-bot uses teleport to get over the first fence (if I run more bots and clients it sometimes gets stuck there)

I'll maybe add:
-Check for sirius hammertooth

The only thing which makes trouble is the looting of the chests. Maybe you can help me with that evalClickable function of your AT script. I know that you are busy with the big rom bot update at the moment, so I don't want to ask too much.

Re: Goblin Mines - Phirius Potion farm

Posted: Mon Nov 12, 2012 3:25 pm
by rock5
I don't do goblins so can't help much. You could try that eval function. It might work.

Re: Goblin Mines - Phirius Potion farm

Posted: Mon Nov 12, 2012 3:48 pm
by Ego95
I've already tried that, but the bot only waits in front of the chests. This is a party of your evalClickable function

Code: Select all

memoryReadRepeat("byte", getProc(), address + 0x2F0)
I don't know what it does exactly but I think the adresses has to be different.

Re: Goblin Mines - Phirius Potion farm

Posted: Mon Nov 12, 2012 3:53 pm
by rock5
AlterEgo95 wrote:I don't know what it does exactly but I think the adresses has to be different.
You mean the offset. Yeah it's possible.

Re: Goblin Mines - Phirius Potion farm

Posted: Mon Nov 12, 2012 4:01 pm
by Ego95
Is there a way to get those offsets without being a professionall programmer? :D
With Cheat Engine or something like that? I don't know how to start with this even after reading lisas "Finding memory adresses in RoM" guide the second time.

Re: Goblin Mines - Phirius Potion farm

Posted: Tue Nov 13, 2012 2:09 am
by rock5
You could probably do it with cheat engine.

When standing in front of the unopened chest do this.
  • 1. Start the commandline waypoint file.
    2. Find the chest

    Code: Select all

    chest = player:findNearestNameOrId("chest name")
    3. Print the address

    Code: Select all

    printf("%X\n",chest.Address)
    4. Copy the address and paste it into cheat engine in the 'start' box on the right hand ride.
    5. Paste it into the 'Stop' box too but add about 1000 to it to limit the search.
    6. Set it to do a 'byte' search and scan type "Unknown initial value" and do a first scan.
    7. Open the chest.
    8. Change the scan type to "Changed value" and do another scan.
If you are lucky one of the first results will be the one you are looking for. The offset will be the address minus the initial address from step 3. You can repeat it from the start with other chests to be sure. It's possible that you actually need a bit in that byte which you can work out when you have the before and after values. Check out the link in my sig if you don't know how to copy and paste in MM.

Re: Goblin Mines - Phirius Potion farm

Posted: Tue Nov 13, 2012 2:21 am
by lisa
you can test if this bit works for it, it is from survival tiles to check if tile has been clicked.

Funily enough it is the same bit for the tortiouse event.

Code: Select all

function clicktile(address)
	local tmp = memoryReadRepeat("int", getProc(), address + addresses.pawnAttackable_offset) or 0;
	if bitAnd(tmp,0x8) then
		return true
	else
		return false
	end
end

Re: Goblin Mines - Phirius Potion farm

Posted: Tue Nov 13, 2012 10:02 am
by Ego95
The offset will be the address minus the initial address from step 3.
Okay, I tried rocks method first. I got the adresses 21FB5CF0 and 21FB5A00. How do I subtract those now? I think I did everything right until now. Cheat Engine showed me the value "0" after opening the chest and the next scan.

Re: Goblin Mines - Phirius Potion farm

Posted: Tue Nov 13, 2012 10:28 am
by rock5
AlterEgo95 wrote:I got the adresses 21FB5CF0 and 21FB5A00. How do I subtract those now?
Use a calculator. :D I use the Windows one. Just select "Programer" from the "View" menu. Then click the "Hex" radio button.

So now you can create an eval function like this

Code: Select all

function evalClickable(address)
    return memoryReadByte(getProc(), address + 0x2F0) ~= 0
end
and then you can do searches like

Code: Select all

chest = player:findNearestNameOrId("chest name",nil,evalClickable)
Good luck.

Re: Goblin Mines - Phirius Potion farm

Posted: Tue Nov 13, 2012 10:55 am
by Ego95
thanks rock
AlterEgo95 has learned to find offsets of objects today :D
Funnily it's the same offset as yours in the AT script. Then I maybe did something wrong. I'll try if it works now.

Re: Goblin Mines - Phirius Potion farm

Posted: Tue Nov 13, 2012 12:54 pm
by Ego95
New version has been added to the first post. Thanks rock, for helping with the evalClickable function.
Feedback and bug-report please :)

Re: Goblin Mines - Phirius Potion farm

Posted: Fri Nov 16, 2012 4:52 pm
by botje
may i suggest you add

Code: Select all

if CountPlayers() > 1 then
		   print("Waiting till it's less crowded")
		   repeat
			  yrest(15000)
		   until 2 > CountPlayers(nil,true) 
		end
so we dont get noticed :3

Re: Goblin Mines - Phirius Potion farm

Posted: Fri Nov 16, 2012 6:21 pm
by Ego95
I thought about to add this already. On my server there are always people afk or at the ah so if I would use the bot for 24 hours I would get 0 potions. I will think about it again. As long as I don't upload a new version you can add it to your file ;)