VARANAS event

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Mer-Ki-Vah
Posts: 35
Joined: Sat Feb 04, 2012 6:53 am

VARANAS event

#1 Post by Mer-Ki-Vah » Sat Feb 02, 2013 3:49 pm

HI everybody!


Please help me.
The connected file is usuable 1-2 round, but after that the game is Crashing.
I dont now why, so thats while i ask you to help me.
Can it be changing : objectList:size() ??
If somebady solved this problem, please link the correct file !!!!!

Lets do it :D :geek:
Attachments
EventSheepCrash.xml
(4.49 KiB) Downloaded 186 times

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

Re: VARANAS event

#2 Post by rock5 » Sat Feb 02, 2013 11:59 pm

I'm not familiar with the event but is it possible that while it is going through the object list in "findmob" that they might move or disappear, eg. if someone else uses them? If so you should update each object before checking it. eg.

Code: Select all

			local obj = objectList:getObject(i);
			obj:update()
			if (  obj ~= nil ) then	
That way if the object no longer exists obj will == nil and it will skip 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

Mer-Ki-Vah
Posts: 35
Joined: Sat Feb 04, 2012 6:53 am

Re: VARANAS event

#3 Post by Mer-Ki-Vah » Sun Feb 03, 2013 7:30 am

Well. I'm thinking a lot about the solution.
Please test it and please tell me if somebady has the correct rutin.
My current modifycation this part:

Code: Select all

function findMOB(_range)
	printf("\n Mob find starting.\n");
	if RoMScript("ExtraActionBarFrame:IsVisible()") then printf("\n Actionbar visible.\n"); end;
	player:updateXYZ();
	while RoMScript("ExtraActionBarFrame:IsVisible()") do
		local obj = nil;
		local objectList = CObjectList();
		objectList:update();		
		for i = 0,objectList:size() do			
			local obj = objectList:getObject(i);
			if (  obj ~= nil ) then 
				if RoMScript("GetPing()")>70 then yrest(200);printf("\n Ping error.\n"); end;
				if	( ((obj.Name=="Kokomo") or (obj.Name=="Wood Cavy") or (obj.Name=="Baabaa Sheep")) and
					( _range >= math.floor (distance(obj.X,obj.Z,player.X,player.Z)) ) )  then
						
						player:target(obj);						
						RoMScript("UseExtraAction(1)");yrest(200);
						repeat
							player:update();
						until player.Casting==false
				end
			end
		end
	end
	yrest(2000);
	successful=true;
end

Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: VARANAS event

#4 Post by Jandrana » Sun Feb 03, 2013 8:31 am

I tried your script, but it seems a function is missing:

Code: Select all

2:21pm - [string "..."]:3: attempt to call global 'lookatTarget' (a nil value)

Mer-Ki-Vah
Posts: 35
Joined: Sat Feb 04, 2012 6:53 am

Re: VARANAS event

#5 Post by Mer-Ki-Vah » Sun Feb 03, 2013 12:32 pm

Ohh sry. Link this in Onload part:

Code: Select all

function lookatTarget(X,Z,Y)	
	local angle  = math.atan2(Z - player.Z, X - player.X);
	local yangle = math.atan2(Y - player.Y, ((X - player.X)^2 + (Z - player.Z)^2)^.5 );						
	player:faceDirection(angle, yangle);
	camera:setRotation(angle);
end

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

Re: VARANAS event

#6 Post by lisa » Mon Feb 04, 2013 9:18 pm

I posted a little userfunction for this event, if you want to have a look.

http://www.solarstrike.net/phpBB3/viewt ... 491#p47491
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

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests