Using Vehicles

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
dr-nuker
Posts: 145
Joined: Sun Oct 09, 2011 7:33 am

Using Vehicles

#1 Post by dr-nuker » Mon Dec 10, 2012 2:44 pm

Hello folks,

I'm having problems when using catapults with the bot.

The ones I try to utilize are in Rift. These do not use regular action bar, nor extraactionbar. Any Clue how to use slot 1 and 10 of that bar?

Also it is nessecary to aim with the catapult. I don't know how to do this, was hoping for the same way as it is done on thunderstorm. Any ideas?

With the thing to aim like on thunderstorm i would like to understand more generally anyways, because i wanted to make the feed event in silent pass, but i can not ficre out how to use an item and click on the ground next to a mob.

Thanks :)

kkulesza
Posts: 150
Joined: Fri May 27, 2011 9:00 pm
Location: Poland

Re: Using Vehicles

#2 Post by kkulesza » Mon Dec 10, 2012 6:46 pm

dr-nuker wrote:...I'm having problems when using catapults with the bot.The ones I try to utilize are in Rift.
I believe You mean "Catapult Turret" in Bolinthya Rift.
dr-nuker wrote:These do not use regular action bar, nor extraactionbar. Any Clue how to use slot 1 and 10 of that bar?
They do use regular action bar. It is lower action bar. By default it is under key "1". So you can use this code with bot to click it:

Code: Select all

keyboardPress(key.VK_1)
dr-nuker wrote:Also it is nessecary to aim with the catapult. I don't know how to do this, was hoping for the same way as it is done on thunderstorm. Any ideas?
To aim while in catapult you have to hold RightMouseButton. I don't know how to do this in bot. I've found that micromacro has these two functions:

Code: Select all

mouseRHold()
mouseRRelease()
but i couldn't make them work :(
dr-nuker wrote:With the thing to aim like on thunderstorm i would like to understand more generally anyways, because i wanted to make the feed event in silent pass, but i can not ficre out how to use an item and click on the ground next to a mob.

Code: Select all

target=player:findNearestNameOrId("Put the name or ID of your target here")
player:aimAt(target);

Are you trying to make a bot for B.Rift? This seems interesting. Maybe you could share your work and ideas?

dr-nuker
Posts: 145
Joined: Sun Oct 09, 2011 7:33 am

Re: Using Vehicles

#3 Post by dr-nuker » Mon Dec 10, 2012 7:23 pm

kkulesza wrote:

Code: Select all

keyboardPress(key.VK_1)
This is correct and works for Fireing with button 1 but leaving the vehicle is on Slot number 10 which is in fact not 0, but 10. My keyboard does not have a key with number ten and so the bot also fails when trying to prss that key ;) Or I had a typo :&

The problem is that I solo this thing ans so it is elementary to leave the turret when mobs spawn. otherwise they destroy the vehicle extremly fast.
Maybe i can do it with a simulated mouseClick? xD

Another problem is the CountMobs function that I use. I use the new one from the bot and also tried the old userfunction.
Both seem to have the problem, that they also count dead bodies that have not been looted by now. But as I do not want to loot the mobs I need to find a workaround for that aswell.
Otherwise the bot spams aoe-spells until the lootable bodies disappear...

kkulesza
Posts: 150
Joined: Fri May 27, 2011 9:00 pm
Location: Poland

Re: Using Vehicles

#4 Post by kkulesza » Mon Dec 10, 2012 8:11 pm

Are you farming battlefield honor points that way? How many per run? and how many times per hour can you run?

dr-nuker
Posts: 145
Joined: Sun Oct 09, 2011 7:33 am

Re: Using Vehicles

#5 Post by dr-nuker » Mon Dec 10, 2012 8:28 pm

kkulesza wrote:Are you farming battlefield honor points that way? How many per run? and how many times per hour can you run?
It's not worth farming. Just some personal effort to get things automated.

kkulesza
Posts: 150
Joined: Fri May 27, 2011 9:00 pm
Location: Poland

Re: Using Vehicles

#6 Post by kkulesza » Mon Dec 10, 2012 8:54 pm

