Rock5's Ancient Treasure

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.
Message
Author
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Rock5's Ancient Treasure

#201 Post by lisa » Fri Jan 25, 2013 4:05 am

assuming we could stop the previous wp code it brings issues to mind.

on the one hand I say loading a new path should force the previous to stop but at the same time how do we know the previous path didn't have important things to finish up, although they should be finished before loading a new path =)
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: Rock5's Ancient Treasure

#202 Post by rock5 » Fri Jan 25, 2013 4:22 am

I don't think it would be good programming practice to force another process to end. If the need arises it probably just means it could be or should be programmed differently. For instance if my code doesn't work we could try doing a check within each problem loop.
  • 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: Rock5's Ancient Treasure

#203 Post by lisa » Fri Jan 25, 2013 4:28 am

rock5 wrote:For instance if my code doesn't work we could try doing a check within each problem loop.
i guess instead of the timer calling the function you could just call the function in each loop, so if you ever die it will probably work.

I wonder though if doing that would still have the same issue, would it still continue with the loops code after reloging? If so then would need a variable like
dead = true
and at the start of each loop
if dead then break end

That would probably cover it.

I just noticed you have a return after every checkRelog()
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: Rock5's Ancient Treasure

#204 Post by rock5 » Fri Jan 25, 2013 4:50 am

lisa wrote:I wonder though if doing that would still have the same issue, would it still continue with the loops code after reloging?
You would unless you exit the current code if it relogs. eg.

Code: Select all

if rezCheck() then return end
lisa wrote:I just noticed you have a return after every checkRelog()
Ah you noticed that did you? :) I had problems until I figured that out. The problem is you can't do that in a function though because it just returns from the function instead of exiting the onload. Which is probably why we might have trouble with the timed event.
  • 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: Rock5's Ancient Treasure

#205 Post by lisa » Fri Jan 25, 2013 5:10 am

After lots of testing and I mean lots I finally tracked down an issue I was having lol

A global value in a waypoint is still a global value even after loading another path, as it should be. *Slaps forehead*

I used a global value in the tests I did and that is why it didn't keep counting because the new WP used the same global which was of course reset to 0, I would expect it to get all messed up after that though but it didn't *shrug*

Anyway, issue with the timer is that the previous WP will leave the onload because of the returns and then error saying no waypoints but if you do it just as a function in the WP and not use timer then it works fine =)
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: Rock5's Ancient Treasure

#206 Post by rock5 » Fri Jan 25, 2013 5:19 am

lisa wrote:I used a global value in the tests I did and that is why it didn't keep counting because the new WP used the same global which was of course reset to 0, I would expect it to get all messed up after that though but it didn't *shrug*
I thought of that and noticed you used local count = 0. Did you change it?
  • 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: Rock5's Ancient Treasure

#207 Post by lisa » Fri Jan 25, 2013 5:40 am

rock5 wrote:I thought of that and noticed you used local count = 0. Did you change it?
Yeah when I am testing things I tend to go a silly I guess, change stuff constantly and see what happens.

Last I was checking went like this

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
local stoppathcoded
function ATdeadcheck()
	if player:exists() then
		player:update()
		if player.MP ~= player.MaxMP then
			print("2 stopping")
			stoppathcoded = true
			ChangeChar()
			waitForLoadingScreen();
			yrest(3000)
			loadProfile()
			loadPaths("1.xml");			
		end
	end
end
local count = 0
while(true) do
	ATdeadcheck()
	if stoppathcoded then return end
	yrest(1000)
	count = count +1
	print(count)
end
</onLoad>
</waypoints>
2 WP very similar and it worked fine if I remembered to define the values as local ;)
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
grande
Posts: 261
Joined: Tue Jun 28, 2011 4:46 pm

Re: Rock5's Ancient Treasure

#208 Post by grande » Fri Jan 25, 2013 6:09 am

Code: Select all

6:2am - ...scripts/rom/userfunctions/userfunction_LoginNextChar.lua:60: attempt
to index local '_table' (a nil value)
Got this while trying to run the AT file from the starting NPC but when the character had already completed the instance. This used to work and just go to the next character after saying something like, "looks like you already did this today"

Here's what the charlist looks like.

Code: Select all

SetCharList({{
   {account=10 , chars= {}},
   },{
   {account=11 , chars= {}},
}})

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

Re: Rock5's Ancient Treasure

#209 Post by lisa » Fri Jan 25, 2013 6:28 am

you've got to many {} going on.

Code: Select all

		CharList = {
			{account=10,chars={}},
			{account=11,chars={}},
		}
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: Rock5's Ancient Treasure

#210 Post by rock5 » Fri Jan 25, 2013 6:56 am

I think what he is doing is specifying 2 lists, for use with 2 clients. I think I added support for that at some stage.

Code: Select all

	--[[ Example
		SetCharList({
			{account=1, chars= {1,2,6}},
			{account=2, chars= {1,3}},
			{account=4, chars= {}},
		})

		Or for groups of accounts
		SetCharList({{
			{account=1, chars= {1,2,6}},
			{account=2, chars= {1,3}},
		},
		{
			{account=4, chars= {}},
		}})
	--]]
  • 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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Rock5's Ancient Treasure

#211 Post by rock5 » Fri Jan 25, 2013 7:12 am

I can't see the error but I noticed you used the SetCharList command differently that I do. Are you using a modified script?
  • 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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Rock5's Ancient Treasure

#212 Post by kenzu38 » Fri Jan 25, 2013 9:37 am

Lol didn't think what I had in mind was actually pretty complicated. Sorry for the bother lisa, and thanks a lot for helping this much. Really appreciate it. :D

So I take it that the one rock5 posted on the previous page is the one I should be testing? Will report problems later when my chars do AT. Thanks for the new waypoint, rock!

Btw, just one question, is there a reason why the chars go up through roof a number of times? Will there be obstacles if you do all the traveling underground?

Thanks.

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

Re: Rock5's Ancient Treasure

#213 Post by rock5 » Fri Jan 25, 2013 9:51 am

The reason it always goes up through the roof is because going through the walls wasn't reliable and I think going down through the floor wasn't possible. The reason it does it a few times is because at first, because of the mound of dirt under 2 of the fragements, it needs to go up into the corridors twice to collect them then it should go under one last time to collect all the candles and other fragments.

Yes test my version. If it has problems then my discussion with Lisa has given me more ideas to try.

Actually I just made a small change to it. Could you download it again please. It is now beta 2.
http://www.solarstrike.net/phpBB3/viewt ... 919#p46919
  • 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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Rock5's Ancient Treasure

#214 Post by kenzu38 » Fri Jan 25, 2013 10:20 am

I see. Reason I asked is that I'm still searching for a counter-measure on the bot thing. So I'm gonna test for other ways of completing AT.

Probably, entering a room first before going up through roof might fix it. Since as far as I've seen, it only activates in one of the starting rooms.

Anyway, thanks for the new file. :) Downloaded it and will report problems later.

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Rock5's Ancient Treasure

#215 Post by kenzu38 » Mon Jan 28, 2013 5:50 pm

Hey, rock. Well, I've tested the new script a good number of times and so far so good. So thanks a lot for updating this waypoint! :D I'm still planning to stress test it though to be really sure all's working as intended.

Anyway, just wanted to ask, if I were to put rezcheck to the other 2 minigames waypoint, do I just have to copy these lines:

Code: Select all

function rezCheck()
	player:update()
	if isInGame() and (1 > player.HP or not player.Alive) then
		-- Make sure they aren't still trying to run off
		keyboardRelease(settings.hotkeys.MOVE_FORWARD.key);
		keyboardRelease(settings.hotkeys.MOVE_BACKWARD.key);
		keyboardRelease(settings.hotkeys.ROTATE_LEFT.key);
		keyboardRelease(settings.hotkeys.ROTATE_RIGHT.key);
		keyboardRelease(settings.hotkeys.STRAFF_LEFT.key);
		keyboardRelease(settings.hotkeys.STRAFF_RIGHT.key);

		RoMScript("PlaySoundByPath('Interface/AddOns/ingamefunctions/threatdetected.wav')")

		cprintf(cli.green, language[104]);  -- try to resurrect in 5 seconds
		rest(5000);

		cprintf(cli.green, language[107]);  -- use the ingame resurrect macro
		RoMScript("UseSelfRevive();");	-- first try self revive
		rest(500);
		RoMScript("BrithRevive();");
		waitForLoadingScreen(30)
		rest(settings.profile.options.WAIT_TIME_AFTER_RES);
		player:update();

		logentry = "Player died."
		checkRelog()
		return
	end
