Page 1 of 3

Creating Paths

Posted: Sun Mar 18, 2012 9:44 pm
by Uniden65
Why is it when i create a path for a instance i can get it to auto invite, go into the instance update character but then it jumps to the last waypoint?

also the bot does not even come close to where i made the paths ....its like there off by 10 steps and every time it runs it does not follow the same path , this is becoming very complexed to keep the bot farming in small areas ....any ideas would be very help full please

Re: Creating Paths

Posted: Sun Mar 18, 2012 10:12 pm
by Uniden65
ok this DID NOT worked after going into the instance

__WPL:setWaypointIndex(1);


it moved to a number i dont even have as a way point

Re: Creating Paths

Posted: Sun Mar 18, 2012 11:08 pm
by lisa
the bot isn't very good at small places with close together waypoints, it might sound funny but if you put any code in a waypoint the bot will pause at that waypoint for a split second before continueing, I use this to get around tight small places.

The reason is because the bot is doing calculations with speed and distance travelled to target distance and so on, so if you only take a few steps between 2 waypoints it doesn't have time to actually make those calculations accurately.

As for why your WP is going to different waypoints then you want, no idea. I'd have to see the code to tell you what is wrong with it. Also a copy of the MM print would help aswell.

Re: Creating Paths

Posted: Mon Mar 19, 2012 12:09 am
by rock5
Maybe you have a value set for WAYPOINT_DEVIATION in your profile.

Re: Creating Paths

Posted: Mon Mar 19, 2012 1:34 pm
by Uniden65
thanks for replying is there any way to Pin Point a spot where the Bot will hit every time .....

iam asking becuase iam useing your function from one of your instance waypoints made by : Lisa, M4gm4, and all other tester, i have it run to the spot in front of the instance door then execute your function findzi... works great who ever created it but .if it does NOT hit the same spot every time it, puts the bot in repeat mode looking but throws it off later.



Code: Select all

					function findzi()						
						keyboardHold( settings.hotkeys.MOVE_FORWARD.key )
						yrest(400)						
						keyboardHold( settings.hotkeys.MOVE_FORWARD.key )
						yrest(500)
						keyboardRelease( settings.hotkeys.MOVE_FORWARD.key )
						waitForLoadingScreen(10)
						yrest(500)
						local getinlvl = sendMacro('GetInstanceLevel()')
						if getinlvl == ("easy") then
							zid = 128
						elseif getinlvl == ("normal") then
							zid = 127
						elseif getinlvl == ("hard") then
							zid = RoMScript("GetZoneID()");
							sendMacro('SetInstanceLevel("easy")');
							cprint(cli.blue, "Instance Lvl change to easy\n")
						end

Re: Creating Paths

Posted: Mon Mar 19, 2012 2:31 pm
by BillDoorNZ
just a quick side-note,

I find that its easier to just have the bot target the portal itself, rather than doing a manual move: keyboardHold( settings.hotkeys.MOVE_FORWARD.key ).

Need to test it out more, but if I simply do something like:

Code: Select all

	local portalIn = 110987;
	player:target_NPC(portalIn);
	yrest(2000);
	waitForLoadingScreen(5);
this seems to work pretty well (prolly shouldn't be using target_NPC - was just in a hurry when I wrote that code). I use that bit of code for getting into KS.

Re: Creating Paths

Posted: Mon Mar 19, 2012 2:34 pm
by Uniden65
ok iu would like it for dod ....this 110987 is for ? any portals or just KS

Re: Creating Paths

Posted: Mon Mar 19, 2012 8:14 pm
by BillDoorNZ
I assume just KS...y'd have to check the dod one using the getId thing...I'll take a look at it when I can too tho.

Re: Creating Paths

Posted: Mon Mar 19, 2012 8:24 pm
by BillDoorNZ
to go in (from outside): 112224
leaving (from inside): 110578

Re: Creating Paths

Posted: Mon Mar 19, 2012 8:48 pm
by lisa
is the name of the Id's the same ?

Re: Creating Paths

Posted: Mon Mar 19, 2012 9:07 pm
by BillDoorNZ
yes and no :)

yes, they are the same

no they don't have a name :(