dr-nuker wrote:This is correct and works for Fireing with button 1 but leaving the vehicle is on Slot number 10 which is in fact not 0, but 10.
...
Maybe i can do it with a simulated mouseClick? xD
Maybe you should check your ingame key bindings for action bars and try all possibilities.
dr-nuker wrote:Another problem is the CountMobs function that I use. I use the new one from the bot and also tried the old userfunction.
Both seem to have the problem, that they also count dead bodies that have not been looted by now. ...
That's strange. countMobs() should count only alive mobs. There is an "if" statment for that purpose:

Code: Select all

if pawn.Alive and pawn.HP >=1 and pawn.Attackable then
Show us your code for calling countMobs() and killingmobs maybe there is a mistake in your code.

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

Re: Using Vehicles

#7 Post by rock5 » Tue Dec 11, 2012 12:35 am

For targeting, once you have the mob, try

Code: Select all

player:aimAt(mob)
Clicking is harder. I should probably add a function to simplify this. I think this is the second time I've had to cut and paste this code.

Code: Select all

	-- 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 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()
  • 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

dr-nuker
Posts: 145
Joined: Sun Oct 09, 2011 7:33 am

Re: Using Vehicles

#8 Post by dr-nuker » Tue Dec 11, 2012 6:05 am

Thanks Rock, i will try your stuff later this day...

here is what i have:

Code: Select all

function KillGate()
printf(player:countMobs(nil, 50).."\n")
printf(CountMobs(nil,50).."\n")

-- Angren Investigator spawnt in distance bevor mobs kommen

player:sleep()
		changeProfileOption("TARGET_LEVELDIF_BELOW", 35);
		-- Kill gate
		player:target_Object("Catapult Construction Point") -- build
		yrest(3000)
		player:target_Object("Catapult Turret") -- enter


                local target = player:findNearestNameOrId("Gate")
                printf(target.Name.."\n")
                player:target(target)
                target = player:getTarget();
                target:update();
                if (target) then
                        if ((target.Name == "Gate")) then
                                while ((target) and (target.HP > 1)) do
					keyboardPress( key.VK_1 );--RoMScript("UseAction(1)") -- shoot
					target:update()
					yrest(100)
					printf(CountMobs(nil,50).."\n")
					if CountMobs(nil,50) > 0 then -- mobs spawned
						player:clearTarget();
						--RoMScript("UseAction(10)") -- leave catapult still false
						--keyboardPress( key.VK_0 );
						while CountMobs(nil,50) > 1 do
							while CountMobs(nil,50) > 1 do
								--player:cast("MAGE_PURGATORY_FIRE");
								keyboardPress( key.VK_5 );
								printf(CountMobs(nil,50).."\n")
							end
							yrest(999)
						end
						player:lootAll(); -- get rid of dead bodies
						if not player:findNearestNameOrId("Catapult Turret") then -- no turrer, need a new one
							player:target_Object("Catapult Construction Point") -- build
							yrest(3000)
						end
						player:target_Object("Catapult Turret") -- enter

						target = player:findNearestNameOrId("Gate")
						if not target then
							break
						end
              					player:target(target)
                				target = player:getTarget();
                				target:update();
					end
				end
			end
		end


		changeProfileOption("TARGET_LEVELDIF_BELOW", 5);

end
Here you see it with the old userfunction. The thing is that i get always a response of "4" when using player:countmobs().
With the old function it correctly has 0 mobs spotted, then when enemies spawn the number increases, which is correct. Then the leaving of the turret fails, since I failed in seleting the leave vehicle button. But if i do manually, the bot starts firing aoe like crazy until all dead mobs disappear. Then it enters the turret and starts fireing again...

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

Re: Using Vehicles

#9 Post by lisa » Tue Dec 11, 2012 7:09 am

maybe it is your usage of the function, the args you use don't seem to match up

Code: Select all

:countMobs(inrange, onlyaggro, idorname)
dr-nuker wrote:player:countMobs(nil, 50)
you have onlyaggro as 50 ??

maybe try

Code: Select all

player:countMobs(50)
the userfunction works because that is the way those args are done

Code: Select all

CountMobs(onlyaggro, inrange)
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

dr-nuker
Posts: 145
Joined: Sun Oct 09, 2011 7:33 am

Re: Using Vehicles

#10 Post by dr-nuker » Tue Dec 11, 2012 11:31 am

Well I found a more reliable way .

So whenever the portal opens there is once mob spawning first. I just check if he spawns and then aoe for 15 seconds. This does the job in a good way.

But still the targeting is unsolved and also the leaving of turret.

Rock I've tried your function but as it seems it is not working for me. at least nothing happens :/

And any idea about the actionbar button number 10? I can not adress it via script and can not find a way to simulate a click on it.

Br
nuker


and Lisa: ofc you're right! But still the values seem to be a bit delayed...

dr-nuker
Posts: 145
Joined: Sun Oct 09, 2011 7:33 am

Re: Using Vehicles

#11 Post by dr-nuker » Wed Dec 12, 2012 8:25 pm

dr-nuker wrote: And any idea about the actionbar button number 10? I can not adress it via script and can not find a way to simulate a click on it.
So this is done now :) The bot does a left mouseclick on the button and that's okay for me.

But... I have a new "problem"...

Usually there is never anyone doing this rift-instance, but yesterday i saw someone inside. So I came up with the idea to take a second character with me, which parts at entrance and checks for other players to enter.
So plan is to let a character park there and shout something in partychat, when a stranger comes in. Is this in general possible without checking the chat at every waypoint? Like setting up a general event? Hint would be nice, thanks

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

Re: Using Vehicles

#12 Post by lisa » Wed Dec 12, 2012 8:43 pm

dr-nuker wrote:So plan is to let a character park there and shout something in partychat, when a stranger comes in. Is this in general possible without checking the chat at every waypoint? Like setting up a general event? Hint would be nice, thanks
monitoring party chat is pretty easy since I added the functions to bot to do it.

start the monitoring with this, in onload preferably.

Code: Select all

eventParty()
Then you can either set up a timer or you can call it in your waypoint as specific locations.

Code: Select all

msg, name = checkEventParty()
you don't need the name arg if you don't want it, assuming it is just u and 1 alt you don't even need to check the msg you can just check it exists.

As for alt sending the message that is easy aswell.

Code: Select all

sendPartyChat("Omg someone is here")
obviously you can change the string to what ever you want 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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Using Vehicles

#13 Post by rock5 » Wed Dec 12, 2012 10:25 pm

dr-nuker wrote:And any idea about the actionbar button number 10? I can not adress it via script and can not find a way to simulate a click on it.
Did you actually try '0'? Because it seems to me that the '1' to '9' keys are bound to the action bar buttons 1-9 and '0' for the tenth button. If the vehicle action bar buttons 1-9 can be used by using the buttons 1-9 then it stands to reason the tenth must be '0'. They may have labeled it '10' to say it's the tenth button but the hotkey should be '0'.
  • 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

dr-nuker
Posts: 145
Joined: Sun Oct 09, 2011 7:33 am

Re: Using Vehicles

#14 Post by dr-nuker » Thu Dec 13, 2012 5:50 am

rock5 wrote:
dr-nuker wrote:And any idea about the actionbar button number 10? I can not adress it via script and can not find a way to simulate a click on it.
Did you actually try '0'? Because it seems to me that the '1' to '9' keys are bound to the action bar buttons 1-9 and '0' for the tenth button. If the vehicle action bar buttons 1-9 can be used by using the buttons 1-9 then it stands to reason the tenth must be '0'. They may have labeled it '10' to say it's the tenth button but the hotkey should be '0'.
Yes sir, I've tried that. Maybe I had a typo or something but the bot was proceeding and went into the "aoe-mode", which he can't use when still in a vehicle. So I guess he tried to leave by pressing "0" and failed.

For now the script is working as long as the Rom-Window is not minimized and mouse is not used by myself, which is okay for me.

I'll now try a different, possibly shorter path trought the game and also try to get the party-thingy working...


Edit: Rock, any idea what i'm doing wrong with your aim at? It does not correctly get the gate into focus but gives no error back.
Actually the right mouse button needs to be hold while moving in the direction of the gate, any idea?

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

