Walking back while fireing arrows

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
newton666
Posts: 81
Joined: Fri Oct 22, 2010 3:16 pm

Walking back while fireing arrows

#1 Post by newton666 » Wed Nov 20, 2013 9:35 am

wonder if its possible for my scout to fire off "shot" while walking backwards?
tried to use your "userfunction_kiteThunderstorm"

Code: Select all

function kiteThunderstorm(mymob)
	if mymob then
		mymob = CPawn(mymob.Address)
	else
		return -- no mob found yet
	end

	-- return true if mob disappeared or dead or false if still alive
	if mymob.Id == 0 or
	1 > mymob.HP or
	not mymob.Alive then
		return true
	end

	-- Freeze mouse function
	local function nopmouse()
		-- x axis
		local addressX1 = addresses.functionMousePatchAddr
		local addressX2 = addresses.functionMousePatchAddr + addresses.mousePatchX2_offset
		local addressX3 = addresses.functionMousePatchAddr + addresses.mousePatchX3_offset
		memoryWriteString(getProc(), addressX1, string.rep(string.char(0x90),#addresses.functionMouseX1Bytes)); -- left of window
		memoryWriteString(getProc(), addressX2, string.rep(string.char(0x90),#addresses.functionMouseX2Bytes)); -- right of window
		memoryWriteString(getProc(), addressX3, string.rep(string.char(0x90),#addresses.functionMouseX3Bytes)); -- over window

		-- y axis
		local addressY1 = addresses.functionMousePatchAddr + addresses.mousePatchY1_offset
		local addressY2 = addresses.functionMousePatchAddr + addresses.mousePatchY2_offset
		local addressY3 = addresses.functionMousePatchAddr + addresses.mousePatchY3_offset
		memoryWriteString(getProc(), addressY1, string.rep(string.char(0x90),#addresses.functionMouseY1Bytes)); -- above window
		memoryWriteString(getProc(), addressY2, string.rep(string.char(0x90),#addresses.functionMouseY2Bytes)); -- below window
		memoryWriteString(getProc(), addressY3, string.rep(string.char(0x90),#addresses.functionMouseY3Bytes)); -- over window
	end

	-- Unfreeze mouse function
	local function unnopmouse()
		-- x axis
		local addressX1 = addresses.functionMousePatchAddr
		local addressX2 = addresses.functionMousePatchAddr + addresses.mousePatchX2_offset
		local addressX3 = addresses.functionMousePatchAddr + addresses.mousePatchX3_offset
		memoryWriteString(getProc(), addressX1, string.char(unpack(addresses.functionMouseX1Bytes)));
		memoryWriteString(getProc(), addressX2, string.char(unpack(addresses.functionMouseX2Bytes)));
		memoryWriteString(getProc(), addressX3, string.char(unpack(addresses.functionMouseX3Bytes)));

		-- y axis
		local addressY1 = addresses.functionMousePatchAddr + addresses.mousePatchY1_offset
		local addressY2 = addresses.functionMousePatchAddr + addresses.mousePatchY2_offset
		local addressY3 = addresses.functionMousePatchAddr + addresses.mousePatchY3_offset
		memoryWriteString(getProc(), addressY1, string.char(unpack(addresses.functionMouseY1Bytes)));
		memoryWriteString(getProc(), addressY2, string.char(unpack(addresses.functionMouseY2Bytes)));
		memoryWriteString(getProc(), addressY3, string.char(unpack(addresses.functionMouseY3Bytes)));
	end

	local angle = math.atan2(mymob.Z - player.Z, mymob.X - player.X);
	player:faceDirection(angle)
	keyboardHold(settings.hotkeys.MOVE_BACKWARD.key)
player:aimAt(mymob)
	RoMScript("CastSpellByName(\"Piercing Arrow\")")
	player:aimAt(mymob)

	local ww = memoryReadIntPtr(getProc(),addresses.staticbase_char,addresses.windowSizeX_offset)
	local wh = memoryReadIntPtr(getProc(),addresses.staticbase_char,addresses.windowSizeY_offset)
	local clickX = math.ceil(ww/2)
	local clickY = math.ceil(wh/2)
	yrest(50)
	nopmouse()
	yrest(50)
	memoryWriteIntPtr(getProc(),addresses.staticbase_char,addresses.mouseX_offset,clickX)
	memoryWriteIntPtr(getProc(),addresses.staticbase_char,addresses.mouseY_offset,clickY)
	yrest(50)
	RoMScript("SpellTargetUnit()")
	yrest(50)
	-- unfreeze TargetPtr
	unnopmouse()
	keyboardRelease(settings.hotkeys.MOVE_BACKWARD.key)

	-- return false if mob gone or dead
	mymob:update()
	if mymob.Id == 0 or 1 > mymob.HP or not mymob.Alive then
		return true
	end

	return false
end
and changed

Code: Select all

	RoMScript("CastSpellByName(\"Thunderstorm\")")
to

Code: Select all

RoMScript("CastSpellByName(\"Shot\")")
then i used 1 of your waypoints:-

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
   <!-- #  1 --><waypoint x="14237" z="6401" y="12">
mytarget = player:findNearestNameOrId("Stampeding Scealok")
if kiteThunderstorm(mytarget) then player:lootAll() player:sleep() end   </waypoint>
   <!-- #  2 --><waypoint x="14192" z="6444" y="12">if kiteThunderstorm(mytarget) then player:lootAll() player:sleep() end   </waypoint>
   <!-- #  3 --><waypoint x="14132" z="6500" y="13">if kiteThunderstorm(mytarget) then player:lootAll() player:sleep() end   </waypoint>
   <!-- #  4 --><waypoint x="14032" z="6563" y="16">if kiteThunderstorm(mytarget) then player:lootAll() player:sleep() end   </waypoint>
   <!-- #  5 --><waypoint x="13945" z="6619" y="22">if kiteThunderstorm(mytarget) then player:lootAll() player:sleep() end   </waypoint>
   <!-- #  6 --><waypoint x="13865" z="6671" y="26">if kiteThunderstorm(mytarget) then player:lootAll() player:sleep() end   </waypoint>
   <!-- #  7 --><waypoint x="13787" z="6721" y="27">if kiteThunderstorm(mytarget) then player:lootAll() player:sleep() end   </waypoint>
</waypoints>
Walking back is fine when its see the mob but its not firing off shot or targeting the mob. Any idea what i can do thx.

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

Re: Walking back while fireing arrows

#2 Post by rock5 » Wed Nov 20, 2013 10:20 am

That function was set up for Thunderstorm which doesn't need to target the enemy, so it doesn't. You would need to add the command.

Code: Select all

player.target(mymob)
And you don't need any of the code for noping the mouse. So something like this.

Code: Select all

function kiteThunderstorm(mymob)
	if mymob then
		mymob = CPawn(mymob.Address)
	else
		return -- no mob found yet
	end

	-- return true if mob disappeared or dead or false if still alive
	if mymob.Id == 0 or
	1 > mymob.HP or
	not mymob.Alive then
		return true
	end

	player.target(mymob)
	local angle = math.atan2(mymob.Z - player.Z, mymob.X - player.X);
	player:faceDirection(angle)
	keyboardHold(settings.hotkeys.MOVE_BACKWARD.key)
	player:aimAt(mymob)
	RoMScript("CastSpellByName(\"Shot\")")

	keyboardRelease(settings.hotkeys.MOVE_BACKWARD.key)

	-- return false if mob gone or dead
	mymob:update()
	if mymob.Id == 0 or 1 > mymob.HP or not mymob.Alive then
		return true
	end

	return false
end
  • 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

newton666
Posts: 81
Joined: Fri Oct 22, 2010 3:16 pm

Re: Walking back while fireing arrows

#3 Post by newton666 » Wed Nov 20, 2013 11:39 am

still not targeting mobs,dont even see the mobs face on the target . help

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
   <!-- #  1 --><waypoint x="14237" z="6401" y="12">
mytarget = player:findNearestNameOrId("Stampeding Scealok")
if kiteThunderstorm(mytarget) then player:lootAll() player:sleep() end   </waypoint>
   <!-- #  2 --><waypoint x="14192" z="6444" y="12">if kiteThunderstorm(mytarget) then player:lootAll() player:sleep() end   </waypoint>
   <!-- #  3 --><waypoint x="14132" z="6500" y="13">if kiteThunderstorm(mytarget) then player:lootAll() player:sleep() end   </waypoint>
   <!-- #  4 --><waypoint x="14032" z="6563" y="16">if kiteThunderstorm(mytarget) then player:lootAll() player:sleep() end   </waypoint>
   <!-- #  5 --><waypoint x="13945" z="6619" y="22">if kiteThunderstorm(mytarget) then player:lootAll() player:sleep() end   </waypoint>
   <!-- #  6 --><waypoint x="13865" z="6671" y="26">if kiteThunderstorm(mytarget) then player:lootAll() player:sleep() end   </waypoint>
   <!-- #  7 --><waypoint x="13787" z="6721" y="27">if kiteThunderstorm(mytarget) then player:lootAll() player:sleep() end   </waypoint>
</waypoints>
this scripte has travel at the start will this effect it maybe? and if i take travel off , my alt will just run up and attcak the mobs instead of walking backwards and shooting it from long range while moveing ?

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

Re: Walking back while fireing arrows

#4 Post by rock5 » Thu Nov 21, 2013 3:14 am

rock5 wrote:player.target(mymob)
Oops sorry. That's supposed to be

Code: Select all

player:target(mymob)
  • 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

Post Reply

Who is online

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