Rom Bot error

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Rom Bot error

#1 Post by Lamkefyned » Thu May 22, 2014 9:52 am

*I just update everything and delete all my userfunctions and waypoints and change the ingamefunctions and boot the rombot and throws me this error
error.jpg
*ROM BOT R777

*MICROMACRO V1.04.167
If you think something is right just because everyone else believes,you're not thinking.

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

Re: Rom Bot error

#2 Post by rock5 » Thu May 22, 2014 10:15 am

What this means is that in your userfunctions.lua file it does some code when it load, probably a RoMScript, that causes setupMacro to run early when starting the bot. In most cases the bot will still start ok but in some cases this will cause an error or some other strange effect. For example when the game has been patched and the addresses need to be updated, usually the bot updates the addresses when it starts. But because of the code in userfunctions.lua it will cause an error because it tries to do run setupMacro before the addresses have been updated.

The message is just a warning letting you know that a potential problem exists.

Usually userfunction.lua (and userfunctions in the userfunctions folder for that matter) should only create functions, not execute code. If you have to execute code you should be careful what you do.
  • 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

User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Rom Bot error

#3 Post by Lamkefyned » Thu May 22, 2014 10:22 am

without userfunctions throws this error but with userfunctions not

Okey understood Rock5 many thanks
If you think something is right just because everyone else believes,you're not thinking.

User avatar
cibervagos
Posts: 26
Joined: Sat Apr 12, 2014 10:36 pm
Location: Argentina

Re: Rom Bot error

#4 Post by cibervagos » Tue May 27, 2014 7:07 pm

Hi Rock! I have a problem. Some times (many times) my bot get stuck on Clearing Target. I don't know where I need to start looking for. :cry:

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

Re: Rom Bot error

#5 Post by rock5 » Tue May 27, 2014 8:20 pm

ClearTarget is used in a lot of places in the bot so I need to know what it was doing when it got stuck. For now I'll assume it's the one at the end of the fight. Seeing as the bot usually works, maybe you have some bad code in the onLeaveCombat section of your profile?
  • 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

User avatar
cibervagos
Posts: 26
Joined: Sat Apr 12, 2014 10:36 pm
Location: Argentina

Re: Rom Bot error

#6 Post by cibervagos » Wed May 28, 2014 5:08 pm

I have 2 function in my waypoint.

Function 1 (Looking for the Boss)

Code: Select all

function Buscando()
	local jefe = player:findNearestNameOrId(102349); -- Life Leecher (Origin)
	if jefe then
		player:target(jefe);
		local blanco = player:getTarget();
		sendPartyChat('|H|h|cffCC99FFEncontré a |r|cffAA6666'..blanco.Name..'|r|cffCC99FF! con |r|cffFFAAAA'..tostring(blanco.HP)..'|r|cffCC99FF de HP.|r|h')
		RoMScript('SetRaidTarget("target",1);');
		keyboardPress(key.VK_SPACE); -- I jump to avoid an obstacule (if there).
		yrest(600);
		keyboardPress(key.VK_7); -- Pull skill (I have a meele character).
		yrest(3000);
		keyboardPress(key.VK_1); 
		yrest(800);
		blanco:update()
		if blanco.HP > 0 then
			sendPartyChat('|H|h|cffCC99FFA darle rosca!!!!!|r|h')
			repeat
				succionavida = player:findEnemy(nil,102350) -- Summoned Boss
				if succionavida then -- I don't need this for now. I need replace fight loop to use it.
					player:target(succionavida)
					otroBicho = player:getTarget();
					sendPartyChat('|H|h|cffCC99FFMato primero el trucho...|r|h')
					repeat 
						player:fight()
						otroBicho:update()
					until otroBicho.HP == 0 -- Here stuck some time. When combat end. Clearing Target.
				else
					player:target(jefe)
				end
				if 60 > (player.HP/player.MaxHP*100) then -- I don't need this for now. 
					RoMScript("SendChatMessage('|H|h|cffFF4444JUEPUTA!!|r|h', 'SAY')")
				end
				player:fight()
				blanco:update()
			until blanco.HP == 0
			Looteando();
			sendPartyChat('|H|h|cffCC99FFListo|r|h')
			yrest(500)
			succionavida = player:findEnemy(nil,102350)
			if succionavida then
				player:target(succionavida)
				otroBicho = player:getTarget();
				if otroBicho.HP > 0 then
					sendPartyChat('|H|h|cffCC99FFVamos por el otro!|r|h')
					repeat
						player:fight()
						otroBicho:update()
					until otroBicho.HP == 0 -- Here stuck some time. When combat end. Clearing Target.
					sendPartyChat('|H|h|cffCC99FFMuertos los 2.|r|h')
				else
					Looteando(); -- Call loot function
				end
			else
				Looteando();
			end
		else
			blanco:update()
			if blanco.HP == 0 then
				sendPartyChat('|H|h|cffCC99FFParece que esta muerto... a lootear!|r|h')
				Looteando();
			end
		end
	end
end	
Function 2 (Looting the Boss):

Code: Select all

function Looteando()
	player:updateBattling()
	if (not player.Battling) then
		local elBicho = player:findNearestNameOrId(102349)
		if elBicho then
			player:target(elBicho);
			local blanco = player:getTarget();
			if blanco.HP == 0 then
				buffed = player:getBuff(504033) -- looking for root buff
				if buffed then
					sendPartyChat('|H|h|cffCC99FFSe encontro un puto Debuff que impide el looteo.|r|h')
					for index, buff in pairs(player.Buffs) do
						if string.find(buffed.Name,buff.Name,1, true) then
							lefttime=RoMScript("GetPlayerBuffLeftTime(GetPlayerBuff("..index..", 'HELPFUL'))"); -- Try to get debuff remaining time (never work :'( )
							print("Intentando tomar tiempo del buff: "..tostring(lefttime));
							sendPartyChat('|H|h|cffCC99FFAún no puedo tomar el tiempo de |r|cffFFFF88'..buff.Name..'.|r|cffCC99FFPuede ser |r|cffFFAAAA'..tostring((lefttime))..'|r|cffCC99FFseg.??|r|h')
							sendPartyChat('|H|h|cffCC99FFPor las dudas descanso por |r|cffFFAAAA45|r|cffCC99FF seg.|r|h')
							player:rest(45);
							return
						end
					end
				else
					sendPartyChat('|H|h|cffCC99FFNo se encontro Debuff.|r|h')
				end
				sendPartyChat('|H|h|cffAA6666'..blanco.Name..'|r|cffCC99FF está morido. A lootear!!|r|h')
				player:target(elBicho);
				player:loot(elBicho)
				sendPartyChat('|H|h|cffCC99FFDone ;].|r|h') -- Here stuck some time. Clearing Target.
			else
				sendPartyChat('|H|h|cffCC99FFTodavia no se murió??.|r|h')
			end
		end
	end
end
I quit the second function from OnLeaveCombat be couse bot stuck many time. Now I don't have anything in OnLeaveCombat.
Sorry for my english.

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

Re: Rom Bot error

#7 Post by lisa » Wed May 28, 2014 6:01 pm

you have

Code: Select all

               repeat 
                  player:fight()
                  otroBicho:update()
               until otroBicho.HP == 0 -- Here stuck some time. When combat end. Clearing Target.
player:fight() will fight until target is dead or fight reaches time limit set in profile.
So the only reason why you would need to use that repeat loop is if the fight is ending before boss dies due to time limit being reached, if that is the case then just change that value in your profile.

Code: Select all

<option name="MAX_FIGHT_TIME"     	value="30" />
With some bosses it is possible that the bot may think fight is over when it really isn't, HoS boss comes to mind where it becomes impossible to attack it for a period of time and then it comes back, in this case though the bot stays in combat and then when boss comes back again the bot attacks it again, so end result is boss still dies but bot says it killed 2-3 of the boss in it's counting. Either way default bot code still works fine.
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

User avatar
cibervagos
Posts: 26
Joined: Sat Apr 12, 2014 10:36 pm
Location: Argentina

Re: Rom Bot error

#8 Post by cibervagos » Wed May 28, 2014 6:17 pm

Ty Lisa. In my case the Boss desapear and come back in a few seconds summoning a second Boss. So, I will quit the loop and I try changing MAX_FIGHT_TIME. Be couse my Druid need many time to kill that Boss :D

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

Re: Rom Bot error

#9 Post by rock5 » Wed May 28, 2014 8:12 pm

And in future tell us from the beginning that you are using your own code or we will just assume you are talking about the bot code and we'll waste time looking for a problem that isn't there.
  • 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

User avatar
cibervagos
Posts: 26
Joined: Sat Apr 12, 2014 10:36 pm
Location: Argentina

Re: Rom Bot error

#10 Post by cibervagos » Wed May 28, 2014 9:43 pm

rock5 wrote:And in future tell us from the beginning that you are using your own code or we will just assume you are talking about the bot code and we'll waste time looking for a problem that isn't there.
Ok. Sorry for that.

I quit the loop. But bot still doing the same. Stuck on Clearing Target and take 99% of CPU usage. (Note: MM don't back to shell. Just keep on Clearing Target).

I will try one or two thing before going to bed.

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

Re: Rom Bot error

#11 Post by lisa » Wed May 28, 2014 9:57 pm

cibervagos wrote:Stuck on Clearing Target and take 99% of CPU usage
that is because you have a loop with no rests in it so MM will be doing hundreds of memory reads every single second to the point that it goes insane.

The reason it is clearing target is because that is what player:fight() does when it has no target.


You need to look at the boss fight more closely as to what is happening and what you are telling the bot to do in response to that.

Code: Select all

               repeat 
                  player:fight()
                  otroBicho:update()
               until otroBicho.HP == 0 -- Here stuck some time. When combat end. Clearing Target.
So second boss comes out and you tell bot to attack it, that's fine but once the bot thinks second boss is dead you tell it to keep attacking it until it's HP is 0, bad news for you that won't work, the reason why player:fight() ends when the target is lost is because HP doesn't always go to exactly 0, so that is you main issue right there, assuming the HP always goes to 0 when it dies.

As soon as your target is dead the game takes the target away from you, hence why player fight uses that instead of monitoring HP for when to stop attacking. So you need to ask yourself, with boss 2 why would you lose target and boss not be dead?

Maybe try testing with the other pawn functions, such as :isAlive()

Code: Select all

               repeat 
                  player:fight()
                  yrest(100)
               until not otroBicho:isAlive()
but to be honest that is far to simple to work reliably, you will probably need to do a check for if you have a target and if not then to actually target otroBicho and no doubt add in more and more code to make it reliable.
This is why player:fight() is more than 300 lines of code because things go wrong and you need to be able to deal with issues.
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

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

Re: Rom Bot error

#12 Post by rock5 » Wed May 28, 2014 9:59 pm

Lisa beat me, just.

What she said.
  • 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

User avatar
cibervagos
Posts: 26
Joined: Sat Apr 12, 2014 10:36 pm
Location: Argentina

Re: Rom Bot error

#13 Post by cibervagos » Wed May 28, 2014 10:15 pm

Ty for answer so fast :D ! I don't have the loop anymore.
I replace

Code: Select all

 repeat
        player:fight()
       otroBicho:update()
 until otroBicho.HP == 0 -- Here stuck some time. When combat end. Clearing Target.
Just for

Code: Select all

player:fight()
in every loop.

But keep doing the same.

But meaby I can resolve it changing player:fight() with my own fight function. Now Im testing the waypoint without the first function. Just keeping the second.

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

Re: Rom Bot error

#14 Post by rock5 » Wed May 28, 2014 10:23 pm

Maybe you could show us your updated code.
  • 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

User avatar
cibervagos
Posts: 26
Joined: Sat Apr 12, 2014 10:36 pm
Location: Argentina

Re: Rom Bot error

#15 Post by cibervagos » Thu May 29, 2014 4:14 pm

Well, the problem is solved. Lisa was right. I forgot replace one more loop. Now the bot don't stuck anymore on Clearing Target. Unfortunately, the script don't work correctly without the loop. Be couse the combat allways finish before Boss die. So, use this function for fight or use normal waypoint is the same.

Here is my code:

Code: Select all

	function Buscando()
		local jefe = player:findNearestNameOrId(102349);
		if jefe then
			player:target(jefe);
			local blanco = player:getTarget();
			sendPartyChat('|H|h|cffCC99FFEncontré a |r|cffAA6666'..blanco.Name..'|r|cffCC99FF! con |r|cffFFAAAA'..tostring(blanco.HP)..'|r|cffCC99FF de HP.|r|h')
			RoMScript('SetRaidTarget("target",1);');
			keyboardPress(key.VK_SPACE);
			yrest(600);
			keyboardPress(key.VK_7);
			yrest(3000);
			keyboardPress(key.VK_1);
			yrest(800);
			blanco:update()
			if blanco.HP > 0 then
				sendPartyChat('|H|h|cffCC99FFA darle rosca!!!!!|r|h')
				player:fight()
				Looteando();
				sendPartyChat('|H|h|cffCC99FFListo|r|h')
				yrest(500)
				succionavida = player:findEnemy(nil,102350)
				if succionavida then
					player:target(succionavida)
					otroBicho = player:getTarget();
					if otroBicho.HP > 0 then
						sendPartyChat('|H|h|cffCC99FFVamos por el otro!|r|h')
						player:fight()
						sendPartyChat('|H|h|cffCC99FFMuertos los 2.|r|h')
					else
						Looteando();
					end
				else
					Looteando();
				end
			else
				Looteando();
			end
		end
	end	
Next step: Make a new working loop and use my own fighting function (becouse I need interrupt the fight to check party for heals). But I will do it by my self.

Thank you so much Rock and Lisa for your help.

If anyone is interested on this code, just ask for it and I will post the new code. (Or if I get some trouble with the new code I will post here :lol: :P )

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 8 guests