I suspect that player:target_NPC(...) is not the right function to use either. Possible player:moveTo(...) or the like as I am concerned that the bot will try to interact with the portal and not hit the 'waitForLoading...' until after the teleport is complete which will screw with the bot somewhat :(

I already have issues with my own stuff interfering with timing and the player = CPlayer.new() failing (usually when loading the pet (CPawn) for some reason) and imagine that what I am suggesting will cause problems too.

Re: Creating Paths

Posted: Mon Mar 19, 2012 10:20 pm
by lisa
I usually just make sure the coords I use work, never had any issues of not going in portals myself.

If you go with your theory instead of using target I would just get the coords of the object and move to those coords and since the object should have the same coords every single time then I don't see why you can't just make those coords the coords of a waypoint.

Re: Creating Paths

Posted: Tue Mar 20, 2012 12:10 am
by Uniden65
Well it was alot of nice suggestions but neither of them worked ..... Still using your code Lisa

and i could not target the portal so could not get the id from it or location


correction it did work your ids are backwards
thanks alot

Re: Creating Paths

Posted: Tue Mar 20, 2012 12:16 am
by lisa
CDWriter wrote:Still using your code Lisa
I don't recognise that code at all, if I did do it it must have been a year ago or more.

I use this for KS.

Code: Select all

	<!-- # 225 --><waypoint x="-18528" z="12368" tag="enter" type="TRAVEL">
	changeProfileOption("QUICK_TURN", false)
	</waypoint>	
	<!-- # 227 --><waypoint x="-18576" z="12498" type="TRAVEL">
	local ss = os.time()
	repeat
		waitForLoadingScreen(20);
		if getZoneId() == 6 then
			__WPL:setWaypointIndex(__WPL:findWaypointTag("enter"));
		end
	until getZoneId() ~= 6
	yrest(3000)
	</waypoint>
DoD I use

Code: Select all

	<!-- #  3 --><waypoint x="1688" z="-5162" y="759">
	waitForLoadingScreen();
	</waypoint>
and

Code: Select all

	<!-- # 14 --><waypoint x="1696" z="2891" y="445">		
	waitForLoadingScreen();
	yrest(5000)
	SlashCommand("ILG destroy"); 
	yrest(2000)
	SlashCommand("ILG inv"); 
	yrest(1000)
	SlashCommand("ILG inv"); 
	</waypoint>

Re: Creating Paths

Posted: Tue Mar 20, 2012 12:53 am
by Uniden65
well it works great and targets and pulls the character to the spot i added a


keyboardHold( settings.hotkeys.MOVE_FORWARD.key )

after the code so it walks into the portal after it stand in front ....but how do you stop the forward movement in a command ?

bot runs throu last portal and keeps walking till the code catches up to it self and sends it back to path 1

here is my modificatiuoins

Code: Select all

					function findzi()						
						-- keyboardHold( settings.hotkeys.MOVE_FORWARD.key )
						-- yrest(400)						
						-- keyboardHold( settings.hotkeys.MOVE_FORWARD.key )
						-- yrest(500)
						-- keyboardRelease( settings.hotkeys.MOVE_FORWARD.key )
                                                -- Number is portal on the outside
                                                local portalIn = 110578; 
                                                player:target_NPC(portalIn);
                                                yrest(2000);
						keyboardHold( settings.hotkeys.MOVE_FORWARD.key )
						waitForLoadingScreen(10)
						yrest(500)
						local getinlvl = sendMacro('GetInstanceLevel()')
						if getinlvl == ("easy") then
							zid = 128
						elseif getinlvl == ("normal") then
							zid = 127
						elseif getinlvl == ("hard") then
							zid = RoMScript("GetZoneID()");
							sendMacro('SetInstanceLevel("easy")');
							cprint(cli.blue, "Instance Lvl change to easy\n")
						end
					end


					function findzo()						
						-- keyboardHold( settings.hotkeys.MOVE_FORWARD.key )
						-- yrest(400)						
						-- keyboardHold( settings.hotkeys.MOVE_FORWARD.key )
						-- yrest(500)
						-- keyboardRelease( settings.hotkeys.MOVE_FORWARD.key )
                                                -- Number is portal on the inside
                                                local portalIn = 112224; 
                                                player:target_NPC(portalIn);
                                                yrest(2000);
						keyboardHold( settings.hotkeys.MOVE_FORWARD.key )
						waitForLoadingScreen(10)
						yrest(500)
---- I need to add something here to stop it from walking forward after coming out of the portal 
						local getinlvl = sendMacro('GetInstanceLevel()')
						if getinlvl == ("easy") then
							zid = 128
						elseif getinlvl == ("normal") then
							zid = 127
						elseif getinlvl == ("hard") then
							zid = RoMScript("GetZoneID()");
							sendMacro('SetInstanceLevel("easy")');
							cprint(cli.blue, "Instance Lvl change to easy\n")
						end
					end
but after it targets the portal on the exit it keeps walking since i have the move forwward command there ...so how would i stop it on a open
<onLoad> statement

here is the orginal code, i modified it and remove all the fly commands

http://www.solarstrike.net/phpBB3/viewt ... d+instance

I fixed it ...with keyboardPress(key.VK_W) many time after the rest instead of MOVE.FORWARD thanks lisa

Re: Creating Paths

Posted: Tue Mar 20, 2012 1:29 am
by Uniden65
Also i would like to thank u BillDoorNZ for your help ...and how did u get the ids off the portals i cant target them to get it using object id

Re: Creating Paths

Posted: Tue Mar 20, 2012 4:38 am
by BillDoorNZ
i use:

Code: Select all

local function roundIt(_number)
	if _number > (math.floor(_number) + 0.5) then
		return math.ceil(_number);
	else
		return math.floor(_number);
	end
end

function GetObjects()
	local objectList = CObjectList();
	objectList:update();
	local objSize = objectList:size();
	

	local lncolor,obj;
	local s = "";
	
	
	for i = 0,objSize do 
		obj = objectList:getObject(i);
				
		printf("%s%d\t%d\t%d\t%s\t%s\t%s\t%s\t%x\t%d\n",s, roundIt(obj.X), roundIt(obj.Z), roundIt(obj.Y), tostring(obj.Type), obj.Name, tostring(obj.Id), tostring(obj.Attackable), obj.Address, obj.GUID);

	end
end

then i manually call it / run a waypoint that runs this...well..i lie...i have my own customised bot that i control from an external app that tells mm to run that command and captures the output. far too complex for q quick explanation tho.

Re: Creating Paths

Posted: Tue Mar 20, 2012 10:53 am
by Uniden65
So if they change it how would i get them again ? hmmmm i need to find a solution to this because that works 100% to the teleport....

Re: Creating Paths

Posted: Tue Mar 20, 2012 1:00 pm
by BillDoorNZ
As far as I know, they don't change :)

I suspect that the GUID doesnt change either - I maintain a db with all objects that I run across automatically getting added. So far there are no duplicate ID+GUID combinations (other than a couple that slipped in due to poor coding :)

Re: Creating Paths

Posted: Tue Mar 20, 2012 1:06 pm
by Uniden65
if thats the case could i ask u for a big favor and post all the codes IN / Out of every Instance in the game for future use later ?