Question

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Uniden65
Posts: 151
Joined: Thu Aug 20, 2009 5:17 pm

Question

#1 Post by Uniden65 » Sat Sep 12, 2009 8:00 pm

When i die i dont want to do anything but stop the bot so the bot stops but sooner our later it trys to ress it self at revival spot ....this is ok but then all the EVIL pvps attack you while your not there.......:((((

So the question i have is how do i have the bot revive after death then cast a spell since iam a Rogue Hide ....at least that will save me from the lower levels?

-- Testing this Now ..After i reassigned F to Hide?

Code: Select all

	<onDeath>
		-- Additional Lua code to execute on death
                keyboardPress(key.VK_F); 
		pauseOnDeath(); -- Stop the script
	</onDeath>

is there anything i can do like this after death ?

Thanks all for your hard work

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

Re: Question

#2 Post by Administrator » Sat Sep 12, 2009 8:24 pm

This will probably work (if you've got the latest version off of SVN):

Code: Select all

<onDeath>
  -- Additional Lua code to execute on death
  RoMScript("AcceptResurrect();");
  yrest(30000); -- Wait 30 seconds
  RoMScript("CastSkillByName('Hide');");
</onDeath>
Then again, it will probably trigger AcceptResurrect() twice (which you don't want) because of the automatic resurrect options. You could avoid that by disabling automatic resurrect and using that macro, however, I'm not sure how it would react. It might pause the script if automatic resurrection is disabled. I'm sure d003232 would probably know a bit better about this, as he's practically rewrote that system recently.

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

Re: Question

#3 Post by d003232 » Sun Sep 13, 2009 1:58 am

Administrator wrote:You could avoid that by disabling automatic resurrect and using that macro, however, I'm not sure how it would react. It might pause the script if automatic resurrection is disabled. I'm sure d003232 would probably know a bit better about this, as he's practically rewrote that system recently.

Code: Select all

<onDeath>
      sendMacro("AcceptResurrect();");
      yrest(30000); -- Wait 30 seconds
      sendMacro("CastSkillByName('Hide');");
      pauseOnDeath(); -- Stop the script
</onDeath>
Yes you should set

Code: Select all

<option name="RES_AUTOMATIC_AFTER_DEATH" value="false" />
to avoid the automatic resurrect.

remarks
  • the yrest is to wait for the loadscreen to go. You can reduce it to you needs
  • instead of hide and pause you also can use 'player:logout();' or 'player:sleep();'
  • sendMacro() is the same like RoMScript(), it will just add an additional message to your MM window, so you can watch the work
For using 'player:sleep()' I suppose we should add a skill as option. So the bot would cast that skill (hide in this case) and go to sleep. If you got aggro he would awake. After the fight cast again that skill (hide) and go again to sleep. What do you think?

@admin: I didn't know, that there is an API function 'CastSkillByName'. Thats better then using UseSkill("..self.skilltab..","..self.skillnum..");
The RoM Bot Online Wiki needs your help!

User avatar
droppen
Posts: 179
Joined: Mon Aug 03, 2009 10:32 pm

Re: Question

#4 Post by droppen » Sun Sep 13, 2009 3:13 am

d003232 wrote: @admin: I didn't know, that there is an API function 'CastSkillByName'. Thats better then using UseSkill("..self.skilltab..","..self.skillnum..");
I don't think so, because of the german version has different names for spell's

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

Re: Question

#5 Post by d003232 » Sun Sep 13, 2009 3:36 am

droppen wrote:
d003232 wrote: @admin: I didn't know, that there is an API function 'CastSkillByName'. Thats better then using UseSkill("..self.skilltab..","..self.skillnum..");
I don't think so, because of the german version has different names for spell's
ok. So it not good to use for the generic case. Perhaps it accept also the english name in the german version? I will try that later.
The RoM Bot Online Wiki needs your help!

Uniden65
Posts: 151
Joined: Thu Aug 20, 2009 5:17 pm

Re: Question

#6 Post by Uniden65 » Sun Sep 13, 2009 3:53 am

Well RoMScript("CastSkillByName('Hide');"); does not work in Rom it comes back with a lua crash...so ill try your way doo3232 see what happenes :)

GurdyMan
Posts: 34
Joined: Fri Sep 11, 2009 5:34 pm

Re: Question

#7 Post by GurdyMan » Sun Sep 13, 2009 4:21 am

CDWriter wrote:Well RoMScript("CastSkillByName('Hide');"); does not work in Rom it comes back with a lua crash...so ill try your way doo3232 see what happenes :)
RoMScript("CastSkillByName(\"Hide\");");

Does that work?

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

Re: Question

#8 Post by d003232 » Sun Sep 13, 2009 4:26 am

GurdyMan wrote:
CDWriter wrote:Well RoMScript("CastSkillByName('Hide');"); does not work in Rom it comes back with a lua crash...so ill try your way doo3232 see what happenes :)
RoMScript("CastSkillByName(\"Hide\");");

Does that work?
From LUA side yes. (You can use a editor, that marks the lua code. Then you see if all is a big string within lua.).
I'm curious, if it works from the RoM side. Please give feedback.
The RoM Bot Online Wiki needs your help!

GurdyMan
Posts: 34
Joined: Fri Sep 11, 2009 5:34 pm

Re: Question

#9 Post by GurdyMan » Sun Sep 13, 2009 4:54 am

Well, it seems everything is a spell.

sendMacro("CastSkillByName(\"Hide\");"); Doesn't exist as a RoM function, but

sendMacro("CastSpellByName(\"Hide\");"); does and is confirmed as working.

j_schlott
Posts: 119
Joined: Tue Aug 18, 2009 11:42 pm

Re: Question

#10 Post by j_schlott » Tue Sep 29, 2009 3:18 pm

why do you want your char to stay logged in if hes dead/just sitting at the rez stone

i would do as suggested and use player:logout() in the <ondeath> tags,

or this one to close the game completely
RoMScript("QuitGame();");

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest