Page 1 of 1

resource finder

Posted: Thu May 02, 2013 11:37 pm
by lisa
This is more usefully when playing manually, I find it painful sometimes to actually see the herbs when walking around farming resources. So I made up this little WP which just runs in the background, it will sound the alarm userfunction and then change the size of the model for the resource and make it bigger and easier to see.

I guess it could be used while creating a farming WP to make it easier to see the resource.

For myself I will probably add in some "defending" code as I tend to go AFK a bit, so it will just kill anything that attacks bot. Might do it tomorrow if I get the time. (only took a couple mins, already added it)

Looks like this.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
	-- Version 1.4
	print("start scanning  ........")
	while(true) do
		if isInGame() and player:exists() and player:isAlive() then
			local objectList = CObjectList()
			objectList:update()
			for i = 0,objectList:size() do
				local obj = objectList:getObject(i)
				obj:update()
				if( obj ~= nil ) then
					if obj.Type == PT_NODE then
						if( database.nodes[obj.Id] ) then
							if memoryReadRepeat("float", getProc(), obj.Address + 0x74) ~= 4 then 
								memoryWriteFloat(getProc(), obj.Address + 0x74, 4)
								print("Found: "..obj.Name.." and made it BIG")
								if playalarm then playalarm() end
							end
						end
					end
				end
				yrest(1)
			end
			-- add defend code here.
			player:update()
			if player.Battling and not player.Mounted then
				if player:target(player:findEnemy(true)) then
					player:fight();
				end
			end
		end
		yrest(500)
	end
</onLoad>
</waypoints>

prints to MM look like this

Code: Select all

start scanning  ........
Found: Dragon Mallow and made it BIG
Alarm has been sounded
Found: Dragon Mallow and made it BIG
Alarm has been sounded
Found: Mirror Sedge and made it BIG
Alarm has been sounded
it will only do it once for each resource node, so it won't just keep sounding alarm over and over for the 1 node.

Re: resource finder

Posted: Thu Jan 30, 2014 3:50 am
by lisa
added option to change which type it uses at the top, added usage for flying and speed using numberpad keys, also made it defend itself if attacked, incase you go afk.

Code: Select all

	--NTYPE_WOOD = 1
	--NTYPE_ORE = 2
	--NTYPE_HERB = 3
	
	_node = 1
that is set to wood, chaqnge the value of _node to 2 or 3 for the other resources.

Code: Select all

		if keyPressed(key.VK_NUMPAD1) and (os.time() - time > delay ) then
			fly()
			time = os.time()
		end
		if keyPressed(key.VK_NUMPAD2) and (os.time() - time > delay ) then
			flyoff()
			time = os.time()
		end
		if keyPressed(key.VK_NUMPAD4) and (os.time() - time > delay ) then
			speed(70)
			time = os.time()
		end		
		if keyPressed(key.VK_NUMPAD5) and (os.time() - time > delay ) then
			speed("off")
			time = os.time()
		end
numpad 1,2,4,5 for the flying and speed hacks.