-
Mer-Ki-Vah
- Posts: 35
- Joined: Sat Feb 04, 2012 6:53 am
#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

-
Attachments
-
- EventSheepCrash.xml
- (4.49 KiB) Downloaded 186 times
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#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.”
-
Mer-Ki-Vah
- Posts: 35
- Joined: Sat Feb 04, 2012 6:53 am
#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
#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
#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
Who is online
Users browsing this forum: Google [Bot] and 1 guest