Minigame status

Talk about anything in Runes of Magic. This does not need to pertain to botting.
Post Reply
Message
Author
BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Minigame status

#1 Post by BillDoorNZ »

Anyone know how to determine if a character has run the minigames for that day? I could probably just see if the choice option leads to them teleporting into the instance, but that seems a little inefficient.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Minigame status

#2 Post by rock5 »

I don't think there is any other way to know. That's what my scripts do. Just try to go in and if it fails then assume you already done it for the day.
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Minigame status

#3 Post by lisa »

My guess is a function is called when you initiate dialog with a NPC, something along the lines of the checkquest() which basically alters which NPC is visible or not when you enter certain areas.
So it will alter what text options you have, pure guess of course, I don't have the time to investigate it.
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
BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Minigame status

#4 Post by BillDoorNZ »

lisa wrote:My guess is a function is called when you initiate dialog with a NPC, something along the lines of the checkquest() which basically alters which NPC is visible or not when you enter certain areas.
So it will alter what text options you have, pure guess of course, I don't have the time to investigate it.
slacker!!!! ;)

I imagine you are correct however....might have to extract the lua files and start digging - the joy! But in the interim I'll settle for the ugly method :)

Having a look at where to get housekeeper data from too, found the frame etc, now just need to see where rom pulls the value from as I'm working on a script to auto-chat and develop housekeepers. My current method is a bit ugly.

Code: Select all


CController = class(
	function(self)
		self.DEBUG = true;
		self.config = {};
		
		--Daily Quest to run
		self.config.daily = {};
		self.config.daily.Id = 424180;
		self.config.daily.StarterId = 118072;
		self.config.daily.StarterZone = 14;
		self.config.daily.EnderId = 118072;
		self.config.daily.EnderZone = 14;
		
		--Housemaid types
		local housemaids = {};
		local maid = {id=113803, run="1,5", type="cooking", name="Mila Black"};
		table.insert(housemaids, maid);
		
		maid = {id=113776, run="1,3", type="battle", name="Istolil Hill"};
		table.insert(housemaids, maid);
		
		maid = {id=113799, run="1,6", type="crafting", name="Clark Zorlan"};
		table.insert(housemaids, maid);
		
		self.config.housemaids = housemaids;
		self.config.housemaidsLastDone = nil;
		
		
		--State
		self.actionList = CQueue(true);
		self.currentAction = nil;

		--EVENTS
		self.events = {};
		--event to fire when a waypoint is complete so i can figure out what to do next
		self.events.onComplete = function(_state)
			if (_state == WPT_EVENT_FINISHED) then
				--remove from action list --> need a queue here
				self.currentAction = nil;
				self:Think();
			end;
		end;
		
		self.think = {};
		self.think.lastCallTime = os.time();
	end
);