Re: Using Vehicles

#15 Post by rock5 » Thu Dec 13, 2012 8:44 am

dr-nuker wrote:Edit: Rock, any idea what i'm doing wrong with your aim at? It does not correctly get the gate into focus but gives no error back.
Actually the right mouse button needs to be hold while moving in the direction of the gate, any idea?
Well, it could be a number of things. It might be because the right mouse button changes the direction you are facing but aimAt only changes the camera view. So you would have to actually turn. We do that with player:faceDirection but I wouldn't be surprised if you already tried that and it didn't work. It might mean you need to turn the vehicle similar to how the bot turns the mount you are on not you. Then again maybe it would work if it considered the vehicle like a mount. But I'm still not sure how you aim. I understand that you use right mouse button and mouse to turn but how do you select where it shoot? I wish I could find an online vid but I didn't.
  • 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

dr-nuker
Posts: 145
Joined: Sun Oct 09, 2011 7:33 am

Re: Using Vehicles

#16 Post by dr-nuker » Thu Dec 13, 2012 9:02 am

rock5 wrote:
dr-nuker wrote:Edit: Rock, any idea what i'm doing wrong with your aim at? It does not correctly get the gate into focus but gives no error back.
Actually the right mouse button needs to be hold while moving in the direction of the gate, any idea?
Well, it could be a number of things. It might be because the right mouse button changes the direction you are facing but aimAt only changes the camera view. So you would have to actually turn. We do that with player:faceDirection but I wouldn't be surprised if you already tried that and it didn't work. It might mean you need to turn the vehicle similar to how the bot turns the mount you are on not you. Then again maybe it would work if it considered the vehicle like a mount. But I'm still not sure how you aim. I understand that you use right mouse button and mouse to turn but how do you select where it shoot? I wish I could find an online vid but I didn't.
It is like the catapults in sardo castle.

So actually you enter the catapult turret and it faces somewhere. Then you need to hold the right mouse button and move the mouse until you're facing the gate. The aiming is done by a little crosshair on the screen. Which is in fact also variing in heigt depending on the angle you target the catapult towards the gate. But i think the last thing does not need to be considered, since when entering the height was always okay, but on the horizontal line the taget was always a bit aside the gate. I could imagine that it is already more than okay to somehow hold the mousebutton and move for a certain angle on the horizontal line, since the turret's cosshair starts always at the same spot for one gate.

I'll try to make some pictures later this evening.

dr-nuker
Posts: 145
Joined: Sun Oct 09, 2011 7:33 am

Re: Using Vehicles

#17 Post by dr-nuker » Thu Dec 13, 2012 3:04 pm

So here are some pictures

this is how it starts when entering
Image


and after moving to a crorrect spot it is:
Image

In general it does not need zto be this specific spot but somewhere on the gate (not on open spots in the gate since the turret can not fire then.)

dr-nuker
Posts: 145
Joined: Sun Oct 09, 2011 7:33 am

Re: Using Vehicles

#18 Post by dr-nuker » Mon Dec 24, 2012 9:45 am

Merry Christmas :D

Now that there are some days off for most of all the folks on this forum... maybe a pro has some time to spend on the still existing problem of moving the camera with holding the mouse-button ;)

I'd give free gingerbread and candycanes to whomever solves my problems ;)

User avatar
lolita
Posts: 139
Joined: Thu Oct 20, 2011 5:39 am
Location: Serbia

Re: Using Vehicles

#19 Post by lolita » Mon Dec 24, 2012 10:24 am

why you want to destroy gate anyway?
why don't you just fly over it? :P
Life is a journey, not destination :D

dr-nuker
Posts: 145
Joined: Sun Oct 09, 2011 7:33 am

Re: Using Vehicles

#20 Post by dr-nuker » Mon Dec 24, 2012 11:14 am

lolita wrote:why you want to destroy gate anyway?
why don't you just fly over it? :P
cause only the first boss spawns without destorying gates ;D

So i kill the first boss and afterwards it is needed to destroy the gates or bosses do not spawn :Z

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest