Page 1 of 1

HELP!

Posted: Sun Dec 06, 2015 9:19 am
by miahiscool34
Edited see last update at bottom

Re: HELP!

Posted: Sun Dec 06, 2015 11:07 pm
by lisa
If in doubt add prints.

So it works fine until the boss fight.

Code: Select all

  player:findTarget("Okander \"Mad Man\" Mallen");
   local target = player:getTarget();
   
   if target then table.print(target) else print(" I have no target and this is the broken code....") end

   player:update(); 
   player:cast("WARDEN_CHARGED_CHOP");
Also there must be more code than that or it errors because that "end" in the section with boss fight would make it error.

Re: HELP!

Posted: Mon Dec 07, 2015 2:05 pm
by miahiscool34
Okay, sorry I am new to programming, but I usually can fix something with trial and error and the wiki page, but I am unsure about this one. Could you elaborate a bit, on the no target? do I have to add a ID in

Re: HELP!

Posted: Mon Dec 07, 2015 3:15 pm
by miahiscool34
What I get is
The game client did not crash.
Character: Goldenstrikés
2015-12-07 15:13:49 - ...unes Of Magic\micromacro\rom-bot\rom-bot-master\/bot.lua:1006: Failed to compile and run Lua code for waypoint #10

and I tried the print, and it didn't even print it so I'm assuming the error is before the print?

Re: HELP!

Posted: Mon Dec 07, 2015 3:31 pm
by miahiscool34
My confusion is with the elites, in order for them to be attacked, they are aggroed by going through them, or near them. The script was older and made for a hard solo battle so it wouldn't walk close enough to the boss to aggro it, as well as made for a magees extra range. I made a waypoint closer to the boss and added it in, however when an elite is aggroed using the code

Code: Select all

player:findTarget("Incomplete Bloody Beast");
	local target = player:getTarget();

	player:cast("WARDEN_CHARGED_CHOP");
	player:cast("WARDEN_CHARGED_CHOP");
will kill it, and loot it

so why if I do the same thing for the boss will it not kill the boss?

Code: Select all

player:findTarget("Okander \"Mad Man\" Mallen");
   local target = player:getTarget();
   
   player:cast("WARDEN_CHARGED_CHOP");
	player:cast("WARDEN_CHARGED_CHOP");
	player:cast("WARDEN_CHARGED_CHOP");
	player:cast("WARDEN_CHARGED_CHOP");




UPDATE:

I fixed this problem

Re: HELP!

Posted: Mon Dec 07, 2015 4:18 pm
by miahiscool34
Update, I got it to complete a run... now it does everything right except I will not loot the boss


Code: Select all

<waypoints type="NORMAL">

	-- V 1.4 DoD Firts Boss  --
	-- Many thanks to Rock5, Lisa and Xmen ;) -- 
	
	--Reymauro--
<onLoad><![CDATA[

function vortex()
         keyboardHold(settings.hotkeys.MOVE_FORWARD.key)
         yrest(1000);
         keyboardRelease(settings.hotkeys.MOVE_FORWARD.key)
         waitForLoadingScreen(5)
      end
	  
function trash_mob()
   local target = player:getTarget()
   local _tm = false
   local spawn = player:findNearestNameOrId("Incomplete Bloody Beast")
   if spawn then
      player:target(spawn)
      if target.HP > 0 then
		player:fight()
         _tm = false
      else
         _tm = true
      end
   else
      _tm = true
   end
   return _tm
end

function trash_boss()
   local target = player:getTarget()
   local _tb = false
   local spawnboss = player:findNearestNameOrId("Okander \"Mad Man\" Mallen")
   if spawnboss then
      player:target(spawnboss)
      if target.HP > 0 then
	player:update(); 
	player:cast("WARDEN_CHARGED_CHOP");
	player:cast("WARDEN_CHARGED_CHOP");
	player:cast("WARDEN_CHARGED_CHOP");
	player:cast("WARDEN_CHARGED_CHOP");
	player:cast("WARDEN_CHARGED_CHOP");
	player:cast("WARDEN_CHARGED_CHOP");
	player:cast("WARDEN_CHARGED_CHOP");
	player:cast("WARDEN_CHARGED_CHOP");
         _tb = false
      else
         _tb = true
      end
   else
      _tb = true
   end
   return _tb
end
function updateplayer()
	player:update();
	player:clearTarget();
end
	changeProfileOption("AUTO_ELITE_FACTOR", 2500);
   	changeProfileSkill("WARDEN_CHARGED_CHOP", "AutoUse", true);
	]]>	</onLoad>
	
	<!-- #  1 --><waypoint x="1645" z="-4908" y="752">

sendMacro("LeaveParty();");
yrest(200)
player:update();
while not RoMScript("UnitExists('party1')") do
sendMacro('InviteByName("...")');
end 
changeProfileSkill("WARDEN_CHARGED_CHOP", "AutoUse", true);
changeProfileOption("MAX_FIGHT_TIME", 5);
</waypoint>

	<!-- # 2 --><waypoint x="1686" z="-5152" y="757"> 
	
	player:update();
	vortex()

	</waypoint>	
	<!-- #  3 --><waypoint x="1793" z="2880" y="433">	
	
	changeProfileOption("MAX_FIGHT_TIME", 5);
	printf("Mementos: %s\n", inventory:getItemCount(206879) );
	updateplayer()
	player:lootAll();
	
	</waypoint>
	<!-- #  4 --><waypoint x="1854" z="2891" y="433">	</waypoint>
	<!-- #  5 --><waypoint x="1933" z="2834" y="433">	
	
	repeat
	until trash_mob() == true 
	updateplayer()
	player:lootAll();

	</waypoint>
	<!-- # 6 --><waypoint x="1930" z="2863" y="433"> 
	changeProfileSkill("WARDEN_CHARGED_CHOP", "AutoUse", true);
	changeProfileOption("MAX_FIGHT_TIME", 1);
	</waypoint>
	<!-- # 7 --><waypoint x="2113" z="2615" y="432"> </waypoint>
	<!-- # 8 --><waypoint x="2340" z="2406" y="401">

	
	local cooldown, remaining = RoMScript("GetSkillCooldown(4,1)")
	repeat
	until trash_boss() == true 
	player:lootAll();

</waypoint>
	<!-- # 9 --><waypoint x="2207" z="2498" y="401"> </waypoint>
	<!-- # 10 --><waypoint x="2081" z="2661" y="434"> </waypoint>
	<!-- # 11 --><waypoint x="1897" z="2873" y="433"> </waypoint>
	<!-- # 12 --><waypoint x="1786" z="2890" y="433"> </waypoint>
	<!-- # 13 --><waypoint x="1699" z="2888" y="433">

	updateplayer()
	vortex()
	
	yrest(1000);
	player:update();
	if inventory:itemTotalCount(0) == 0 then
	printf ("Bag Is Full Selling.")
	loadPaths("DoD/DoDS")
	else
	printf ("Bag Not Full Continuing Farming.")
	end
	
	</waypoint>
</waypoints>

Code: Select all

<!-- # 8 --><waypoint x="2340" z="2406" y="401">

	
	local cooldown, remaining = RoMScript("GetSkillCooldown(4,1)")
	repeat
	until trash_boss() == true 
	player:lootAll();

I am assuming this handles the process after the boss dies, I have player:lootAll();
why is it not looting, and runs back? is it because of the skill cooldown that was made for a mage class? Should I remove that?

Re: HELP!

Posted: Mon Dec 07, 2015 4:57 pm
by miahiscool34
Removing the CD did nothing, and I tried adding updateplayer() with no success


on the elites

Code: Select all

<!-- #  5 --><waypoint x="1933" z="2834" y="433">	
	
	repeat
	until trash_mob() == true 
	updateplayer()
	player:lootAll();
I have no issues...
it must treat the boss differently

Code: Select all

<!-- # 8 --><waypoint x="2340" z="2406" y="401">


	repeat
	until trash_boss() == true 
	updateplayer()
	player:lootAll();

Re: HELP!

Posted: Mon Dec 07, 2015 8:41 pm
by BlubBlab
it is called player:update()

Re: HELP!

Posted: Mon Dec 07, 2015 8:53 pm
by miahiscool34
BlubBlab wrote:it is called player:update()

Sorry I should have posted the function

Code: Select all

function updateplayer()
	player:update();
	player:clearTarget();
end

Re: HELP!

Posted: Mon Dec 07, 2015 8:58 pm
by beanybabe
If you are using a loot addon it may need to be set to loot higher loot. lootit is one that comes to mind. it needs enabled and set for boss level loot.

Re: HELP!

Posted: Tue Dec 08, 2015 7:27 am
by Bill D Cat
I've said it before, and I'm sure I'll have to say it again. Posting your character names on the forum increases the likely hood that you will get banned 1000 times over. Please edit the posts to remove the character names.

Administrator's Post on the Subject: http://www.solarstrike.net/phpBB3/viewt ... f=6&t=6129

Re: HELP!

Posted: Tue Dec 08, 2015 10:36 am
by miahiscool34
Thanks bill, and I thought of the loot addon but even with a loot addon it should atleast open up the loot interface, which its not

Re: HELP!

Posted: Tue Dec 08, 2015 11:35 pm
by miahiscool34
Anyone know why it isn't working? I don't usually ask for help but I'm stuck on this one, sorry guys hope I'm not asking to much

Re: HELP!

Posted: Wed Dec 09, 2015 9:52 pm
by lisa
If you want to know why it isn't working then add prints like I suggested in the very first reply to this topic.

Re: HELP!

Posted: Thu Dec 10, 2015 4:03 pm
by miahiscool34
lisa wrote:If you want to know why it isn't working then add prints like I suggested in the very first reply to this topic.
How would I use prints to identify the looting issue?


I don't get any errors, my character just simply doesn't loot the boss

Re: HELP!

Posted: Thu Dec 10, 2015 5:53 pm
by beanybabe
Most the strange thing I run into are timing, Try adding a wait 1000 after the boss check is true before you try to loot. I use waits up to 4000 when checking for npc. Looking at your code you should not need any playerupdate(), I would try commenting them out. The playerupdate() can cause problems avoid using unless needed.

Re: HELP!

Posted: Thu Dec 10, 2015 8:01 pm
by miahiscool34
beanybabe wrote:Most the strange thing I run into are timing, Try adding a wait 1000 after the boss check is true before you try to loot. I use waits up to 4000 when checking for npc. Looking at your code you should not need any playerupdate(), I would try commenting them out. The playerupdate() can cause problems avoid using unless needed.
So I found the issue....

Code: Select all

<option name="LOOT_IN_COMBAT" value="false" />
changed to

Code: Select all

<option name="LOOT_IN_COMBAT" value="true" />