Page 1 of 2

695 Changelog (the speedup update)

Posted: Thu Feb 02, 2012 1:19 pm
by rock5
Summary
  • The main focus for this update is improved speed and accuracy. There have been many changes to that effect. Improved speed to player:findEnemy, autosell, CheckEggPets, changes to eval function redesign for better speed and removal of old obsolete slow code. The result of this better speed (and other changes) is better accuracy at stopping and turning on waypoints.

    Also, the long overdue addition of the QuestByName functions from JackBlonder and my ChoiceOptionByName function. A few other minor changes and fixes have been thrown in as well.

-- player.lua --
Completely changed the way moveTo detects arrival at waypoint. It is now super accurate even when mounted.
  • It can now easily handle narrow paths with sharp corners easily, even mounted and accuratly stops on waypoints within 10 distance usually. Many of the changes below were made to make this possible.
Improved player:findEnemy and evalTargetDefault to speed up moveto loop for better waypoint accuracy.
  • evalTargetDefault was the main reason for the inaccuracy in find enemy by taking too long. The reason is because it created a pawn and updated it for every address. It can now accept the actual pawn as a second argument saving the need for the eval function to create it. I've made it a standard now that evalfunctions include this optional pawn or object for faster processing. As always, it has been designed to be backward compatible.
Retired inventory:updateSlotsByTime in the 2 places it was used. Took too long and not necessary.
  • This was needed in the time before memory info gethering. Now it's just obsolete and uses a lot of cpu power.
Fixed player:harvest failing to harvest first time.
  • Just added a small pause.
player:sleep now uses "getStartKey" so if a user sets the start key with "setStartKey" it will use that.
  • I doubt this affects anyone else. I use "setStartKey("VK_HOME")" in my profiles to change the resume button from <Delete> to <Home> so I can pause a bot and type something and use delete. But player:sleep() still needed delete pressed to wake which annoyed me. This change fixes that.
findNearestNameOrId also has speed improvements.
  • It uses the same second argument to it's eval function so it doesn't have to create the objects for each address.
fixed player:dismount also works for 15m and 2h mounts.
  • Using 15m and 2h mounts when mounted didn't dismount. now it does.
-- camera.lua --
Improved camera angling in CCamera:setRotation.
  • The camera angle now stays at 20 degrees from horizontal. But it also angles down when going to a waypoint below you and angles up when going to one above you. This helps to allow you to see where you're going (it will stay at 20 degrees with older waypoint files that don't have 'y' values)
Fixed sudden zoom out and death after entering instances.
  • This was simply caused by outdated player coordinates. Easily fixed.
-- eggpet.lua --
Speeded up eggpet checks so it doesn't interfere with waypoint accuracy.
  • Checking the assist and craft pets was taking too long and affecting bot accuracy. Had to create custom inventory search to speed it up as itemTotalCount was taking too long.
Fixed eggpet summons on first attempt.
  • Just stopped forward movement before summoning.
-- inventory.lua --
Updated autosell to use all memory values. Now very fast.
  • This has been a long time coming. Autosell was still getting maxdura and stats from ingame tooltips even though they are now gotten from memory. Lisa said that where it took like 90 seconds to sell all bags, now it takes 8-15 seconds.
-- pet.lua --
Changed warden pet are now commanded to attack just before you attack so you attack together.Says it all.

-- skills.xml --
Fixed PRIEST_EXPLOSION_OF_FIGHTING_SPIRIT, PRIEST_FIGHTING_SPIRIT_COMBINATION, PRIEST_ASCENDING_DRAGON_STRIKE and WARDEN_FRANTIC_BRIAR.
  • Added some missing values.
-- functions.lua --
Fixed RoMScript now immediately returns if screen loading.
  • This is mainly for when you teleport and check for staticpopup but there is a autopay addon installed.
Added QuestByName functions. Thanks JackBlonder
  • You should remove the questbyname userfunction if you have it installed. I modified it mainly to tidy it up and remove repetition. Otherwise it works the same as JackBlonders userfunctions.
Added ChoiceOptionByName function.
  • I'm happy to say I got it working nicely with npcs where ChoiceOption doesn't work and where you would have to use that other command. So you don't have to worry about which type of command to use.
Added NormaliseString and FindNormalisedString functions
  • These are from JackBlonders QuestByName userfunction but can be used for other purposes. NormaliseString simply replaces characters, that interfere with string.find or string.match functions, with . which means any character and converts all characters to lower case. FindNormalisedString functions like "string.find(string1,string2)" but normalises the strings.
-- settings.lua --
Removed support for spanish language file. No spanish language file was ever added.
  • Don't remember who it was but when they added spanish support they must have forgotten to add the language file.

Re: 695 Changelog (the speedup update)

Posted: Thu Feb 02, 2012 1:43 pm
by silinky
i want to be the first to cobngratulate on this update :D
dunno about the other stuff, but the bot froze up for 1-2 seconds at looting. now it does not.
and that is a huge improvement i can now use twice the number of game clients together :)

Re: 695 Changelog (the speedup update)

Posted: Thu Feb 02, 2012 2:02 pm
by rock5
I think the pause was from inventory:updateSlotsByTime. That was the main cpu waster.

I suspected this update would increase the number of possible clients and allow people with older pcs to run it better. I'm happy to hear you can run twice as much.

I look forward to hearing more reports. :)

Re: 695 Changelog (the speedup update)

Posted: Fri Feb 03, 2012 2:29 am
by Germangold
Changelog is awesome, even more detailed than frogster's changelog for rom it self ^^
currently busy at work cant wait to check out the improvent

high five rock5!

..::::UPDATE::::.....

Just update remotely my two machines and this is LEGENDARY... my characters are running smoothly and elegant tru KS ^^
great work rock!

Re: 695 Changelog (the speedup update)

Posted: Fri Feb 03, 2012 5:56 am
by kkulesza
Performance is much better now. Finally i can back to KS frarming :)

Re: 695 Changelog (the speedup update)

Posted: Fri Feb 03, 2012 6:10 am
by lisa
have to agree totally, Rock's upgrade is awesome, my crappy old machine can once again get me gold lol

Re: 695 Changelog (the speedup update)

Posted: Fri Feb 03, 2012 10:29 am
by metralla123
Hello guys!! Congratz for your job rock5. I have a problem with the new update in this part of my ciclop's gold

Code: Select all

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


<!-- At NPC for transport -->
<!-- # 1 --><waypoint x="-32646" z="-14708" y="669" type="TRAVEL" > 

    while not RoMScript("UnitExists('party1')") do
    sendMacro('InviteByName("NAME")');
    changeProfileOption("COMBAT_RANGED_PULL" , false);
    changeProfileOption("LOOT_DISTANCE", 105);
    player:mount();
    yrest(4000);
    end
    </waypoint>

<!-- # 2 --><waypoint x="-32646" z="-14708" y="669" type="TRAVEL">

        if inventory:itemTotalCount(0) == 0 then
    sendMacro("LeaveParty();");
    yrest(4000);
    player:update();
    player:mount();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end 
    </waypoint>

<!-- # 3 --><waypoint x="-32646" z="-14708" y="669" type="TRAVEL"> </waypoint>
<!-- # 4 --><waypoint x="-32607" z="-14766" y="669" type="TRAVEL" tag="Kalice"> 
    yrest(1500);
    player:target_NPC("Kalice");
    sendMacro("ChoiceOption(1);");if not waitForLoadingScreen(10) then
           __WPL:setWaypointIndex(__WPL:findWaypointTag("Kalice")); 
        end
    </waypoint>

<!-- # 5 --><waypoint x="-38152" z="-9323" y="1061" type="TRAVEL"  tag="comienzo"> </waypoint>
<!-- # 6 --><waypoint x="-38200" z="-9265" y="1061" type="TRAVEL">
        if not waitForLoadingScreen(10) then
           __WPL:setWaypointIndex(__WPL:findWaypointTag("comienzo")); 
        end </waypoint>
<!-- Dentro de la instancia CL -->
<!-- # 7 --><waypoint x="2009" z="1084" y="47" tag="dentro">

    changeProfileOption("COMBAT_RANGED_PULL", false);
    changeProfileOption("LOOT_DISTANCE", 105);   
    changeProfileOption("MAX_TARGET_DIST", 110);
    if inventory:itemTotalCount(0) == 0 then
    sendMacro("LeaveParty();");
    yrest(4000);
    waitForLoadingScreen(); 
    player:update();
    player:mount();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end
    </waypoint>
 
<!-- # 8 --><waypoint x="2051" z="1153" y="47"> </waypoint>

When change to second loadingscreen the bot not change por waypoint 7 and go to number 6, any help for me please?

Re: 695 Changelog (the speedup update)

Posted: Fri Feb 03, 2012 10:43 am
by rock5
So you are saying that it teleports but thinks that it didn't so goes to waypoint 5 to try again? Does it take longer than 10 seconds before the loading screen appears, even after botting for awhile? Try increasing the "10" to a bigger number.

Re: 695 Changelog (the speedup update)

Posted: Fri Feb 03, 2012 10:56 am
by metralla123
Ok rock5 thanks for the help, and sorry for my english is "buaff" XDD.. I believe that if waypoint 6 change the adress and not find after the loadingscreen, i trying to change this. Thanks, and a salute for all!! ;)

Re: 695 Changelog (the speedup update)

Posted: Fri Feb 03, 2012 11:02 am
by lisa
I use this in my KS script, might give you some ideas.

Code: Select all

	local movement = 10
	local ss = os.time()
	repeat
	waitForLoadingScreen(15);
	if getZoneId() == 6 then -- dust devil canyon
		player:moveTo(-18560-movement,12480+movement)
	end
	until getZoneId() ~= 6 or (os.time() - ss > 60)

Re: 695 Changelog (the speedup update)

Posted: Fri Feb 03, 2012 12:15 pm
by metralla123
Thank you Lisa, but I do not understand these commands, do a light idea to myself, but I do not understand that the bot follows parameters with certain commands.

Code: Select all

   local movement = 10
   local ss = os.time()        _this command say order to bot, for local move of this 10 points and it repeats itself if not load 
   repeat                                 screen¿?_
   waitForLoadingScreen(15);


   if getZoneId() == 6 then -- dust devil canyon
      player:moveTo(-18560-movement,12480+movement)   _and this command not understand, bot detect the zoneid of his 
   end                                                 number is 6 and go to the next waypoint, if not detect 
   until getZoneId() ~= 6 or (os.time() - ss > 60)     zoneid wait 60 seconds?_
Thank you for the help and excuse me for my terrible English.

Re: 695 Changelog (the speedup update)

Posted: Fri Feb 03, 2012 12:25 pm
by lisa

Code: Select all

<!-- # 6 --><waypoint x="-38200" z="-9265" y="1061" type="TRAVEL">
repeat
waitForLoadingScreen(10)
if getZoneId() == ** then -- change the ** to zone ID of dragonfang ridge
__WPL:setWaypointIndex(__WPL:findWaypointTag("comienzo")); 
end
until getZoneId() ~= ** -- change the ** to zone ID of dragonfang ridge
</waypoint>

you need to add in the zone id of dragonfang ridge, I don't know it.

Re: 695 Changelog (the speedup update)

Posted: Fri Feb 03, 2012 3:36 pm
by metralla123
I am sorry, but I have many problems with my waypoint on having updated, have changed the former one. A greeting.

Re: 695 Changelog (the speedup update)

Posted: Fri Feb 03, 2012 5:06 pm
by bokagavrilov
omg i updated it just now ! but this update its so awesome ! xD great job!

Re: 695 Changelog (the speedup update)

Posted: Fri Feb 03, 2012 11:49 pm
by MiesterMan
These updates look great. Good work guys! :)

Re: 695 Changelog (the speedup update)

Posted: Sat Feb 04, 2012 3:34 am
by silinky
i like how this bot is better mantained and updated more professionally than the game itself :D

Re: 695 Changelog (the speedup update)

Posted: Tue Feb 07, 2012 9:35 am
by Juin
I also have kind of the same problem as metralla123 with this new update.

When i use my bot for DoD farm he goes through the portal and after hes inside he still wants to go to the waypoint outside like he didnt recognized the portal.
I tried using these 2 codes both worked before the update:

Code: Select all

waitForLoadingScreen();

Code: Select all

repeat
   local zoneid = RoMScript("GetZoneID()");
   until zoneid ~= 209

Re: 695 Changelog (the speedup update)

Posted: Tue Feb 07, 2012 9:56 am
by rock5
Juin wrote:

Code: Select all

repeat
   local zoneid = RoMScript("GetZoneID()");
   until zoneid ~= 209
You can't do RoMScript during the loading screen. I'm not sure how that was previously working. Actually you could get it to work now. RoMScript now checks for the loading screen and return nil if it detects it. So if you changed it to "until zoneid == IdOfNewZone" then it will return nil until it has finished loading then return the id of the new zone. Anyway it is recommended to use "getZoneId()" instead because it gets it from memory.
Juin wrote:

Code: Select all

waitForLoadingScreen();
This should work. The fact that you say that it heads back to the wrong waypoint means that it worked. It detected the loading screen, waited till it disappeared, then returned control to your waypoint file. If it didn't detect the loading screen then it would have been stuck in a loop. Unless, of course, it teleported before reaching the last waypoint. In which case you need to fix that.

Either way, there is probably some error in your waypoint file.

Re: 695 Changelog (the speedup update)

Posted: Tue Feb 07, 2012 10:06 am
by lisa
now that bot tries to be far more accurate I would say you just need to adjust your coords according. They may be to far from the actual portal and previously the bot would think it got to those coords even though it was 50 away still.

Re: 695 Changelog (the speedup update)

Posted: Tue Feb 07, 2012 10:34 am
by Juin
lisa wrote:now that bot tries to be far more accurate I would say you just need to adjust your coords according. They may be to far from the actual portal and previously the bot would think it got to those coords even though it was 50 away still.
Yes, i think this is exactly what happened i adjusted the waypoint now it works fine again thanks!