function CController:Think()
	self:print("==============\nTHINK\n==============");
	self:print(tostring(self.think.lastCallTime));
	local time = os.time();
	local elapsed = time - self.think.lastCallTime;
	self.think.lastCallTime = time;
	
	if (self.currentAction) then
		self:print("currentAction: "..tostring(self.currentAction.name));
	else
		self:print("currentAction: None");
	end;
	self:print("actionList.Empty: "..tostring(self.actionList:isEmpty()));
	if (self.currentAction) then
		--check for errored state (stuck etc)
		self:print("  Perfoming an action - do nothing new");
		return;
	end;
	--we aint doing nuffink!
	--if we currently have a plan of action, then do that
	if (not self.actionList:isEmpty()) then
		self:print("  Moving on to next action");
		--are we still performing the current action? or are we ready to move on to the next action;
		self:SetAction(self.actionList:pop());
		return;
	end;
	
	--figure out what to do
	--order: develop housekeeper/plants etc, daily, mini's, other stuff
	if (not self:HasCompletedDailies()) then
		self:print("  Aint done dailies");
		local wpl = self:buildPathToNPC(self.config.daily.StarterZone, self.config.daily.StarterId);
		local dailyWPL = CWaypointList();
		local paths = self:getQuestFile(self.config.daily.Id);
		if (#paths > 0) then
			local questFile = getExecutionPath().."/waypoints/quests/"..tostring(self.config.daily.Id)..".xml";
			dailyWPL:load(questFile, true);
			dailyWPL.notifyOfEvent = self.events.onComplete;
			
			--load the daily script
			if (wpl and dailyWPL) then 
				self.actionList:push(self:buildAction("Run to Dailies", wpl));
				self.actionList:push(self:buildAction("Do Dailies", dailyWPL));
				self:print("ActionList.Count: "..self.actionList:count());
			end;
			return;
		else
			self:print("Could not find waypoint file for daily quest "..tostring(self.config.daily.Id));
		end;
		
	end;
	
	--do we need to do housemaids?
	--have we done them at all yet? or has it been 2 hours?
	--need to also check for potions in backpack
	if ((not self.config.housemaidsLastDone) or ((60*60*2) > os.time() - self.config.housemaidsLastDone)) then
		self:print("  Going to housemaids");
		local wpl = self:buildPathToHouse();
		self:print("Have path to house");
		local command = "";
		for k,v in pairs(self.config.housemaids) do
			command = command.."for i=1,2,1 do\n";
			command = command.."\tplayer:target_NPC("..tostring(v.id)..");\n";
			command = command.."\tsendMacro(\"SpeakFrame_ListDialogOption("..tostring(v.run)..");\");\n";
			command = command.."\tyrest(20);\n"
			command = command.."end;\n\n"
		end;
		self:print("Build command: "..tostring(command));
		local wplExec = self:buildExecuteWPL(command);
		
		--load the daily script
		if (wpl and wplExec) then 
			self:print("Have path to house xml AND execute xml");
			self.actionList:push(self:buildAction("Goto house", wpl));
			self.actionList:push(self:buildAction("Talk to housekeepers", wplExec));
			self:print("ActionList.Count: "..self.actionList:count());
		end;
		self:SetAction(self.actionList:pop());
		return;
	end;

	self:print("  Finished");
	
end;

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

Re: Minigame status

#5 Post by lisa »

I spent about 20 mins on house maids, getting the values from memory is actually very easy when searching with CE, trouble is I couldn't find any pointers at all for them.

Might have another look at this another day.
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: Minigame status

#6 Post by rock5 »

Sometimes I think getting some stuff from memory is pointless and only causes head aches come patch day. The main purpose of getting info from memory is to speed things up. Seeing as you seldom talk to npcs, I don't see why you just don't use RoMScripts and in game commands.

This is how I leveled my housemaid.

Code: Select all

function LevelHousekeeper()
	local again

	local DBID, name, sex, character, month, day, horoscope, race,
	Affinity, AffinityMax,
	Charisma, CharismaMax,
	Fatigue, FatigueMax,
	Magic, MagicMax,
	Battle, BattleMax,
	Defense, DefenseMax,
	Cooking, CookingMax,
	Inventive, InventiveMax

	local function LevelOne(skill)
		print("Leveling skill "..skill)
		player:target_NPC(name)
		ChoiceOptionByName(skill)
		again = true
	end

	repeat
		again = false

		DBID, name, sex, character, month, day, horoscope, race,
		Affinity, AffinityMax,
		Charisma, CharismaMax,
		Fatigue, FatigueMax,
		Magic, MagicMax,
		Battle, BattleMax,
		Defense, DefenseMax,
		Cooking, CookingMax,
		Inventive, InventiveMax = RoMScript("Houses_GetServantInfo( 1 )")
if name =="" or name == nil then player:sleep() end
		if Fatigue > 85 then
			-- Too tired to do any more
			break
		elseif Fatigue > 75 then
			-- Can only increase Affinity
			if Affinity < 49 then
				LevelOne("Chat")
			end
		else
			if Inventive < Affinity and Inventive < InventiveMax then
				LevelOne("Crafting")
			elseif Affinity < 49 then
				LevelOne("Chat")
			elseif (player.Name == "melee1" or player.Name == "melee2") and Battle < Affinity and Battle < BattleMax then
				LevelOne("Battle")
			elseif (player.Name == "magic1" or player.Name == "magic2") and Magic < Affinity and Magic < MagicMax then
				LevelOne("Magic")
			elseif Defense < Affinity and Defense < DefenseMax then
				LevelOne("Protection")
			end
		end
	until again == false
end
It could be improved for general use but what it does is level afinity and crafting until 50 for the magic pots then starts leveling Battle buff for my melee character and Magic buff for my magic users and then lastly levels Defense buff.
  • 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
BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: Minigame status

#7 Post by BillDoorNZ »

nice, thanks Rock - will steal the romscript (api call) part for my purposes :)
Post Reply