Page 1 of 2

Lyliya's Magic House New mini game

Posted: Thu Sep 12, 2013 3:17 am
by vernberg
there is a new minigame is runes of magic and was thinking if someone has looked in to it already.

it cost 30 tokkens and give 30 shells

Try to memorize Lyliya's decorations and get a variety of rewards,

Re: Lyliya's Magic House New mini game

Posted: Fri Sep 13, 2013 5:12 pm
by dr-nuker
Here is what i've made with 2 tries.
Too bad the game is offline again...

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<waypoints>
<onload>

function castit(what)
	print("Go to ".. what)
	local todo = player:findNearestNameOrId(what)
	if todo then
		teleport(todo.X,todo.Z,todo.Y+15)
		yrest(50)
		player:target_NPC(todo.Name)
		yrest(50)
		RoMScript("UseExtraAction(1)")
		player:clearTarget();
		yrest(50)
		teleport(lylx,lylz,lyly+15)
	else
		print("not found!")
	end
end

	fly()
	local lyliya = player:findNearestNameOrId("Lyliya")
	lylx = lyliya.X 
    lyly = lyliya.Y 
	lylz = lyliya.Z
	teleport(lylx,lylz,lyly+15)
	yrest(500)
	print("Start game")
	player:sleep()

	
    while true do
		print("Memorize room")
		player:sleep()
		
		local tablesize = 0
		local furniture = {}
		local objectList = CObjectList();
		objectList:update();
		local objSize = objectList:size()
		for i = 0,objSize do
			local obj = objectList:getObject(i);
			obj:update()
			if obj.Name and obj.Name ~= "" and obj.Name ~= "" and obj.Type ~= PT_PLAYER and obj.Name ~= "Lyliya" then
				print(obj.Name .. " " .. obj.X .. " " .. obj.Z .. " " .. obj.Y)
				table.insert(furniture, table.copy(obj))
				tablesize = tablesize + 1
			end
			player:update();
		end
		
		print("compare room")
		player:sleep()
		
		local tablesize2 = 0
		local furniture2 = {}
		objectList:update();
		objSize = objectList:size()
		for i = 0,objSize do
			local obj = objectList:getObject(i);
			obj:update()
			if obj.Name and obj.Name ~= "" and obj.Name ~= "" and obj.Type ~= PT_PLAYER and obj.Name ~= "Lyliya" then
				print(obj.Name .. " " .. obj.X .. " " .. obj.Z .. " " .. obj.Y)
				table.insert(furniture2, table.copy(obj))
				tablesize2 = tablesize2 + 1
			end
			player:update();
		end
		
		print("Action")
		
		for ka,va in ipairs(furniture2) do
			local cc = 0
			for kb,vb in ipairs(furniture) do
				cc=cc+1
				if va.Name == vb.Name then
					-- object was here and is here again
					print(va.Name)
					if va.X == vb.X and va.Z == vb.Z then
						-- it is on same position as before
					else
						castit(va.Name)
						break
					end
				else
					if cc == tablesize then
						castit(va.Name)
						break
					end
				end
			end
		end
		
	end
</onload>
</waypoints>
It is not automated yet. So it will only just help to identify changed objects.
What is on the todo list is: talk to her, accept, load table once then wait for the timer.
load next table and become active.
When timer is gone go and talk to her again...

I will try as soon as they open the zone...

Re: Lyliya's Magic House New mini game

Posted: Mon Sep 16, 2013 9:34 am
by Statesider
Tested and works for first 2 rounds. Third round complete mess and game FAIL :oops:

Re: Lyliya's Magic House New mini game

Posted: Mon Sep 16, 2013 4:25 pm
by dr-nuker
I'm reworking on it.

It's just not so easy as the game was closed last days :/

Now i have problems when loggiung in. Sometimes my interface is not loaded so i can not play ...

Re: Lyliya's Magic House New mini game

Posted: Tue Sep 17, 2013 6:25 am
by Statesider
Thanks anyway for your big effort! I´m not so deep into micromacro yet so I cant script something like that xD

*thumbs up*! ;)

Re: Lyliya's Magic House New mini game

Posted: Mon Sep 23, 2013 6:37 am
by Statesider
Any success about fixing that waypoint for the minigame? ;)

Re: Lyliya's Magic House New mini game

Posted: Fri Sep 27, 2013 1:18 pm
by BlubBlab
The problem I think is their are 3 different modes in the mini-game:
-Change
-New
-Identical

The fist 2 are covered up by the script, writing an new for the last would be easy the hard part is is find out in which mode we are.

Re: Lyliya's Magic House New mini game

Posted: Fri Sep 27, 2013 4:52 pm
by dr-nuker
Well.

I have never come above level 10. But I think that's the last possible level.

Nevertheless I have never seen any tradeable rewards for her tokens. Anyone experienced with that?

Re: Lyliya's Magic House New mini game

Posted: Sun Sep 29, 2013 9:00 am
by turbobay
Not yet, but i think i requires a certain amount of runs to make her "friendly" to give you trades. As far as i understand the description on the items you have to increase some value, although i did not figure out how and where to see this actual value, and what level we need to reach to make her "friendly".

Did you reach lvl 10 with a script, or by manual play ? And how many shells did you get with lvl 10 ?

Re: Lyliya's Magic House New mini game

Posted: Mon Sep 30, 2013 4:23 pm
by dr-nuker
Of course not by hand!

And i think it is 45 shells! But I'll have an eye on that next time i do it!

Re: Lyliya's Magic House New mini game

Posted: Tue Oct 01, 2013 5:44 am
by turbobay
Ok, nice. So do you have an updated script ?

So far i have nobody confirming when it is possible to trade any items with her. Only thing is, you get something increased when succesfull, but no possibility to see your rank and how much is needed to make her "friendly" to finally trade with her :-(

Re: Lyliya's Magic House New mini game

Posted: Wed Oct 02, 2013 1:51 am
by BlubBlab
I was finally able to make a test run, the bot was really wrong a lot.

Their are a few problems I see:

Code: Select all


 for ka,va in ipairs(furniture2) do
         local cc = 0
         for kb,vb in ipairs(furniture) do
            cc=cc+1
            if va.Name == vb.Name then
               -- object was here and is here again
               print(va.Name)
               if va.X == vb.X and va.Z == vb.Z then
                  -- it is on same position as before
               else
                  castit(va.Name)
                  break
               end
            else
               if cc == tablesize then
                  castit(va.Name)
                  break
               end
            end
         end
      end
First comparing float numbers with == is... do someone have a big hammer I need hit some fingers. :D
Okay fun besides float numbers can have different binary representatives for the same number with == you take a look at the binary datas at the most computer languages. I don't know how it is in LUA but I aspect from the errors it is.

2te

Code: Select all

 if cc == tablesize then
            castit(va.Name)
             break
  end
That looks strange for my but sadly I can only take a look on it tomorrow, if that works correctly(I'm tired)

Re: Lyliya's Magic House New mini game

Posted: Wed Oct 02, 2013 2:05 am
by Bill D Cat
I haven't tried anything with this script, but I understand what you mean by comparing FLOAT values. I think the better option might be to check the distance and act if it's larger than a certain value.

Code: Select all

if 10 > distance(va.X, va.Z, vb.X, vb.Z) then
     -- it is on same position as before
else
     castit(va.Name)
     break
end

Re: Lyliya's Magic House New mini game

Posted: Wed Oct 02, 2013 3:39 am
by BlubBlab

Code: Select all

if(math.abs(x1-x2) >1) then

end

Re: Lyliya's Magic House New mini game

Posted: Wed Oct 02, 2013 4:13 am
by rock5
BlubBlab wrote:if(math.abs(x1-x2) >1) then
Technically it would have to be

Code: Select all

if (1 > math.abs(x1-x2)) and (1 > math.abs(z1-z2)) then

Re: Lyliya's Magic House New mini game

Posted: Thu Oct 03, 2013 1:31 am
by BlubBlab
rock5 wrote:
BlubBlab wrote:if(math.abs(x1-x2) >1) then
Technically it would have to be

Code: Select all

if (1 > math.abs(x1-x2)) and (1 > math.abs(z1-z2)) then
I was in a hurry^^

I changed it so far I can tell this part works now with 100% accuracy, I added also some more yrest the script didn't wait until the character finished carsting on the object also I added a little fallback if the object is still too far.

Their are still some problem with the target I hope I can solve it tomorrow I used up all my character for today in tries and errors.

Re: Lyliya's Magic House New mini game

Posted: Fri Oct 04, 2013 3:02 am
by BlubBlab
Okay can somebody test this, I'm out of testing chars, but I'm sure it should now work :D
(if I haven't make a syntax mistake)
By the way the reward increase with the numbers of round and so the numbers of shells like andor training

Re: Lyliya's Magic House New mini game

Posted: Fri Oct 04, 2013 3:31 am
by Bill D Cat
Ran through the event fine, got 45 shells. The only time it had any trouble was when trying to get to an item up on the balcony. So out of ten stages, I ended up with one failure in picking out all the correct items. Still, it got me all three titles the first time, so I can't complain about +15HP for using it once :-)

Re: Lyliya's Magic House New mini game

Posted: Fri Oct 04, 2013 4:14 am
by BlubBlab
No "Out of range" error ?(out of range means in true no line of sight)
That was what fixed the at last short explanation I added a "faceit" function and a I shorted a vector to not end up in the objects(and see nothing->"out of range") that works fine?

If the bot choose something wrong then I guess it is the bot not my script.

Re: Lyliya's Magic House New mini game

Posted: Fri Oct 04, 2013 4:48 am
by Bill D Cat
The bot got hung up on the railing for some reason. I managed to nudge it over the top on a second character and it completed the whole event perfectly. The third character I ran through got to the 8th stage and for some reason identified an object twice at the same location on the compare stage. When it went to identify the objects, it used up all 10 of the allowed mistakes because it kept trying to target an object that wasn't there anymore. So far that's been the only issues I've encountered.

I did clean up the print statements that show the item locations during the identification stages to use math.lower() on the location values. It cleaned up the display without actually altering the numbers for comparison purposes. I think you have a winner here. An easy 45 shells each time which makes up for Goblin Mine being such a PITA these days to do solo on alts that aren't geared and statted.