Rombot automatic updates

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

Rombot automatic updates

#1 Post by Lamkefyned »

Hi I wanted to change the file svn update to update automatically every X hours

is this the file that I have k change?

SVN.Update

Code: Select all

--[[
	Options:
		revert	-	Remove all changes made by the user before attempting an SVN update
]]

function checkout()
	warning("TortoiseSVN has not been configured for this path yet. You must do so now.");
	local path = getExecutionPath();
	local cmd = sprintf("TortoiseProc /command:checkout /path:\"%s\" /url:http://rom-bot.googlecode.com/svn/trunk/rom", path);
	system(cmd);

	local msg = sprintf("Completed SVN checkout.");
	printf("%s\n", msg);
	logMessage(msg);
end

function update(options)
	local path = getExecutionPath();
	local msg = sprintf("Attempting SVN update of path \'%s\'", path);
	printf("%s\n", msg);
	logMessage(msg);

	if( options.revert ) then
		-- Revert any changes first
		warning("Reverting user changes...");
		local cmd = sprintf("TortoiseProc /command:revert /path:\"%s\"", path);
		system(cmd);
	end

	local cmd = sprintf("TortoiseProc /command:update /path:\"%s\" /notempfile /closeonend:2", path);
	system(cmd);
end

function main()
	local options = {
		revert = false;
	};
	for i,v in pairs(args) do
		if( v == "revert" ) then
			options.revert = true;
		end
	end

	if( not allowSystemCommands ) then
		error("You must allow system commands in your config file in order to use this script.", 0);
	end

	if( not getDirectory(getExecutionPath() .. "/.svn") ) then
		checkout(); -- Configure the directory for TortoiseSVN
	end

	update(options); -- Perform an SVN update

	printf("Finished. You should now be up-to-date (if no error occured).\n");
end
main();
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: Rombot automatic updates

#2 Post by rock5 »

There shouldn't really be any need. Just update it if you have problems to see if it has been fixed. If you are not having problems and everything is working then you don't need to update.

But if you really want to then an easy way is to run the bat file, "SVN.update.bat", using the Windows scheduler. The downside of this is the commandline console doesn't automatically close and I don't know if it tells you if an error occurred.
  • 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: Rombot automatic updates

#3 Post by Lamkefyned »

but you could do?
If you think something is right just because everyone else believes,you're not thinking.
Post Reply