Page 16 of 22

Re: Allmost foolproof KS run

Posted: Fri Mar 16, 2012 5:41 am
by rock5
Try reading the official patch post
http://www.solarstrike.net/phpBB3/viewt ... =21&t=3638

Especially my last post. I haven't been able to commit it yet because TortoiseSVN is throwing up an error but you can make that change manually and it should attack. Make sure you update to 702 first though. Hopefully someone will commit that fix soon.

Re: Allmost foolproof KS run

Posted: Sun Mar 18, 2012 5:27 pm
by Dimitryj
I tried the code on this way:

Code: Select all

if player:haveTarget() then
			if( 120000 < target.MaxHP) then
				player:cast("MAGE_ELEMENTAL_CATALYST");
				yrest(700);
				player:cast("MAGE_ELEMENTAL_WEAKNESS");
				yrest(700);
			else
				player:cast("MAGE_PURGATORY_FIRE");
			end
		end
but when it loads i get this error messeage:


Sun Mar 18 23:17:17 2012 : .../Downloads/micromacro/scripts/rom/classes/player.lua:687: onSkillCast error: [string "..."]:3: attempt to index global 'target' (a nil value)
Sun Mar 18 23:17:17 2012 : Execution error: Runtime error
Sun Mar 18 23:18:09 2012 : Executing script 'bot.lua'

:(

But wen i tryed teh code what you wrote

Code: Select all

	
Code:
if player:haveTarget() then
   if( 120000 > target.MaxHP) then
      player:cast("MAGE_PURGATORY_FIRE");
   else
      player:cast("MAGE_ELEMENTAL_CATALYST");
      player:cast("MAGE_ELEMENTAL_WEAKNESS");
      player:cast("MAGE_FLAME");
      player:cast("MAGE_FIREBALL");
      player:cast("PRIEST_RISING_TIDE");
   end
end
this almost worked but when the first mob died immedietly jumped to the else case of the "if".

Re: Allmost foolproof KS run

Posted: Sun Mar 18, 2012 7:19 pm
by lisa
Any reason you don't just cast the buffs at the waypoint before bosses?

Code: Select all

	<!-- # 90 --><waypoint x="2649" z="1989"> 
		player:cast("MAGE_ELEMENTAL_CATALYST");
		player:cast("MAGE_ELEMENTAL_WEAKNESS");
	</waypoint>

Re: Allmost foolproof KS run

Posted: Mon Mar 19, 2012 2:01 am
by Dimitryj
I think this will be the next step, but it would be nice if the macro only buffs when i have target and not started the figth yet.

Re: Allmost foolproof KS run

Posted: Mon Mar 19, 2012 3:14 am
by lisa
If you really only want it to cast the buffs while you are fighting a boss then you should do it in profile and do checks for the skill being used and if so then return true only if target maxhp is more then X.

Something like this.

Code: Select all

		if arg1.Name == "MAGE_ELEMENTAL_CATALYST" or arg1.Name == "MAGE_ELEMENTAL_WEAKNESS" then
			if player:haveTarget() then
				target = player:getTarget();
				if target.MaxHP > 120000 then 
					return true 
				else 
					return false 
				end
			end
		end
Are you sure 120k is enough?
I would have thought 300k would be better.

Re: Allmost foolproof KS run

Posted: Mon Mar 19, 2012 3:20 am
by Dimitryj
And put this code to the oncast section of the profile, rigth?

Re: Allmost foolproof KS run

Posted: Mon Mar 19, 2012 3:30 am
by lisa

Code: Select all

	<onSkillCast><![CDATA[
      if arg1.Name == "MAGE_ELEMENTAL_CATALYST" or arg1.Name == "MAGE_ELEMENTAL_WEAKNESS" then
         if player:haveTarget() then
            target = player:getTarget();
            if target.MaxHP > 120000 then 
               return true 
            else 
               return false 
            end
         end
      end
	]]></onSkillCast>

Re: Allmost foolproof KS run

Posted: Mon Mar 19, 2012 3:46 am
by Dimitryj
I dont know why it cast elemental catalist at mobs too, can I restrict somhow to not use it only if the criteria is true?

Re: Allmost foolproof KS run

Posted: Mon Mar 19, 2012 4:30 am
by lisa
hmm it should prob be

<onPreSkillCast>
</onPreSkillCast>

instead on the

<onSkillCast>
</onSkillCast>

been a while since I added things like that in profile.

Re: Allmost foolproof KS run

Posted: Mon Mar 19, 2012 5:19 am
by Dimitryj
It seems like working :D

The other qestion is how to chek the target name. I want to change the cast prio at Regin to kill faster, if i cast electric bolt the dot can breach his shield down and come back figthing os i can kill in some sec and dont have to kill enshia and the warior first.

Something like this:

Code: Select all

if player:haveTarget() and target.Name="Regin" then
            target = player:getTarget();
            player:cast(MAGE_ELECTRIC_BOLT);
			yrest(2700);
			player:cast(MAGE_FLAME);
			yrest(3700);
			player:cast(MAGE_FLAME);
            end
         end

Re: Allmost foolproof KS run

Posted: Mon Mar 19, 2012 5:34 am
by lisa
you need to define "target" before trying to use it like you did with target.Name

Code: Select all

	if player:haveTarget() then
		target = player:getTarget();
		if target.Name == "Regin" then
            player:cast(MAGE_ELECTRIC_BOLT);
			yrest(2700);
			player:cast(MAGE_FLAME);
			yrest(3700);
			player:cast(MAGE_FLAME);
        end
    end

Re: Allmost foolproof KS run

Posted: Mon Mar 19, 2012 8:19 am
by Dimitryj
Cool. The rgin part works fine.
Now the only problem left is the targeting, dont atack bosses only counterfigth and not realy know why. There is any option to force the caracter to attack the bosses.
Aad the other :can I prohibit to atack non enemy mobs the yellow ones like the barrels at the Godess boss, because just runing round and round but the casks respawn fast so never reach the next wp.

Re: Allmost foolproof KS run

Posted: Mon Mar 19, 2012 8:52 am
by lisa
Dimitryj wrote:Aad the other :can I prohibit to atack non enemy mobs the yellow ones like the barrels at the Godess boss, because just runing round and round but the casks respawn fast so never reach the next wp.
Add them to friends list, there should be a userfunction of mine posted for it.
Dimitryj wrote:Now the only problem left is the targeting, dont atack bosses
At first you can't attack the boss, you go near it and then it changes to a mob you can attack and by then it hits you first anyway, just make your waypoint coords to go to the bosses coords and should be fine, not much u can do about that.

Re: Allmost foolproof KS run

Posted: Mon Mar 19, 2012 9:23 am
by Dimitryj
You think about this?

http://www.solarstrike.net/phpBB3/viewt ... end#p35721

How can I include the lua?

And if I correct i can use like this?

Code: Select all

<onLoad><![CDATA[
		changeOptionFriendMob("mob", "Cask", "Add")
	]]></onLoad>

Re: Allmost foolproof KS run

Posted: Mon Mar 19, 2012 10:34 am
by lisa
yes but you want to add it to friend not mob.

mob means it will ONLY attack the mobs with that name.

friend means it will ignore the NPC/mob.

Re: Allmost foolproof KS run

Posted: Fri Mar 23, 2012 3:23 pm
by rubenr
A little detail that i've found in the past few days is that the bot takes too much time to target the mobs, because it just waits for agressive ones while running. Its preety weird but it took a huge loss in my earnings per hours (from 1,5kk/h to 700k/h), with both the same characters as before, same level, same runes/wings/pets/honor group/% potion/etc.

Re: Allmost foolproof KS run

Posted: Fri Mar 23, 2012 9:26 pm
by lisa
rubenr wrote:Its preety weird but it took a huge loss in my earnings per hours (from 1,5kk/h to 700k/h),
I think you will find this is the issue I have been dealing with in another thread. i am pretty sure I fixed it now but just doing some more testing before commiting the changes. you can test the file for yourself if you want.

http://www.solarstrike.net/phpBB3/viewt ... 112#p36112

Getting stuck at reentry

Posted: Sun Mar 25, 2012 9:39 pm
by AhKePal
Almost every time i run this script my char goes crazy after entering the portal. This is my file:

Code: Select all


<?xml version="1.0" encoding="utf-8"?><waypoints>	
	<onLoad>
	ToPancer = 1
	StopAtBoss = 0
	repeat
	cprintf(cli.lightgreen,"\n          Kalin Shrine script\n")
	print("Type number before which boss you want to stop farm KS")
	print("		1. Iron Rune Warrior")
	print("		2. Locatha")
	print("		3. Harp")
	print("		4. Full run")
	print("		5. Quit")
	print("\n StopAtBoss>")
	StopAtBoss = io.stdin:read()
	StopAtBoss = tonumber(StopAtBoss)
	until StopAtBoss and StopAtBoss > 0
	if StopAtBoss == 5 then error("Closing.",0) end	
	</onLoad>
	yrest(17000);
	<!-- #  1 --><waypoint x="4755" z="900" type="TRAVEL">	
	if (not player:hasBuff("506687")) then
    inventory:useItem(207203);
    end  

	if (not player:hasBuff("506686")) then
    inventory:useItem(207202);
    end 

	if (not player:hasBuff("506684")) then
    inventory:useItem(207200);
    end 
   </waypoint>
	<!-- #  2 --><waypoint x="4626" z="913">changeProfileOption("MAX_TARGET_DIST", 90);
	        if( 60 > player.HP/player.MaxHP*100 ) then
         inventory:useItem(203494);
        end
	</waypoint>
	<!-- #  3 --><waypoint x="4456" z="912">	</waypoint>

	<!-- #  4 --><waypoint x="4447" z="913" >changeProfileOption("MAX_TARGET_DIST", 130);	</waypoint>
	<!-- #  5 --><waypoint x="4378" z="1029" >	</waypoint>
	<!-- #  6 --><waypoint x="4364" z="822" >	</waypoint>
	<!-- #  7 --><waypoint x="4193" z="792" >changeProfileOption("MAX_TARGET_DIST", 90);	</waypoint>
	<!-- #  8 --><waypoint x="4211" z="917" >	</waypoint>

	<!-- #  9 --><waypoint x="4207" z="911" >changeProfileOption("MAX_TARGET_DIST", 130);	</waypoint>
	<!-- # 10 --><waypoint x="4030" z="915" >	</waypoint>
	<!-- # 11 --><waypoint x="3954" z="1003" >	</waypoint>
	<!-- # 12 --><waypoint x="3754" z="747" >changeProfileOption("MAX_TARGET_DIST", 90);	</waypoint>
	<!-- # 13 --><waypoint x="3754" z="747" >	</waypoint>
	<!-- # 14 --><waypoint x="3754" z="747" >	</waypoint>

	<!-- # 15 --><waypoint x="3754" z="802">	</waypoint>
	<!-- # 16 --><waypoint x="3752" z="958">	</waypoint>
	<!-- # 17 --><waypoint x="3752" z="1121">	</waypoint>
	<!-- # 18 --><waypoint x="3797" z="1178">	</waypoint>
	<!-- # 19 --><waypoint x="3830" z="1199">changeProfileOption("MAX_TARGET_DIST", 110);	</waypoint>
	<!-- # 20 --><waypoint x="3891" z="1200">	</waypoint>
	<!-- # 21 --><waypoint x="3958" z="1176">	</waypoint>
	<!-- # 22 --><waypoint x="4010" z="1166">	</waypoint>
	<!-- # 23 --><waypoint x="4030" z="1207">	</waypoint>
	<!-- # 24 --><waypoint x="4033" z="1278">	</waypoint>
	<!-- # 25 --><waypoint x="4040" z="1359">	</waypoint>
	<!-- # 26 --><waypoint x="4064" z="1428">	</waypoint>
	<!-- # 27 --><waypoint x="4148" z="1439">	</waypoint>
	<!-- # 28 --><waypoint x="4212" z="1411">	</waypoint>
	<!-- # 29 --><waypoint x="4233" z="1336">	</waypoint>
	<!-- # 30 --><waypoint x="4232" z="1262">	</waypoint>
	<!-- # 31 --><waypoint x="4235" z="1153" type="TRAVEL">	</waypoint>
	<!-- # 32 --><waypoint x="4269" z="1155">	</waypoint>
	<!-- # 33 --><waypoint x="4339" z="1150">	</waypoint>
	<!-- # 34 --><waypoint x="4421" z="1149">	</waypoint>
	<!-- # 35 --><waypoint x="4418" z="1278">	</waypoint>
	<!-- # 36 --><waypoint x="4418" z="1437">	</waypoint>
	<!-- # 37 --><waypoint x="4339" z="1438">	</waypoint>
	<!-- # 38 --><waypoint x="4267" z="1436">	</waypoint>
	<!-- # 39 --><waypoint x="4202" z="1444">	</waypoint>
	<!-- # 40 --><waypoint x="4164" z="1492">	</waypoint>
	<!-- # 41 --><waypoint x="4100" z="1500">	</waypoint>
	<!-- # 42 --><waypoint x="4052" z="1509">	</waypoint>
	<!-- # 43 --><waypoint x="3980" z="1532">	</waypoint>
	<!-- # 44 --><waypoint x="3911" z="1508">	</waypoint>
	<!-- # 45 --><waypoint x="3831" z="1441">	</waypoint>
	<!-- # 46 --><waypoint x="3777" z="1416">	</waypoint>
	<!-- # 47 --><waypoint x="3757" z="1362">	</waypoint>
	<!-- # 48 --><waypoint x="3763" z="1307">	</waypoint>
	<!-- # 49 --><waypoint x="3781" z="1238">changeProfileOption("MAX_TARGET_DIST", 150);
	    if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    

	</waypoint>
	<!-- # 50 --><waypoint x="3771" z="1176">	</waypoint>
	<!-- # 51 --><waypoint x="3728" z="1149">	</waypoint>
	<!-- # 52 --><waypoint x="3601" z="1157">	</waypoint>
	<!-- # 53 --><waypoint x="3474" z="1162">	</waypoint>
	<!-- # 54 --><waypoint x="3448" z="1211">	</waypoint>
	<!-- # 55 --><waypoint x="3454" z="1313">	</waypoint>
	<!-- # 56 --><waypoint x="3466" z="1408">	</waypoint>
	<!-- # 57 --><waypoint x="3427" z="1456">	</waypoint>
	<!-- # 58 --><waypoint x="3313" z="1444">	</waypoint>
	<!-- # 59 --><waypoint x="3198" z="1429">	</waypoint>
	<!-- # 60 --><waypoint x="3149" z="1446">	</waypoint>
	<!-- # 61 --><waypoint x="3127" z="1472">	</waypoint>
	<!-- # 62 --><waypoint x="3160" z="1514">	</waypoint>
	<!-- # 63 --><waypoint x="3169" z="1617">	</waypoint>
	<!-- # 64 --><waypoint x="3137" z="1716">	</waypoint>
	<!-- # 65 --><waypoint x="3111" z="1784">	</waypoint>
	<!-- # 66 --><waypoint x="3158" z="1813">	</waypoint>
	<!-- # 67 --><waypoint x="3172" z="1887">	</waypoint>
	<!-- # 68 --><waypoint x="3172" z="1969">	</waypoint>
	<!-- # 69 --><waypoint x="3169" z="2050">	</waypoint>
	<!-- # 70 --><waypoint x="3168" z="2138">	</waypoint>
	<!-- # 71 --><waypoint x="3178" z="2255">	</waypoint>
	<!-- # 72 --><waypoint x="3148" z="2287">	</waypoint>
	<!-- # 73 --><waypoint x="3059" z="2282">	</waypoint>
	<!-- # 74 --><waypoint x="2958" z="2288">	</waypoint>
	<!-- # 75 --><waypoint x="2927" z="2245">changeProfileOption("MAX_TARGET_DIST", 90);	</waypoint>
	<!-- # 76 --><waypoint x="2938" z="2157">	</waypoint>
	<!-- # 77 --><waypoint x="3045" z="2008" y="738">	</waypoint>
	
	<!-- # 78 --><waypoint x="2920" z="2012">	</waypoint>
	<!-- # 79 --><waypoint x="2867" z="1987">changeProfileOption("MAX_TARGET_DIST", 150);
	    if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    

	</waypoint>
	<!-- # 80 --><waypoint x="2811" z="2029" type="TRAVEL">	</waypoint>
	<!-- # 81 --><waypoint x="2806" z="2088" type="TRAVEL">	</waypoint>
	<!-- # 82 --><waypoint x="2845" z="2148" type="TRAVEL">	</waypoint>
	<!-- # 83 --><waypoint x="2857" z="2210">	</waypoint>
	<!-- # 84 --><waypoint x="2766" z="2266">	</waypoint>
	<!-- # 85 --><waypoint x="2705" z="2289">	</waypoint>
	<!-- # 86 --><waypoint x="2636" z="2242">	</waypoint>
	<!-- # 87 --><waypoint x="2628" z="2175">	</waypoint>
	<!-- # 88 --><waypoint x="2621" z="2106">	</waypoint>
	<!-- # 89 --><waypoint x="2614" z="2042">	</waypoint>
	<!-- # 90 --><waypoint x="2649" z="1989">	</waypoint>
	<!-- # 91 --><waypoint x="2688" z="1945">	</waypoint>
	<!-- # 92 --><waypoint x="2694" z="1912">	
	if StopAtBoss == 1 then
		sendMacro("LeaveParty();");
		yrest(4000)
		waitForLoadingScreen(); 
		player:update();
    	__WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end
	</waypoint>
	<!-- # 93 --><waypoint x="2693" z="1798">	</waypoint>
	<!-- # 94 --><waypoint x="2692" z="1731">	</waypoint>
	<!-- # 95 --><waypoint x="2692" z="1642">	</waypoint>
	<!-- # 96 --><waypoint x="2691" z="1579">	</waypoint>
	<!-- # 97 --><waypoint x="2677" z="1452">	</waypoint>
	<!-- # 98 --><waypoint x="2710" z="1417">	</waypoint>
	<!-- # 99 --><waypoint x="2787" z="1427">	</waypoint>
	<!-- # 100 --><waypoint x="2896" z="1428">	</waypoint>
	<!-- # 101 --><waypoint x="3054" z="1424">	</waypoint>
	<!-- # 102 --><waypoint x="3113" z="1483">	</waypoint>
	<!-- # 103 --><waypoint x="3106" z="1561">	</waypoint>
	<!-- # 104 --><waypoint x="3096" z="1627">	</waypoint>
	<!-- # 105 --><waypoint x="3137" z="1685">	</waypoint>
	<!-- # 106 --><waypoint x="3151" z="1775">	if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    </waypoint>
	<!-- # 107 --><waypoint x="3087" z="1804" type="TRAVEL">	</waypoint>
	<!-- # 108 --><waypoint x="3031" z="1797" type="TRAVEL">	</waypoint>
	<!-- # 109 --><waypoint x="2880" z="1795" type="TRAVEL">	</waypoint>
	<!-- # 110 --><waypoint x="2734" z="1793" type="TRAVEL">	</waypoint>
	<!-- # 111 --><waypoint x="2699" z="1728"> 	</waypoint>
	<!-- # 112 --><waypoint x="2855" z="1692">	if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    </waypoint>
	<!-- # 113 --><waypoint x="2638" z="1703" type="TRAVEL">	</waypoint>
	<!-- # 114 --><waypoint x="2532" z="1705">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 115 --><waypoint x="2484" z="1677">changeProfileOption("MAX_TARGET_DIST", 150);
	    if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    

	</waypoint>
	<!-- # 116 --><waypoint x="2425" z="1594">	if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    </waypoint>
	<!-- # 117 --><waypoint x="2454" z="1541">	</waypoint>
	<!-- # 118 --><waypoint x="2528" z="1517">	</waypoint>
	<!-- # 119 --><waypoint x="2650" z="1515">changeProfileOption("MAX_TARGET_DIST", 110);	</waypoint>
	<!-- # 120 --><waypoint x="2751" z="1532">	</waypoint>
	<!-- # 121 --><waypoint x="2811" z="1527">	if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    </waypoint>
	<!-- # 122 --><waypoint x="2936" z="1562">	</waypoint>
	<!-- # 123 --><waypoint x="2960" z="1511">	</waypoint>
	<!-- # 124 --><waypoint x="2946" z="1424">	</waypoint>
	<!-- # 125 --><waypoint x="2786" z="1426">	    if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    
	</waypoint>
	<!-- # 126 --><waypoint x="2597" z="1433">	</waypoint>
	<!-- # 127 --><waypoint x="2593" z="1540">	</waypoint>
	<!-- # 128 --><waypoint x="2589" z="1771">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 129 --><waypoint x="2590" z="1867">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 130 --><waypoint x="2581" z="2366">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 131 --><waypoint x="2595" z="2496">	if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    </waypoint>
	<!-- # 132 --><waypoint x="2595" z="2685">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 133 --><waypoint x="2593" z="2846">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 134 --><waypoint x="2570" z="2961">	if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    </waypoint>
	<!-- # 135 --><waypoint x="2464" z="2946">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 136 --><waypoint x="2342" z="2949">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 137 --><waypoint x="2291" z="3004">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 138 --><waypoint x="2307" z="3088">	if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    
	</waypoint>
	<!-- # 139 --><waypoint x="2318" z="3228">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 140 --><waypoint x="2303" z="3284">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 141 --><waypoint x="2178" z="3289">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 142 --><waypoint x="2050" z="3274">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 143 --><waypoint x="2056" z="3366"> if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end
	</waypoint>
	<!-- # 144 --><waypoint x="2065" z="3441">
	if StopAtBoss == 2 then
		sendMacro("LeaveParty();");
		yrest(4000)
		waitForLoadingScreen(); 
		player:update();
    	__WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end	</waypoint>
	<!-- # 145 --><waypoint x="2163" z="3795">	</waypoint>
	<!-- # 146 --><waypoint x="2277" z="3802">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 147 --><waypoint x="2401" z="3782">	</waypoint>
	<!-- # 148 --><waypoint x="2391" z="3604">	</waypoint>
	<!-- # 149 --><waypoint x="2394" z="3351">	</waypoint>
	<!-- # 150 --><waypoint x="2319" z="3310">if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    	</waypoint>
	<!-- # 151 --><waypoint x="2062" z="3276">	</waypoint>
	<!-- # 152 --><waypoint x="1921" z="3312">	</waypoint>
	<!-- # 153 --><waypoint x="1807" z="3362">yrest(2000);	</waypoint>
	<!-- # 154 --><waypoint x="1797" z="3544">yrest(5000);	</waypoint>
	<!-- # 155 --><waypoint x="1804" z="3768">
	if player.Class1 == 5 or player.Class2 == 5 then -- priest
		while (80 > player.HP/player.MaxHP*100) do
			player:cast("PRIEST_URGENT_HEAL");
			yrest(2300);
		end
	end
	if player.Class1 == 8 or player.Class2 == 8 then -- druid
		while (80 > player.HP/player.MaxHP*100) do
			player:cast("DRUID_RECOVER");
			yrest(2300);
		end
	end	</waypoint>
	<!-- # 156 --><waypoint x="1977" z="3939" type="TRAVEL"> if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end
	</waypoint>
	<!-- # 157 --><waypoint x="2279" z="4011" type="TRAVEL">	</waypoint>
	<!-- # 158 --><waypoint x="2309" z="4130" type="TRAVEL">	</waypoint>
	<!-- # 159 --><waypoint x="2290" z="4245">	</waypoint>
	<!-- # 160 --><waypoint x="2340" z="4307" type="TRAVEL">	</waypoint>
	<!-- # 161 --><waypoint x="2433" z="4273" type="TRAVEL">	</waypoint>
	<!-- # 162 --><waypoint x="2542" z="4276" type="TRAVEL">	</waypoint>
	<!-- # 163 --><waypoint x="2600" z="4352">	</waypoint>
	<!-- # 164 --><waypoint x="2605" z="4550">	</waypoint>
	<!-- # 165 --><waypoint x="2485" z="4583">	</waypoint>
	<!-- # 166 --><waypoint x="2564" z="4576">	</waypoint>
	<!-- # 167 --><waypoint x="2619" z="4625">	</waypoint>
	<!-- # 168 --><waypoint x="2586" z="4697">	</waypoint>
	<!-- # 169 --><waypoint x="2572" z="4834">	</waypoint>
	<!-- # 170 --><waypoint x="2530" z="4898">	</waypoint>
	<!-- # 171 --><waypoint x="2405" z="4912">
	if StopAtBoss == 3 then
		sendMacro("LeaveParty();");
		yrest(4000)
		waitForLoadingScreen(); 
		player:update();
    	__WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end</waypoint>
	<!-- # 172 --><waypoint x="2564" z="4576" type="TRAVEL">	</waypoint>
	<!-- # 173 --><waypoint x="2619" z="4625">	</waypoint>
	<!-- # 174 --><waypoint x="2586" z="4697">	</waypoint>
	<!-- # 175 --><waypoint x="2572" z="4834">	</waypoint>
	<!-- # 176 --><waypoint x="2530" z="4898">	</waypoint>
	<!-- # 177 --><waypoint x="2405" z="4912">	</waypoint>
	<!-- # 178 --><waypoint x="2212" z="4909">	</waypoint>
	<!-- # 179 --><waypoint x="2170" z="4911">	</waypoint>
	<!-- # 180 --><waypoint x="2147" z="4912">	    if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    
	</waypoint>
	<!-- # 181 --><waypoint x="2019" z="4913">	</waypoint>
	<!-- # 182 --><waypoint x="1902" z="4954">	</waypoint>
	<!-- # 183 --><waypoint x="1839" z="5011">  </waypoint>
	<!-- # 184 --><waypoint x="1682" z="5008">	</waypoint>
	<!-- # 185 --><waypoint x="1625" z="5085">	</waypoint>
	<!-- # 186 --><waypoint x="1624" z="5205">	</waypoint>
	<!-- # 187 --><waypoint x="1663" z="5243">	</waypoint>
	<!-- # 188 --><waypoint x="1858" z="5178">	</waypoint>
	<!-- # 189 --><waypoint x="1989" z="5178">	</waypoint>
	<!-- # 190 --><waypoint x="2059" z="5074">	</waypoint>
	<!-- # 191 --><waypoint x="2125" z="5007">	</waypoint>
	<!-- # 192 --><waypoint x="2253" z="4961">	</waypoint>
	<!-- # 193 --><waypoint x="2315" z="4966">	</waypoint>
	<!-- # 194 --><waypoint x="2355" z="5010">	</waypoint>
	<!-- # 195 --><waypoint x="2425" z="5047">    if inventory:itemTotalCount(0) == 0 then    
    sendMacro("LeaveParty();");
     yrest(4000)
    waitForLoadingScreen(); 
    player:update();
    __WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
    end    
	</waypoint>
	<!-- # 196 --><waypoint x="2508" z="5130">	</waypoint>
	<!-- # 197 --><waypoint x="2595" z="5143">	</waypoint>
	<!-- # 198 --><waypoint x="2645" z="5192">	</waypoint>
	<!-- # 199 --><waypoint x="2642" z="5395">	</waypoint>
	<!-- # 200 --><waypoint x="2587" z="5438">	</waypoint>
	<!-- # 201 --><waypoint x="2419" z="5441">	</waypoint>
	<!-- # 202 --><waypoint x="2364" z="5320">	</waypoint>
	<!-- # 203 --><waypoint x="2359" z="5216">	</waypoint>
	<!-- # 204 --><waypoint x="2283" z="5104">	</waypoint>
	<!-- # 205 --><waypoint x="2191" z="5129">	</waypoint>
	<!-- # 206 --><waypoint x="2157" z="5211">	</waypoint>
	<!-- # 207 --><waypoint x="2160" z="5301">	</waypoint>
	<!-- # 208 --><waypoint x="2199" z="5383">	</waypoint>
	<!-- # 209 --><waypoint x="2256" z="5463">
	sendMacro("LeaveParty();");  
	           yrest(4000)	waitForLoadingScreen();	</waypoint>
<!-- going to sold out -->	
	<!-- # 210 --><waypoint x="-15147" z="11542" y="136" tag="rerun">
if not player:hasBuff ("May Establish Honor Party") then 
inventory:useItem(202879); 
end
    while not RoMScript("UnitExists('party1')") do
        sendMacro('InviteByName("Alter")');
        yrest(4000)
    end
    if (not player:hasBuff("506687")) then
    inventory:useItem(207203);
    end  

	if (not player:hasBuff("506686")) then
    inventory:useItem(207202);
    end 

	if (not player:hasBuff("506684")) then
    inventory:useItem(207200);
    end 
    
    player:mount();
	if ToPancer == 1 then
		__WPL:setWaypointIndex(__WPL:findWaypointTag("Pancer1"));
	end
	if ToPancer == 2 then
		__WPL:setWaypointIndex(__WPL:findWaypointTag("Pancer2"));
	end
	</waypoint>

	<!-- # 211 --><waypoint x="-15764" z="11358" type="RUN" tag="Pancer1">	</waypoint>
	<!-- # 212 --><waypoint x="-15967" z="11304" type="RUN">	</waypoint>
	<!-- # 213 --><waypoint x="-16078" z="11312" type="RUN">	</waypoint>
	<!-- # 214 --><waypoint x="-16249" z="11327" type="RUN">	</waypoint>
	<!-- # 215 --><waypoint x="-16450" z="11350" type="RUN">	</waypoint>
	<!-- # 216 --><waypoint x="-16607" z="11365" type="RUN">	</waypoint>
	<!-- # 217 --><waypoint x="-16618" z="11352" type="RUN"> changeProfileOption("HARVEST_DISTANCE", 200);  
	yrest(100);
	player:merchant("Pancer");
	if player:openStore("Pancer") then 
       for i, item in pairs(inventory.BagSlot) do
         if (item.Worth > 222) then
            item:use() 
         end
      end
   end  
	yrest(100);
	ToPancer = 2
	__WPL:setWaypointIndex(__WPL:findWaypointTag("toKS"));
	</waypoint>

	

	<!-- #  1 --><waypoint x="-15134" z="11548" y="161" type="RUN" tag="Pancer2"> </waypoint>
	<!-- #  2 --><waypoint x="-15365" z="11644" y="170" type="RUN">	</waypoint>
	<!-- #  3 --><waypoint x="-15931" z="11922" y="167" type="RUN">	</waypoint>
	<!-- #  4 --><waypoint x="-16431" z="11769" y="158" type="RUN">	</waypoint>
	<!-- #  5 --><waypoint x="-16613" z="11701" y="154" type="RUN">	</waypoint>
	<!-- #  6 --><waypoint x="-16618" z="11352" y="158" type="RUN"> changeProfileOption("HARVEST_DISTANCE", 200);  
	yrest(100);
	player:merchant("Pancer");
	if player:openStore("Pancer") then 
       for i, item in pairs(inventory.BagSlot) do
         if (item.Worth > 222) then
            item:use() 
         end
      end
   end  
	yrest(100); 
	ToPancer = 1
	__WPL:setWaypointIndex(__WPL:findWaypointTag("toKS"));
	</waypoint>

	
	<!-- # 218 --><waypoint x="-16650" z="11463" type="TRAVEL" tag="toKS">	</waypoint>
	<!-- # 219 --><waypoint x="-16836" z="11573" type="TRAVEL">	</waypoint>
	<!-- # 220 --><waypoint x="-17141" z="11250" type="TRAVEL">	</waypoint>
	<!-- # 221 --><waypoint x="-17448" z="10703" type="TRAVEL">	</waypoint>
	<!-- # 222 --><waypoint x="-17668" z="10680" type="TRAVEL">	
	if player.Class1 == 5 or player.Class2 == 5 then -- priest
		while (80 > player.HP/player.MaxHP*100) do
			player:cast("PRIEST_URGENT_HEAL");
			yrest(2300);
		end
	end
	if player.Class1 == 8 or player.Class2 == 8 then -- druid
		while (80 > player.HP/player.MaxHP*100) do
			player:cast("DRUID_RECOVER");
			yrest(2300);
		end
	end
	</waypoint>
	<!-- # 223 --><waypoint x="-17936" z="10586" type="TRAVEL"> player:mount();	</waypoint>
	<!-- # 224 --><waypoint x="-18160" z="10707" type="TRAVEL">	</waypoint>
	<!-- # 225 --><waypoint x="-18288" z="11068" type="TRAVEL">	</waypoint>
	<!-- # 226 --><waypoint x="-18416" z="11681" type="TRAVEL">	</waypoint>
	<!-- # 227 --><waypoint x="-18546" z="12468" type="TRAVEL">	</waypoint>
	<!-- # 228 --><waypoint x="-18549" z="12522" type="TRAVEL">	changeProfileOption("MAX_TARGET_DIST", 90);	
	yrest(30000);	
	player:update();
	yrest(30000);
	</waypoint>

	
</waypoints>


Re: Allmost foolproof KS run

Posted: Sun Mar 25, 2012 10:32 pm
by rock5
AhKePal wrote:Almost every time i run this script my char goes crazy after entering the portal. This is my file:
A good idea is to see what waypoint it it trying to go to when it starts going "crazy". You might find that it is still trying to go to the last waypoint before going through the portal. You could try adjusting the coordinates of the entry point or some of the usual solutions involving pressing the forward key but recently I wrote a userfunction for going through portals based on BillDoorNZ observation that you can target portals like any other object. This is probably the most reliable way to enter portals to-date. Here is the function.
http://www.solarstrike.net/phpBB3/viewt ... 171#p36171

To use it, add it to your userfunctions folder and then at a waypoint in front of the portal (not inside it) add

Code: Select all

GoToPortal()
waitForLoadingScreen()

Re: Allmost foolproof KS run

Posted: Mon Mar 26, 2012 1:48 pm
by BillDoorNZ
rock5 wrote:
AhKePal wrote:Almost every time i run this script my char goes crazy after entering the portal. This is my file:
A good idea is to see what waypoint it it trying to go to when it starts going "crazy". You might find that it is still trying to go to the last waypoint before going through the portal. You could try adjusting the coordinates of the entry point or some of the usual solutions involving pressing the forward key but recently I wrote a userfunction for going through portals based on BillDoorNZ observation that you can target portals like any other object. This is probably the most reliable way to enter portals to-date. Here is the function.
http://www.solarstrike.net/phpBB3/viewt ... 171#p36171

To use it, add it to your userfunctions folder and then at a waypoint in front of the portal (not inside it) add

Code: Select all

GoToPortal()
waitForLoadingScreen()

I've noticed the 'going crazy' behavior too. From my testing of this, it seems that the player:update call where it detects that the player address has changed.

After it detects this (line 3026 of player.lua) it seems to run through to line 3098 (reading pet pointer) which works fine but it then makes a call to CPawn(self.PetPtr) and as yet I haven't debugged into that to see where about's it is failing in there. I will try to take a look at it today :) To resolve it I added a:

Code: Select all

player = CPlayer.new();
call after the waitForLoadingScreen call. e.g.:

Code: Select all

		printf("should be heading in");
		
		while (getZoneId() == 6) do
			GoToPortal(200);
			waitForLoadingScreen(10);
		end

		printf("Loading profile\n");
		loadProfile(toonProfile);
		player = CPlayer.new();
		sendMacro("ReadSkills()");
the ReadSkills call is to force DIYCE to re-read the skills list - I use DIYCE to run my combat and spam a key to make it run - so it runs faster than the bot for combat (and handles AutoShot too) tho this can cause problems with the bot not realising the enemy is dead etc - but it works 99% of the time.