Update

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
droppen
Posts: 179
Joined: Mon Aug 03, 2009 10:32 pm

Update

#1 Post by droppen » Mon Sep 07, 2009 1:42 am

I've made an update to the bot, where it handle's a lot of item functions for you. you no longer have to set the mana and healing potion's key, because it knows what is the best potion in your inventory.
allso:

- auto buy new potions and sticks and stones! (arrows and thrown weapons)
- auto reload. when you run out of sticks or stones. to make this work, you need to configure your onLeaveCombat as shown in the Default.xml
- newer and easier to use create path script.

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: Update

#2 Post by d003232 » Mon Sep 07, 2009 5:53 am

droppen wrote:I've made an update to the bot, where it handle's a lot of item functions for you. ...
Greate work! I feel like christmas :-) Such a lot of new stuff. Couldn't play with all up to now! thx a lot.

I would have a wish for the wishlist. I'm a little economical. So I most like to use the most worse mana/hp potions or that one with the lowest quantity (to save space).

For the addMessage() function I would suggest to use it the same way as by doing it with error messages. Just format the string before using addMessage with sprintf(). By doing that, we wouldn't need different language entries for printing in the MM windows and ingame.

Potion cooldown (player.lua 223: I suppose the reason for being variable was that depending from the type of postion you are using, the cooldown is either 15 or 30 seconds? If we don't read the cooldown from the potions itselfe, we could still leave the cooldown variable as option in the setting.lua file and just delete the option from the default.xml profile. So it would be just an expert option for special cases.
The RoM Bot Online Wiki needs your help!

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Update

#3 Post by Administrator » Mon Sep 07, 2009 6:15 am

d003232 wrote: For the addMessage() function I would suggest to use them analog to the printf(). Means to use the %s. %d, placeholder in the language files. In order to be compatible with the rest? I think within the addMessage we could format and merge the arguments with sprintf() ?
Yes, you should use sprintf() to format the string for addMessage(). You can do that like this:

Code: Select all

addMessage(sprintf("Testing %s, %d", "test string", 1234));

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: Update

#4 Post by d003232 » Tue Sep 08, 2009 5:19 am

I wonder, if we could do a simple check if the new MACRO function works. Means if the user has defined and assigned the dummy macro to the right key.

Just sending a simple macro to get a returncode should work?

I tried something like

Code: Select all

hf_return = RoMScript("return 2;");
but that doesn't work?

EDIT: I do the check now with a function that has defined return values:

Code: Select all

	local hf_return = RoMScript("GetLocation();");
	if( hf_return ~= "DE"  and
	    hf_return ~= "ENUS" and
	    hf_return ~= "ENEU" and
	    hf_return ~= "CN"  and
	    hf_return ~= "JP"  and
	    hf_return ~= "SG"  and
	    hf_return ~= "TR"  and
	    hf_return ~= "TW" ) then
	    	RoMScript("GetPing();");				-- overwrite return values
			cprintf(cli.yellow, language[906] );	-- Define ingame an empty macro 
			local msg = sprintf(language[904], getKeyName(settings.profile.hotkeys.MACRO.key) );
			if( not settings.profile.options.IGNORE_MACRO_ERROR) then	-- only temporary, can be deleted later
				error(msg, 0);
			end
	end
The RoM Bot Online Wiki needs your help!

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Update

#5 Post by Administrator » Tue Sep 08, 2009 9:14 am

Code: Select all

hf_return = RoMScript("2");
Should work. You'll see that the code passed to RoMScript() will be wrapped in a table so that it can return an unlimited number of values.

kizza
Posts: 2
Joined: Tue Sep 08, 2009 12:14 pm

Re: Update

#6 Post by kizza » Tue Sep 08, 2009 12:18 pm

I updated from svn and set up everything according to the wiki, my client crashes when the "new" macro is used.

Code: Select all

Mapping inventory...........Window lost (Client crashed or closed?). You must re
-start the script.
Macro 1 has

Code: Select all

/script r='' a={GetLocation();} for i=1,#a do if a[i] then r=r..tostring(a[i]) end r=r..'	' end EditMacro(2,'',7,r);
Macro 2 has

Code: Select all

ENEU	

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: Update

#7 Post by d003232 » Tue Sep 08, 2009 1:11 pm

kizza wrote:I updated from svn and set up everything according to the wiki, my client crashes when the "new" macro is used.
I would suggest to restart window and look if that error would come again. And it could also help to delete (or rename) your personal Runes of Magic configuration (normaly the folder 'Runes of Magic' in your folder'/my documents/'. It could be that some of your configration files is corrupt. RoM will create them again after you restart RoM.

If so you can set back to an earlier SVN version or set the expert option:

Code: Select all

<option name="IGNORE_MACRO_ERROR" value="true" />
After that you are able to delete the MACRO hotkey and use the old style (if you still have the old hotkeys defined).
The RoM Bot Online Wiki needs your help!

kizza
Posts: 2
Joined: Tue Sep 08, 2009 12:14 pm

Re: Update

#8 Post by kizza » Tue Sep 08, 2009 1:44 pm

And it could also help to delete (or rename) your personal Runes of Magic configuration (normaly the folder 'Runes of Magic' in your folder'/my documents/'. It could be that some of your configration files is corrupt. RoM will create them again after you restart RoM.
Thanks that worked.

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: Update

#9 Post by d003232 » Tue Sep 08, 2009 3:47 pm

There seems some timing bug in RoMScript. I try to open gift bags automaticly. Sometimes, a available bag will not be opended.

The bag is allready there. The levelup happens. I'm using

Code: Select all

local hf_return, hf_itemid, hf_name = inventory:useItem( v.itemid );	-- open bag or equipt item
to open the bag.

I set a printf in the CItem:use():

Code: Select all

	RoMScript("UseBagItem("..self.BagId..");");

	if( settings.profile.options.DEBUG_INV) then	
		cprintf(cli.lightblue, "DEBUG - UseBagItem: %s\n", self.BagId );				-- Open/eqipt item:
	end;
. In the attached screenshot it is the bagid = 69. Everything is ok. As you can see in the folloing inventory:update, the bagid is ok.

So the reason has to be within the RoMScript function.
Attachments
useitem_bug.gif
The RoM Bot Online Wiki needs your help!

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Update

#10 Post by Administrator » Tue Sep 08, 2009 4:23 pm

Maybe it is because of global cooldown or something? Try putting a 1 second rest right before trying to open the bag and see if that helps.

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: Update

#11 Post by d003232 » Tue Sep 08, 2009 5:32 pm

Administrator wrote:Maybe it is because of global cooldown or something? Try putting a 1 second rest right before trying to open the bag and see if that helps.
It looks good! Could have been the reason. I will do more test tomorrow.
The RoM Bot Online Wiki needs your help!

AmonRa
Posts: 15
Joined: Tue Jun 30, 2009 2:38 pm

Re: Update

#12 Post by AmonRa » Wed Sep 09, 2009 3:34 pm

hallo,

@d003232
du hast auf jedenfalls richtig skill!
Bloß ich habe ein Problem mein bot benützt keine mana potionen :(
er sagt immer: "Benutze Manatrank: Empty" -.-
habe hp potions auf "-" und mana potions auf "=" ich finde nicht heraus wo der fehler liegt da mir ja kein wirklicher error angezeigt wird.


danke schon mal im voraus für die Hilfe.


mfg AmonRa

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: Update

#13 Post by d003232 » Wed Sep 09, 2009 4:57 pm

AmonRa wrote:Bloß ich habe ein Problem mein bot benützt keine mana potionen :(
er sagt immer: "Benutze Manatrank: Empty" -.-
habe hp potions auf "-" und mana potions auf "=" ich finde nicht heraus wo der fehler liegt da mir ja kein wirklicher error angezeigt wird.
Die Potions werden nicht mehr über diese 'alten' Hotkeys ausgeührt. Vielmehr gibt es einen neuen allgemienen Hotkey 'MACRO'. Und über die Intentarfunktion werden die besten Potions ermittelt und dann direkt über die RoM API benutzt.

Mache mal einen SVN Update. Und schaue dass der MACRO Hotkey belegt ist. Dazu ingame ein Dummy Makro auf dem ersten Makroplatz. Dann sollte der Bot deine Tränke finden und auch nehmen.
The RoM Bot Online Wiki needs your help!

specture18
Posts: 6
Joined: Mon Aug 31, 2009 3:21 am

Re: Update

#14 Post by specture18 » Wed Sep 09, 2009 7:04 pm

fixed

AmonRa
Posts: 15
Joined: Tue Jun 30, 2009 2:38 pm

Re: Update

#15 Post by AmonRa » Thu Sep 10, 2009 1:38 pm

d003232 wrote:
AmonRa wrote:Bloß ich habe ein Problem mein bot benützt keine mana potionen :(
er sagt immer: "Benutze Manatrank: Empty" -.-
habe hp potions auf "-" und mana potions auf "=" ich finde nicht heraus wo der fehler liegt da mir ja kein wirklicher error angezeigt wird.
Die Potions werden nicht mehr über diese 'alten' Hotkeys ausgeührt. Vielmehr gibt es einen neuen allgemienen Hotkey 'MACRO'. Und über die Intentarfunktion werden die besten Potions ermittelt und dann direkt über die RoM API benutzt.

Mache mal einen SVN Update. Und schaue dass der MACRO Hotkey belegt ist. Dazu ingame ein Dummy Makro auf dem ersten Makroplatz. Dann sollte der Bot deine Tränke finden und auch nehmen.
Es liegt an was anderen :(

Image

Code: Select all

<profile>
	<options>
		<!-- Try the bot with a new char mage or priest         -->
		<!-- At the pioneer village. Use demo.xml waypoint file -->
		<option name="HP_LOW"        	value="50" />
		<option name="MP_LOW_POTION" 	value="50" />
		<option name="HP_LOW_POTION" 	value="40" />

		<!-- Shopping options, how many of what do you want to keep in your inventory -->
		<option name="HEALING_POTION" value="10" />
		<option name="MANA_POTION" value="99" />
		<option name="ARROW_QUIVER" value="0" />
		<option name="THROWN_BAG" value="2" />

		<!-- Rest if HP or Mana is below that level -->
		<option name="HP_REST" value="15" />
		<option name="MP_REST" value="15" />		

		<!-- Combat options -->
		<option name="COMBAT_TYPE"        value="ranged" />	<!-- Choose ranged/melee if not using class default -->
		<option name="COMBAT_RANGED_PULL" value="false" /> <!-- only important for melees -->
		<option name="COMBAT_DISTANCE"    value="200" />
		<option name="MAX_FIGHT_TIME"     value="13" />	<!-- Max time without damage before break -->
		<option name="DOT_PERCENT"        value="90" />
		<option name="ANTI_KS"            value="true" />

		<!-- Attack monsters 3 levels above or 10 below your level -->
		<option name="TARGET_LEVELDIF_ABOVE" value="5" />
		<option name="TARGET_LEVELDIF_BELOW" value="10" />		

		<!-- Waypoint and movement settings -->
		<option name="WAYPOINTS"		value="Beute.xml" />
		<option name="RETURNPATH"		value="" />
		<option name="PATH_TYPE"		value="waypoints" />	<!-- waypoints | wander -->
		<option name="WANDER_RADIUS"		value="500" />
		<option name="WAYPOINT_DEVIATION"	value="0" />
		<option name="QUICK_TURN" 		value="true" />
		
		<!-- Loot settings -->
		<option name="LOOT"               value="true" />
		<option name="LOOT_IN_COMBAT"     value="true" />
		<option name="LOOT_DISTANCE"      value="200" />
		<option name="LOOT_PAUSE_AFTER"   value="0" />

		<!-- Log out and resurrect settings -->
		<option name="LOGOUT_TIME" value="0" />
		<option name="LOGOUT_SHUTDOWN" value="false" />
		<option name="LOGOUT_WHEN_STUCK" value="false" />
		<option name="RES_AUTOMATIC_AFTER_DEATH" value="true" />
	</options>

	<friends>
		<!-- names of friends we help fighting or enemys we don't want to attack -->
		<friend name="MyOtherCharacter1" />
		<friend name="MyOtherCharacter2" />
		<friend name="Elite_Mob_Name1" />
		<friend name="Elite_Mob_Name2" />
	</friends>

	<hotkeys>
		<hotkey name="MACRO"        key="VK_J" />>
	</hotkeys>

	<!-- define your skills depending from your actual primary class -->
	<!-- see the example for a priest/mage respectively mage/priest  -->
	<!-- delete skills you don't have or don't want to use.          -->
	<!-- For more skills to use see /database/skills.xml             -->
	<!-- demo skills for LvL 1 character for all classes             -->
	<skills_mage>
	        <skill name="MAGE_ELECTRIC_BOLT"     	hotkey="VK_3" priority="90" />
	        <skill name="MAGE_FLAME"            	hotkey="VK_2" priority="80" />
	        <skill name="MAGE_FIREBALL"       	hotkey="VK_4" priority="70" />
	        <skill name="MAGE_ESSENCE_OF_MAGIC" 	hotkey="VK_P" priority="60" />
        	<skill name="MAGE_ENERGY_WELL" 		hotkey="VK_0" priority="60" />
        	<skill name="MAGE_ENERGY_SUPPLY" 	hotkey="VK_9" priority="60" />
        	<skill name="MAGE_INTENSIFICATION" 	hotkey="VK_8" priority="60" />
		<skill name="PRIEST_URGENT_HEAL"   	hotkey="VK_6" priority="90" hpper="30"  />
	        <skill name="PRIEST_REGENERATE"    	hotkey="VK_7" priority="100" />
	        <skill name="PRIEST_MAGIC_BARRIER" 	hotkey="VK_I" priority="60" />
	</skills_mage>

	<skills_priest>
	</skills_priest>

	<skills_rogue>
	</skills_rogue>

	<skills_scout>
	</skills_scout>

	<skills_runedancer> 
	</skills_runedancer>

	<skills_druid> 
	</skills_druid>

	<skills_knight>
	</skills_knight>
	
	<onDeath>
		printf("\a\a\a"); -- BEEP BEEP BEEP!
	</onDeath>

	<onLeaveCombat>
		-- Additional Lua code to execute after killing an enemy
	</onLeaveCombat>

	<onSkillCast>
		-- Additional Lua code to execute when casting a skill
		-- Note: arg1 contains the skill being used.
		-- i.e. arg1.Name will be the name of the skill being cast.
	</onSkillCast>
</profile>

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: Update

#16 Post by d003232 » Thu Sep 10, 2009 2:13 pm

AmonRa wrote: Es liegt an was anderen :(
Jep. Aber an was? :-) Ach da war doch was: hier

I suppose thats the bug and reason for showing 'empty'. Perhaps droppen will look for that the next time. If not I will try to look into tommorow or so. Perhaps you can try to do a

Code: Select all

inventory:update;
to rebuild the inventory after some fights in theprofile events or in a waypoint file. That would just be a workaround and I'm not sure if it will works.

And you could set

Code: Select all

<option name="DEBUG_INV"            value="true" />
to get mor informations about the content of your inventory. I suppose that there is still a potion in your bot inventory with amount 0, although there isn't one in your real inventory. That would be a bug.
The RoM Bot Online Wiki needs your help!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests