Ancient Treasures waypoint

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Post Reply
Message
Author
kkulesza
Posts: 150
Joined: Fri May 27, 2011 9:00 pm
Location: Poland

Re: Ancient Treasures waypoint

#81 Post by kkulesza » Wed Jan 04, 2012 6:51 am

kanta wrote:Just a thought. The code that kkulesza posted... Why not just add that into the candle function itself? Something like this?

Code: Select all

	_Elemental = GetIdName(113614)

	function getecandle()
      roomOpen = player:findNearestNameOrId({_Elemental});
      if roomOpen == nil then
			
That makes no sense.
You check if there is a candle and if there is no candle (roomOpen == nil) then you want to light it. Nonsense.

But...
It's true we don't have to check if there are treasure chests. Instead in WP 105 we can use:

Code: Select all

 getcandle();rest(10*1000) --10 seconds to wait untli guards disappear
instead of

Code: Select all

player:target_Object("Elemental Candlestick", 6000);
because getcandle() already checks if there is a candle.
But if there was no candle then 10 second rest is unnecessary.

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

Re: Ancient Treasures waypoint

#82 Post by kkulesza » Wed Jan 04, 2012 7:01 am

rock5 wrote:Also, Is there any way to have it teleport behind the candle with that hard one with the dog and guard?
There is another solution for this hard one.
We can use "hide" skill that is on the first ExtraActionBar button.
It lasts 15 secs i believe and it is enough to light a candle.

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Ancient Treasures waypoint

#83 Post by kanta » Wed Jan 04, 2012 7:03 am

kkulesza, please take it easy on me..... I'm not some coding master.... still very noobish here. Figuring out what I can on my own and with help that people offer (many thanks to Rock5 and Lisa on being patient with me). At least I'm making the attempt to take on a project like this (and not doing too bad I think). So many people don't even try. Just give me some slack here.
Scout/Knight/Rogue 70/66/66

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

Re: Ancient Treasures waypoint

#84 Post by kkulesza » Wed Jan 04, 2012 7:11 am

kanta wrote:kkulesza, please take it easy on me.....
:) ok. Don't take it personaly.
I'm just saying there is a mistake in the code.
I do a lot of mistakes myself :)

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

Re: Ancient Treasures waypoint

#85 Post by rock5 » Wed Jan 04, 2012 7:28 am

If you want to use the hide skill I think you do it like this

Code: Select all

RoMScript("UseExtraAction(1)")
  • 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

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Ancient Treasures waypoint

#86 Post by kanta » Wed Jan 04, 2012 8:13 am

Trying to remember which waypoint that candle is located at.
Scout/Knight/Rogue 70/66/66

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Ancient Treasures waypoint

#87 Post by kanta » Wed Jan 04, 2012 8:40 am

It appears that GetIdName() isn't going to work with this mini game. No matter what I tried I got the following message every time:
[string "..."]:87: attempt to index global 'cecandle' (a nil value)
While searching the forum for a solution I found the command to use in commandline to see what was happening.

Code: Select all

print(RoMScript("GetIdName(114118)"))
I tried all 3 ID's associated with the Elemental Candlesticks and with each one the commandline just seemed to "freeze" while trying to print the name.
Scout/Knight/Rogue 70/66/66

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

Re: Ancient Treasures waypoint

#88 Post by kkulesza » Wed Jan 04, 2012 8:50 am

kanta wrote:Trying to remember which waypoint that candle is located at.
The third candle can be anywhere betwin wp 100-105

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Ancient Treasures waypoint

#89 Post by kanta » Wed Jan 04, 2012 9:16 am

ok... I'm completely lost now.... No matter what I've tried, I keep getting "attempt to index global 'cecandle' (a nil value)". Only two things it might be. First is that I am in the mini game without having started it yet so the candles haven't been spawned and they exist nowhere else in the game so it can't find them. I just removed the door models so I could check the path. Second, and this I dread, I've botched the code somehow and I am unable to figure out what happened.

Just ruled out the first possibility by starting the game and running the bot. Still getting the error. Here's the code. Any input is welcome.

Code: Select all

	_Elemental = GetIdName(113614)
	cecandle = player:findNearestNameOrId(_Elemental)

	function getecandle()
			local lastpllocx = 0
			local lastpllocz = 0
			local lastpllocy = 0
			player:update()
			local dist = distance(cecandle.X,cecandle.Z,player.X,player.Z)
			local lastpllocx = player.X
			local lastpllocz = player.Z
			local lastpllocy = player.Y
			if cecandle and (30 > dist) then
				-- goto ecandle
				teleport(cecandle.X, cecandle.Z)	-- teleport to above ecandle
				yrest(1000)
				teleport(nil, nil, cecandle.Y +25)	-- teleport in range to click ecandle
				yrest(1000)

				-- click ecandle
					player:target_Object(_Elemental, 5000);
					player:update()

				teleport(nil, nil, lastpllocy)
				yrest(500)
				teleport(lastpllocx,lastpllocz)
				yrest(500)
			end
	end
Scout/Knight/Rogue 70/66/66

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Ancient Treasures waypoint

#90 Post by kanta » Wed Jan 04, 2012 9:23 am

kkulesza wrote:
kanta wrote:Trying to remember which waypoint that candle is located at.
The third candle can be anywhere betwin wp 100-105
Sorry, really tired at this point and didn't clarify what I meant. The candle I meant was the one Rock5 mentioned, the one that's close to the dog and knight where I might try to code in the invisibility. After my last test, I'm sure it's waypoint 71.

I'm done for today, only have the one character I can test with.
Scout/Knight/Rogue 70/66/66

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

Re: Ancient Treasures waypoint

#91 Post by lisa » Wed Jan 04, 2012 9:32 am

I'll do some testing, are the files on first post the lates?
I haven't been keeping track of this thread.
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: Ancient Treasures waypoint

#92 Post by rock5 » Wed Jan 04, 2012 10:19 am

kanta wrote:print(RoMScript("GetIdName(114118)"))
GetIdName is a bot function so you would use

Code: Select all

print(GetIdName(114118))
kanta wrote:ok... I'm completely lost now.... No matter what I've tried, I keep getting "attempt to index global 'cecandle' (a nil value)".
Where are you doing

Code: Select all

cecandle = player:findNearestNameOrId(_Elemental)
I assume you are doing it at the waypoint where you expect to find the Elemental Candlestick? Are you sure you aren't declaring "cecandle" or "_Elemental" local anywhere?
  • 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

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

Re: Ancient Treasures waypoint

#93 Post by lisa » Wed Jan 04, 2012 10:51 am

I did this print from inside, hope it helps.
Id and Name

Code: Select all

113622 Luke Xavi
101699 Ghost Soldier
114079 Purifying Candlestick
114118 Elemental Candlestick
114079 Purifying Candlestick
114117 Elemental Candlestick
114081 Cave Ghost
114081 Cave Ghost
114081 Cave Ghost
113622 Luke Xavi
113616 Box of Destiny
113616 Box of Destiny
113616 Box of Destiny
114081 Cave Ghost
114081 Cave Ghost
113616 Box of Destiny
113616 Box of Destiny
114080 Ancient Stone Totem
114080 Ancient Stone Totem
114080 Ancient Stone Totem
101700 Ghost Archer
113614 Elemental Candlestick
101700 Ghost Archer
101699 Ghost Soldier
101699 Ghost Soldier
114081 Cave Ghost
101702 Ghost Cavalier Commander
114079 Purifying Candlestick
114081 Cave Ghost
101701 Ghost Guard Dog
101701 Ghost Guard Dog
I also noticed with the candle collecting that there is a bit change between collected and not collected.

Code: Select all

Bits,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,0,0,1,Elemental Candlestick collected
Bits,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,0,0,1,Elemental Candlestick not collected
You could just check by the buff you get but using this could determine which has been collected and which hasn't. May not be needed though. It is along the same lines as the chest check I did for survival except with the tiles it was bit 0x8 and this is using bit 0x200.

Code: Select all

function clickcandle(address)
	local tmp = memoryReadRepeat("int", getProc(), address + addresses.pawnAttackable_offset) or 0;
	if bitAnd(tmp,0x200) then
		return true
	else
		return false
	end
end
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: Ancient Treasures waypoint

#94 Post by rock5 » Wed Jan 04, 2012 10:59 am

You should probably mention you can use that function as an evaluation function eg.

Code: Select all

cecandle = player:findNearestNameOrId(_Elemental,nil,clickcandle)
So it only targets clickable candles.

Except I think it needs to be the other way around. Where it returns false it should return true and where it returns true it should return false. I think.
  • 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

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

Re: Ancient Treasures waypoint

#95 Post by lisa » Wed Jan 04, 2012 11:07 am

yeah you are right, in this case it would be the other way around.

Code: Select all

function clickcandle(address)
   local tmp = memoryReadRepeat("int", getProc(), address + addresses.pawnAttackable_offset) or 0;
   if bitAnd(tmp,0x200) then
      return false
   else
      return true
   end
end
rock5 wrote:You should probably mention you can use that function as an evaluation function eg.
i figured kanta would check out the code in survival and copy it anyway, he is good at using what already exists to do what he wants ;)
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

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Ancient Treasures waypoint

#96 Post by kanta » Wed Jan 04, 2012 3:17 pm

Yup, I'm a code scavenger :D