end

registerTimer("rezcheck",2000,rezCheck)
and insert this to checkRelog():

Code: Select all

unregisterTimer("rezcheck")
Is this all I have to add to the 2 other waypoints?

And btw, can you please tell me how to add my char's starting position inside AT to the log file?

Thanks.

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

Re: Rock5's Ancient Treasure

#216 Post by rock5 » Mon Jan 28, 2013 9:38 pm

kenzu38 wrote:Anyway, just wanted to ask, if I were to put rezcheck to the other 2 minigames waypoint, do I just have to copy these lines:
Yes, that should do it.
kenzu38 wrote:And btw, can you please tell me how to add my char's starting position inside AT to the log file?
First you need to record your starting position in variables in the onload. eg.

Code: Select all

startx,startz,starty = player.X, player.Z, player.Y
Then edit one of the logging lines in relog() to include them. eg.

Code: Select all

			file:write("Acc: "..RoMScript("GetAccountName()").."\tName: " ..string.format("%-10s",player.Name ).." \tDate: " .. os.date() .. "\tCoords: " .. string.format("%d,%d,%d",startx,startz,starty)..
  • 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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Rock5's Ancient Treasure

#217 Post by kenzu38 » Tue Jan 29, 2013 1:02 am

Ok, thanks for the code! :) I assume where I place the variables is important?

So is it correct to put...

Code: Select all

startx,startz,starty = player.X, player.Z, player.Y


...before fly() in the code below:

Code: Select all

			if player:target_NPC(ange) then
				yrest(2000);
				sendMacro("ChoiceOption(4);");
				yrest(2000);
				sendMacro("ChoiceOption(1);");
				yrest(1000);
				if not waitForLoadingScreen(10) then
					print("Failed to teleport into Ancient Treasure. Maybe you already done it today.")
					logentry = "Failed to teleport into Ancient Treasure. Maybe you already done it today."
					checkRelog()
					return
				end
			else
				print("Too far from Ange Rasa")
				logentry = "Too far from Ange Rasa"
				checkRelog()
				return
			end
		end
(insert startx,startz,starty = player.X, player.Z, player.Y here?)
		fly()

		if not RoMScript("TimeKeeperFrame:IsVisible()") then -- no timer so click NPC and start it
			if player:target_NPC(luke) then
				yrest(2000);
				sendMacro("ChoiceOption(3);");
				yrest(2000);
				sendMacro("ChoiceOption(1);");
				yrest(5000);
				player:clearTarget()
				UpThroughRoof(1)
			else
				print("Can't find Luke Xavi")
				logentry = "Can't find Luke Xavi"
				checkRelog()
				return
			end
		end
I'm unable to test this myself 'til server resets so I decided to just ask beforehand.

Thanks.

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

Re: Rock5's Ancient Treasure

#218 Post by rock5 » Tue Jan 29, 2013 1:17 am

Ah, you want to record which room you start in. Then, yes, that's a good spot to put it.
  • 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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Rock5's Ancient Treasure

#219 Post by kenzu38 » Tue Jan 29, 2013 9:43 am

Ok, thanks. :) Will try this now. I'll just post here when I encounter problems. Thanks again.

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Rock5's Ancient Treasure

#220 Post by kenzu38 » Wed Jan 30, 2013 10:45 am

Hey rock, thanks for that log entry code, it works! :)

Btw, just a question. I noticed in the AT waypoint, you have something like facedirection or something like that.

Well, I'm currently writing a waypoint that will keybind the actions I want and one of them is to teleport forward, back, left or right depending on where the char is facing. So I want to know if there is a code built-in to the bot that I can use for this or will I have to come up with a formula for this?

Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests