correction for the inbattle option

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

correction for the inbattle option

#1 Post by d003232 » Sat Jul 18, 2009 4:57 pm

Here the correction for the inbattle option. It now works for the values 'true' and 'false'.

skill.lua line 27 from "true" to "":

Code: Select all

		self.InBattle = ""; -- "true" = usable only in battle, false = out of battle
skill.lua, additional coding for 'inbattle=true':

Code: Select all

	-- This skill cannot be used in battle
	if( player.Battling and self.InBattle == false ) then
		return false;
	end

	-- This skill can only be used in battle                 -- NEW LINE
	if( not player.Battling and self.InBattle == true ) then             -- NEW LINE
		return false;                             -- NEW LINE
	end                                                     -- NEW LINE
settings.lua at line 202, replace

Code: Select all

			if( inbattle ) then
				if( inbattle == "true" ) then
					inbattle = true;
				else
					inbattle = false;
				end;
			end
with that

Code: Select all

			if( inbattle ~= nil ) then
				if( inbattle == "true" ) then
					inbattle = true;
				end;
				if( inbattle == "false" ) then
					inbattle = false;
				end;
			end
settings.lua line 228, change

Code: Select all

--			if( inbattle ) then tmp.InBattle = inbattle; end;
			if( inbattle ~= nil ) then tmp.InBattle = inbattle; end;	-- STEPHEN
It is compatible to the existing configuration and you can now use inbattle in your profile like:

inbattle not used:
The cast has no restriction and will be used in battle and out of battle

inbattle = true
The cast will only be used in battle

inbattle = false

The cast will only be used out of battle
The RoM Bot Online Wiki needs your help!

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

Re: correction for the inbattle option

#2 Post by Administrator » Sat Jul 18, 2009 8:07 pm

Thanks for the hard work once again. My only complaint is that it seems you are using spaces instead of tabs. I've changed that (it's never a good idea to mix spaces and tabs). I will be committing this to SVN once I'm finished with these other changes I'm working on.

Post Reply

Who is online

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