I'll post what I have been working on here, I'd rather not put it in the first post. Don't need people getting confused, downloading it then telling me it isn't working properly.
Attachments
mini_treasure_test.xml
This file is not functional at this time. It is being uploaded for a bug that needs to be found. Please refer to the first post of this thread for the currently stable release.
(16.87 KiB) Downloaded 118 times
Scout/Knight/Rogue 70/66/66

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

Re: Ancient Treasures waypoint

#97 Post by rock5 » Wed Jan 04, 2012 8:59 pm

So what's wrong with this version?
  • 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

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: Ancient Treasures waypoint

#98 Post by kuripot » Thu Jan 05, 2012 6:55 am

what is this means???


an error after finish AT this is my wp


i have some edit from from previous thread including

Code: Select all

	<!-- # 72b --><waypoint x="3624" z="3666" y="92">  </waypoint>

Code: Select all

	<!-- # 84 b--><waypoint x="4087" z="3589" y="92">	</waypoint>

Code: Select all

	<!-- #105 --><waypoint x="4021" z="3944" y="34">
	      roomOpenA=player:findNearestNameOrId(113617);
	      roomOpenB=player:findNearestNameOrId(113619);
	      if roomOpenA==nil and roomOpenB==nil then
	         getcandle();rest(10*1000) --10 seconds to wait untli guards disappear
	      end
	      flyoff();
	</waypoint>

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
	
	--=== V 0.4 ===--

	--=== Many thanks to Rock5 and Lisa for their assistance and existing code
	--=== Without their help and patience, this script would not be possible
	--=== Thank you to those who have given me input on ideas for the script
		
	--=== User Options ===--
	
	getcmount = 1 -- "0" do not collect mount chests "1" collect mount chests
	gettotems = 1 -- "0" do not collect totems "1" collect totems
								-- (don't know why people would want this but adding the option anyway)
	exitat = 1  -- Until a check for all chests are opened use this option to set if
							-- you want the bot to exit the mini game "0" do not exit "1" exit

	When_Finished = "at to cot"
		-- "end" to end script, "relog" to log next character and "waypointfilename" to load that waypointfile.

	CharList = {}
		-- Character list to use when using the "charlist" option above. Requires Rock5's "userfunction_LoginNextChar" userfunction.
		-- Find it here. http://www.solarstrike.net/phpBB3/viewtopic.php?p=10350
		--		eg.
		--		CharList = {
		--			{account=4,chars={}},
		--			{account=8,chars={1}},
		--			{account=7,chars={1,2,5}},
		--		}
	
	--====================--
	
  changeProfileOption("MAX_TARGET_DIST", 60);
	ecandle = player:findNearestNameOrId(114117)

	--=== Code for When_Finished ===--

	function checkRelog()
		-- Log result
		local filename = getExecutionPath() .. "/logs/cot.log";
		local file, err = io.open(filename, "a+");
		if file then
			file:write("Account: "..RoMScript("GetAccountName()").."\tName: " ..string.format("%-10s",player.Name ).." \tDate: " .. os.date() ..
			" \tShells gained/total: "..inventory:getItemCount(240181) - numshells.."/".. inventory:getItemCount(240181).. "\t" ..logentry .. "\n")
			file:close();
		end

		if When_Finished == "relog" then
			sendMacro("}LoginNextToon=true;a={")
			sendMacro("Logout();");
			waitForLoadingScreen();
			loadPaths("cot_tele");
		elseif When_Finished == "charlist" then
			SetCharList(CharList)
			LoginNextChar()
			loadprofile()
			loadPaths("cot_tele");
		elseif When_Finished == "end" then
			error("Ending script",2)
		else
			if not string.find(When_Finished,".", 1, true) then
				When_Finished = When_Finished .. ".xml"
			end
			local filename = getExecutionPath() .. "/waypoints/" .. When_Finished
			local file, err = io.open(filename, "r");
			if file then
				file:close();
				loadPaths(When_Finished)
			else
				error("'When_Finished' option is invalid",0)
			end
		end
	end

	--=== Code to disable all profile skills ===--

	for k,v in pairs(settings.profile.skills) do
	      v.AutoUse = false
	end

	--=== Code to collect Elemental candles ===--

	function getecandle()
			local lastpllocx = 0
			local lastpllocz = 0
			local lastpllocy = 0
			player:update()
			local cecandle = player:findNearestNameOrId("Elemental Candlestick")
			local dist = distance(cecandle.X,cecandle.Z,player.X,player.Z)
			local lastpllocx = player.X
			local lastpllocz = player.Z
			local lastpllocy = player.Y
			if cecandle and (100 > dist) then
				-- goto ecandle
				teleport_SetStepSize(40)
				teleport(cecandle.X, cecandle.Z)	-- teleport to above ecandle
				teleport(cecandle.X + 1, cecandle.Z, cecandle.Y +15)	-- teleport in range to click ecandle

				-- click ecandle
				player:target(cecandle)
					rest(100)
               				repeat
                				player:target_Object("Elemental Candlestick", 6000);
                  				player:update()
					until not player.Casting

				teleport(lastpllocx,lastpllocz,lastpllocy)
			end
	end
	
	--====================--

	local zoneid = RoMScript("GetZoneID()")
	if math.mod(zoneid,1000) == 10 then
		player:target_NPC("Ange Rasa");
		yrest(2000)
		CompleteQuestByName("Proceed to the Scar of Despair Camp");
		yrest(2000);
		player:target_NPC("Ange Rasa");
		yrest(2000)
		sendMacro("ChoiceOption(4);");
		yrest(2000)
		sendMacro("ChoiceOption(1);");
		yrest(2000)
		waitForLoadingScreen();
	end
	__WPL:setWaypointIndex(__WPL:getNearestWaypoint(player.X,player.Z))
</onLoad>
	<!-- #  1 --><waypoint x="3406" z="3588" y="34" tag="SWstart">
	fly()
		player:target_NPC("Luke Xavi");
		yrest(2000);
		sendMacro("ChoiceOption(3);");
		yrest(3000);
		sendMacro("ChoiceOption(1);");
		yrest(5000);
		teleportToWP()
	</waypoint>
	<!-- #  2 --><waypoint x="3476" z="3624" y="74">	</waypoint>
	<!-- #  3 --><waypoint x="3526" z="3653" y="74">
		teleportToWP()
	</waypoint>
	<!-- #  4 --><waypoint x="3550" z="3668" y="92">	</waypoint>
	<!-- #  5 --><waypoint x="3599" z="3581" y="92">	</waypoint>
	<!-- #  6 --><waypoint x="3662" z="3617" y="92">	</waypoint>
	<!-- #  7 --><waypoint x="3593" z="3752" y="92">	</waypoint>
	<!-- #  8 --><waypoint x="3627" z="3983" y="92">	</waypoint>
	<!-- #  9 --><waypoint x="3706" z="4114" y="92">
		teleportToWP()
	</waypoint>
	<!-- # 10 --><waypoint x="3705" z="4126" y="74">	</waypoint>
	<!-- # 11 --><waypoint x="3705" z="4185" y="74">	</waypoint>
	<!-- # 12 --><waypoint x="3648" z="4206" y="34">
		__WPL:setWaypointIndex(__WPL:findWaypointTag("commonstart"));
	</waypoint>
	<!-- # 13 --><waypoint x="3835" z="4327" y="34" tag="Nstart">
	fly()
		player:target_NPC("Luke Xavi");
		yrest(2000);
		sendMacro("ChoiceOption(3);");
		yrest(2000);
		sendMacro("ChoiceOption(1);");
		yrest(5000);
		teleportToWP()
	</waypoint>
	<!-- # 14 --><waypoint x="3835" z="4248" y="74">	</waypoint>
	<!-- # 15 --><waypoint x="3835" z="4181" y="74">	</waypoint>
	<!-- # 16 --><waypoint x="3645" z="4206" y="34">
		__WPL:setWaypointIndex(__WPL:findWaypointTag("commonstart"));
	</waypoint>
	<!-- # 17 --><waypoint x="4271" z="4086" y="34" tag="NEstart">
	fly()
		player:target_NPC("Luke Xavi");
		yrest(2000);
		sendMacro("ChoiceOption(3);");
		yrest(2000);
		sendMacro("ChoiceOption(1);");
		yrest(5000);
		teleportToWP()
	</waypoint>
	<!-- # 18 --><waypoint x="4201" z="4044" y="74">	</waypoint>
	<!-- # 19 --><waypoint x="4157" z="4019" y="74">
		teleportToWP()
	</waypoint>
	<!-- # 20 --><waypoint x="4142" z="4046" y="92">	</waypoint>
	<!-- # 21 --><waypoint x="4032" z="4200" y="92">	</waypoint>
	<!-- # 22 --><waypoint x="3714" z="4197" y="92">	</waypoint>
	<!-- # 23 --><waypoint x="3648" z="4206" y="34">
		__WPL:setWaypointIndex(__WPL:findWaypointTag("commonstart"));
	</waypoint>
	<!-- # 24 --><waypoint x="3416" z="4079" y="34" tag="NWstart">
	fly()
		player:target_NPC("Luke Xavi");
		yrest(2000);
		sendMacro("ChoiceOption(3);");
		yrest(2000);
		sendMacro("ChoiceOption(1);");
		yrest(5000);
		teleportToWP()
	</waypoint>
	<!-- # 25 --><waypoint x="3476" z="4044" y="74">	</waypoint>
	<!-- # 26 --><waypoint x="3529" z="4013" y="74">
		teleportToWP()
	</waypoint>
	<!-- # 27 --><waypoint x="3595" z="4086" y="92">	</waypoint>
	<!-- # 28 --><waypoint x="3676" z="4046" y="92">	</waypoint>
	<!-- # 29 --><waypoint x="3705" z="4113" y="92">
		teleportToWP()
	</waypoint>
	<!-- # 30 --><waypoint x="3705" z="4119" y="72">	</waypoint>
	<!-- # 31 --><waypoint x="3703" z="4187" y="72">	</waypoint>
	<!-- # 32 --><waypoint x="3647" z="4208" y="34">
		__WPL:setWaypointIndex(__WPL:findWaypointTag("commonstart"));
	</waypoint>
	<!-- # 33 --><waypoint x="3847" z="3347" y="34" tag="Sstart">
	fly()
		player:target_NPC("Luke Xavi");
		yrest(2000);
		sendMacro("ChoiceOption(3);");
		yrest(2000);
		sendMacro("ChoiceOption(1);");
		yrest(5000);
		teleportToWP()
	</waypoint>
	<!-- # 34 --><waypoint x="3848" z="3419" y="74">	</waypoint>
	<!-- # 35 --><waypoint x="3849" z="3467" y="74">
		teleportToWP()
	</waypoint>
	<!-- # 36 --><waypoint x="3977" z="3498" y="74">	</waypoint>
	<!-- # 37 --><waypoint x="3979" z="3553" y="74">	</waypoint>
	<!-- # 38 --><waypoint x="4004" z="3574" y="74">
		teleportToWP()
	</waypoint>
	<!-- # 39 --><waypoint x="4098" z="3754" y="92">	</waypoint>
	<!-- # 40 --><waypoint x="4068" z="3970" y="92">	</waypoint>
	<!-- # 41 --><waypoint x="4031" z="4038" y="92">	</waypoint>
	<!-- # 42 --><waypoint x="4085" z="4104" y="92">	</waypoint>
	<!-- # 43 --><waypoint x="4046" z="4176" y="92">	</waypoint>
	<!-- # 44 --><waypoint x="3736" z="4195" y="92">	</waypoint>
	<!-- # 45 --><waypoint x="3648" z="4209" y="34">
		__WPL:setWaypointIndex(__WPL:findWaypointTag("commonstart"));
	</waypoint>
	<!-- # 46 --><waypoint x="4261" z="3592" y="34" tag="SEstart">
	fly()
		player:target_NPC("Luke Xavi");
		yrest(2000);
		sendMacro("ChoiceOption(3);");
		yrest(2000);
		sendMacro("ChoiceOption(1);");
		yrest(5000);
		teleportToWP()
	</waypoint>
	<!-- # 47 --><waypoint x="4210" z="3619" y="74">	</waypoint>
	<!-- # 48 --><waypoint x="4159" z="3648" y="74">
		teleportToWP()
	</waypoint>
	<!-- # 49 --><waypoint x="4081" z="3589" y="92">	</waypoint>
	<!-- # 50 --><waypoint x="4017" z="3626" y="92">	</waypoint>
	<!-- # 51 --><waypoint x="4103" z="3767" y="92">	</waypoint>
	<!-- # 52 --><waypoint x="4076" z="3952" y="92">	</waypoint>
	<!-- # 53 --><waypoint x="4019" z="4043" y="92">	</waypoint>
	<!-- # 54 --><waypoint x="4103" z="4100" y="92">	</waypoint>
	<!-- # 55 --><waypoint x="4044" z="4170" y="92">	</waypoint>
	<!-- # 56 --><waypoint x="3762" z="4189" y="92">	</waypoint>
	<!-- # 57 --><waypoint x="3645" z="4208" y="34">
		__WPL:setWaypointIndex(__WPL:findWaypointTag("commonstart"));
	</waypoint>
	<!-- # 58 --><waypoint x="3643" z="4215" y="34" tag="commonstart">
		if gettotems == 1 then
			player:target_Object(114080, 6000);
		end
		teleportToWP()
	</waypoint>
	<!-- # 59 --><waypoint x="3704" z="4159" y="74">	</waypoint>
	<!-- # 60 --><waypoint x="3704" z="4122" y="74">
		teleportToWP()
	</waypoint>
	<!-- # 61 --><waypoint x="3736" z="4118" y="92">	</waypoint>
	<!-- # 62 --><waypoint x="3830" z="4094" y="92">
		getecandle()
	</waypoint>		<!-- check/get candle -->
	<!-- # 63 --><waypoint x="3676" z="4124" y="92">
		getecandle()
	</waypoint> <!-- actual coords -->
	<!-- # 64 --><waypoint x="3643" z="4057" y="92">	</waypoint>
	<!-- # 65 --><waypoint x="3595" z="4094" y="92">
		teleportToWP()
	</waypoint>
	<!-- # 66 --><waypoint x="3609" z="4181" y="34">
		teleportToWP()
	</waypoint>
	<!-- # 67 --><waypoint x="3610" z="4188" y="34">
		if gettotems == 1 then
			player:target_Object(114080, 6000);
		end
		teleportToWP()
	</waypoint>
	<!-- # 68 --><waypoint x="3591" z="4093" y="92">	</waypoint>
	<!-- # 69 --><waypoint x="3686" z="4022" y="92">	</waypoint>
	<!-- # 70 --><waypoint x="3572" z="3929" y="92">	</waypoint>
	<!-- # 71 --><waypoint x="3506" z="3836" y="92">
		getecandle()
	</waypoint>		<!-- check/get candle -->
	<!-- # 72 --><waypoint x="3681" z="3549" y="92">
		getecandle()
	</waypoint>
	<!-- # 72b --><waypoint x="3624" z="3666" y="92">
	</waypoint>
				<!-- actual coords -->
	<!-- # 73 --><waypoint x="3827" z="3577" y="92">
		getecandle()
	</waypoint>		<!-- check/get candle -->
	<!-- # 74 --><waypoint x="3662" z="3621" y="92">	</waypoint>
	<!-- # 75 --><waypoint x="3584" z="3574" y="92">	</waypoint>
	<!-- # 76 --><waypoint x="3632" z="3493" y="92">	</waypoint>
	<!-- # 77 --><waypoint x="3948" z="3488" y="92">
		teleportToWP()
	</waypoint>
	<!-- # 78 --><waypoint x="3981" z="3449" y="34">
		if gettotems == 1 then
			player:target_Object(114080, 6000);
		end
		teleportToWP()
	</waypoint>
	<!-- # 79 --><waypoint x="3978" z="3499" y="74">	</waypoint>
	<!-- # 80 --><waypoint x="3979" z="3547" y="74">	</waypoint>
	<!-- # 81 --><waypoint x="3948" z="3559" y="92">	</waypoint>
	<!-- # 82 --><waypoint x="3840" z="3573" y="92">
		getecandle()
	</waypoint>		<!-- check/get candle -->
	<!-- # 83 --><waypoint x="4012" z="3551" y="92">
		getecandle()
	</waypoint>		<!-- check/get candle -->
	<!-- # 84 --><waypoint x="4036" z="3616" y="92">	</waypoint>
	<!-- # 84 b--><waypoint x="4087" z="3589" y="92">	</waypoint>
	<!-- # 85 --><waypoint x="4089" z="3585" y="92">	</waypoint>
	<!-- # 86 --><waypoint x="4102" z="3527" y="92">
		teleportToWP()
	</waypoint>
	<!-- # 87 --><waypoint x="4110" z="3525" y="34">
		if gettotems == 1 then
			player:target_Object(114080, 6000);
		end
		teleportToWP()
	</waypoint>
	<!-- # 88 --><waypoint x="4077" z="3588" y="92">	</waypoint>
	<!-- # 89 --><waypoint x="4031" z="3626" y="92">	</waypoint>
	<!-- # 90 --><waypoint x="4111" z="3805" y="92">	</waypoint>
	<!-- # 91 --><waypoint x="4169" z="3837" y="92">
		getecandle()
	</waypoint> <!-- actual coords -->
	<!-- # 92 --><waypoint x="3984" z="4074" y="92">	</waypoint>
	<!-- # 93 --><waypoint x="4007" z="4128" y="92">
		getecandle()
	</waypoint>		<!-- check/get candle -->
	<!-- # 94 --><waypoint x="3873" z="4097" y="92">
		getecandle()
	</waypoint> <!-- actual coords -->
	<!-- # 95 --><waypoint x="4070" z="3970" y="92">	</waypoint>
	<!-- # 96 --><waypoint x="4081" z="3821" y="92">
		teleportToWP()
	</waypoint>
	<!-- # 97 --><waypoint x="4047" z="3813" y="75">	</waypoint>
	<!-- # 98 --><waypoint x="4013" z="3812" y="75">
		teleportToWP()
	</waypoint>
	<!-- # 99 --><waypoint x="3972" z="3800" y="92">	</waypoint>
	<!-- #100 --><waypoint x="3835" z="3629" y="92">
		getecandle()
	</waypoint> <!-- actual coords -->
	<!-- #101 --><waypoint x="3657" z="3728" y="92">
		getecandle()
	</waypoint>		<!-- check/get candle -->
	<!-- #102 --><waypoint x="3711" z="3897" y="92">	</waypoint>
	<!-- #103 --><waypoint x="3847" z="4029" y="92">
		getecandle()
	</waypoint> <!-- actual coords -->
	<!-- #104 --><waypoint x="4021" z="3944" y="92">
		teleportToWP()
	</waypoint>
	<!-- #105 --><waypoint x="4021" z="3944" y="34">
	      roomOpenA=player:findNearestNameOrId(113617);
	      roomOpenB=player:findNearestNameOrId(113619);
	      if roomOpenA==nil and roomOpenB==nil then
	         getcandle();rest(10*1000) --10 seconds to wait untli guards disappear
	      end
	      flyoff();
	</waypoint>		<!-- check/get candle then wait 15 seconds -->
	<!-- #106 --><waypoint x="3964" z="3845" y="34">	</waypoint>
	<!-- #107 --><waypoint x="3911" z="3749" y="34">	</waypoint>
	<!-- #108 --><waypoint x="3751" z="3742" y="34">	</waypoint>
	<!-- #109 --><waypoint x="3714" z="3845" y="34">	</waypoint>
	<!-- #110 --><waypoint x="3780" z="3800" y="34">
	      if gettotems == 1 then
	         player:target_Object(114080, 6000);
	      end
	</waypoint>
	<!-- #111 --><waypoint x="3699" z="3802" y="34">	</waypoint>
	<!-- #112 --><waypoint x="3773" z="3945" y="34">	</waypoint>
	<!-- #113 --><waypoint x="3840" z="3945" y="34">	</waypoint>
	<!-- #114 --><waypoint x="3842" z="3838" y="49">
			--=== Create table for material chests ===--
			chests = {left = {}, right = {}}

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

			for i = 0,objSize do
				local obj = objectList:getObject(i);
				if obj.Id == 113617 then
					if obj.X > 3878 then -- left side
						table.insert(chests.left, table.copy(obj))
					else -- right side
						table.insert(chests.right, table.copy(obj))
					end
				end
			end

			-- Sort chests
			table.sort(chests.left, function(a,b) return b.Z > a.Z end)
			table.sort(chests.right, function(a,b) return a.Z > b.Z end)

			-- Get left side
			for k,v in pairs(chests.left) do
				player:target(v.Address);
				Attack()
				yrest(2000)
				Attack()
				yrest(2000)
				repeat
					yrest(2000)
					player:update()
				until not player.Casting
			end

			-- Get right side
			for k,v in pairs(chests.right) do
				player:target(v.Address);
				Attack()
				yrest(2000)
				Attack()
				yrest(2000)
				repeat
					yrest(2000)
					player:update()
				until not player.Casting
			end
	</waypoint>
	<!-- #115 --><waypoint x="3842" z="3838" y="49">
			--=== Create table for rune and mount chests ===--
			chests = {runes = {}, mount = {}}

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

			for i = 0,objSize do
				local obj = objectList:getObject(i);
				if obj.Id == 113618 or obj.Id == 113619 then
					if obj.Z > 3825 then -- mount
						table.insert(chests.mount, table.copy(obj))
					else -- runes
						table.insert(chests.runes, table.copy(obj))
					end
				end
			end

			-- Sort chests
			table.sort(chests.mount, function(a,b) return b.X > a.X end)
			table.sort(chests.runes, function(a,b) return a.X > b.X end)

			-- Get mount
			if getcmount == 1 then
				for k,v in pairs(chests.mount) do
					player:target(v.Address);
					Attack()
					yrest(2000)
					Attack()
					yrest(2000)
					repeat
						yrest(2000)
						player:update()
					until not player.Casting
				end
			end

			-- Get runes
			for k,v in pairs(chests.runes) do
				player:target(v.Address);
				Attack()
				yrest(2000)
				Attack()
				yrest(2000)
				repeat
					yrest(2000)
					player:update()
				until not player.Casting
			end
	</waypoint>
	<!-- #115 --><waypoint x="3842" z="3838" y="49">
		if exitat == 1 then
			player:target_Object("Transport Candlestick");
			RoMScript("StaticPopup_OnClick(StaticPopup1, 1);")
			waitForLoadingScreen();
			checkRelog()
		else
			error("Bot finished", 0);
		end
			
	</waypoint>
</waypoints>

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
	<!-- #  1 --><waypoint x="-35786" z="5435" y="163">
	player:mount("Horse");	</waypoint>
	<!-- #  2 --><waypoint x="-35720" z="5337" y="149">	</waypoint>
	<!-- #  3 --><waypoint x="-35778" z="5192" y="160">	</waypoint>
	<!-- #  4 --><waypoint x="-35857" z="5107" y="179">	</waypoint>
	<!-- #  5 --><waypoint x="-35940" z="5020" y="173">	</waypoint>
	<!-- #  6 --><waypoint x="-36068" z="4929" y="175">	</waypoint>
	<!-- #  7 --><waypoint x="-36335" z="4752" y="160">	</waypoint>
	<!-- #  8 --><waypoint x="-36419" z="4651" y="159">	</waypoint>
	<!-- #  9 --><waypoint x="-36457" z="4527" y="159">	</waypoint>
	<!-- # 10 --><waypoint x="-36455" z="4354" y="120">	</waypoint>
	<!-- # 11 --><waypoint x="-36430" z="4107" y="26">	</waypoint>
	<!-- # 12 --><waypoint x="-36603" z="4010" y="5">	</waypoint>
	<!-- # 13 --><waypoint x="-36772" z="3769" y="-3">	</waypoint>
	<!-- # 14 --><waypoint x="-36913" z="3530" y="-12">	</waypoint>
	<!-- # 15 --><waypoint x="-36989" z="3250" y="-38">	</waypoint>
	<!-- # 16 --><waypoint x="-37154" z="2896" y="-69">	</waypoint>
	<!-- # 17 --><waypoint x="-37349" z="2736" y="-51">	</waypoint>
	<!-- # 18 --><waypoint x="-37554" z="2534" y="-39">	</waypoint>
	<!-- # 19 --><waypoint x="-37713" z="2262" y="-26">	</waypoint>
	<!-- # 20 --><waypoint x="-37773" z="2061" y="-18">	</waypoint>
	<!-- # 21 --><waypoint x="-37986" z="1775" y="27">	</waypoint>
	<!-- # 22 --><waypoint x="-38219" z="1517" y="30">	</waypoint>
	<!-- # 23 --><waypoint x="-38441" z="1394" y="11">	</waypoint>
	<!-- # 24 --><waypoint x="-38653" z="1289" y="-12">	</waypoint>
	<!-- # 25 --><waypoint x="-38687" z="1504" y="6">	</waypoint>
	<!-- # 26 --><waypoint x="-38723" z="1542" y="15">	</waypoint>
	<!-- # 27 --><waypoint x="-38723" z="1542" y="15">
player:target_NPC(111256); 
sendMacro("ChoiceOption(3)"); 
waitForLoadingScreen();
</waypoint>
	<!-- # 28 --><waypoint x="-20462" z="6503" y="-174">	</waypoint>
	<!-- # 29 --><waypoint x="-20462" z="6503" y="-174">
player:target_NPC(111256); 
sendMacro("ChoiceOption(3)"); 
waitForLoadingScreen();
</waypoint>
	<!-- # 30 --><waypoint x="2295" z="1154" y="14">	</waypoint>
	<!-- # 31 --><waypoint x="2520" z="1068" y="50">	</waypoint>
	<!-- # 32 --><waypoint x="2759" z="970" y="69">	</waypoint>
	<!-- # 33 --><waypoint x="2759" z="970" y="69">
player:target_NPC(110755); 
sendMacro("ChoiceOption(2)"); 
waitForLoadingScreen();
</waypoint>
	<!-- # 11 --><waypoint x="4745" z="-1968" y="115">	</waypoint>
	<!-- # 12 --><waypoint x="4854" z="-1979" y="115">	</waypoint>
	<!-- # 13 --><waypoint x="4860" z="-1952" y="109">
loadPaths("cot_tele");	
</waypoint>
</waypoints>

this error after teleport outside mini treasure
Attachments
after at.JPG

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

Re: Ancient Treasures waypoint

#99 Post by rock5 » Thu Jan 05, 2012 9:10 am

The line with "numshells" was copied from somewhere else but in this case it hasn't been given any value. I think it's supposed to hold the number of shells you started with at the beginning of the game.
  • 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

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Ancient Treasures waypoint

#100 Post by kanta » Thu Jan 05, 2012 10:09 am

Seems the numshells is in the code from the checkRelog function I copied from your cot script Rock. I didn't think to check for the extra code, just wanted to add the relog function if people wanted to use it.

The file I just posted I keep getting "attempt to index global 'cecandle' (a nil value)" errors and I can't figure out why. I mentioned this problem a few posts up. Lisa asked if the file had been posted, which it hadn't, so I posted it.

I guess I'll just go back to the previous version that worked and start my modifications from the beginning.

**EDIT**
Ok... I don't understand this... I went back to my original 0.4 version to start over and I'm still getting that error message.... All I can think of is my MM or rom files have been corrupted somehow... gonna reinstall and see what happens....

Well, that didn't work. I really do not understand what's going on. A couple days ago version 0.4 was working fine on my computer. Now I just keep getting that error no matter what I do. So... until I can figure out what's going on with my MM, I can no longer update this script.... If someone else wants to take up the task while I try to figure out what's wrong, feel free. I'll update first post with your file and give you full credit.

MM 1.02 b1 r22
bot 3.29 r 688
updated, reverted, everything I could think of to do.
Last edited by kanta on Thu Jan 05, 2012 11:00 am, edited 3 times in total.
Scout/Knight/Rogue 70/66/66

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests