Enhanced Functionality!

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Enhanced Functionality!

#21 Post by rock5 » Fri Dec 03, 2010 6:48 am

Just checked. Looks like it is in fact a function, list_waypoint_files(). Just have to see if I understand how to add an option to the paused state.
  • 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
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Enhanced Functionality!

#22 Post by jduartedj » Fri Dec 03, 2010 8:48 am

rock5 wrote:

Code: Select all

Paused. (DEL) to continue, (CTRL+L) exit to shell, (CTRL+C) quit (CTRL+W) load new waypoint file

Exactly THAT's What I meant! and where I was saying interrupt i meant like you do with pause! So yes, BINGO!
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Enhanced Functionality!

#23 Post by rock5 » Fri Dec 03, 2010 6:19 pm

jduartedj wrote:
rock5 wrote:

Code: Select all

Paused. (DEL) to continue, (CTRL+L) exit to shell, (CTRL+C) quit (CTRL+W) load new waypoint file

Exactly THAT's What I meant! and where I was saying interrupt i meant like you do with pause! So yes, BINGO!
I've added it to my todo list but I'll have to ask Administrator about how to add a key to the list as I don't quite follow it. :)
  • 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
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Enhanced Functionality!

#24 Post by jduartedj » Fri Dec 03, 2010 7:05 pm

rock5 wrote:
jduartedj wrote:
rock5 wrote:

Code: Select all

Paused. (DEL) to continue, (CTRL+L) exit to shell, (CTRL+C) quit (CTRL+W) load new waypoint file

Exactly THAT's What I meant! and where I was saying interrupt i meant like you do with pause! So yes, BINGO!
I've added it to my todo list but I'll have to ask Administrator about how to add a key to the list as I don't quite follow it. :)

I'm pretty sure I've seen a function that does this... it captures the keys if they are CTRL+L etc... not sure where ... if in bot or MM.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

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

Re: Enhanced Functionality!

#25 Post by Administrator » Fri Dec 03, 2010 8:01 pm

It is currently hard-coded into lib.lua. I'll work on modifying the code to allow scripts to dynamically insert global hotkeys.

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Enhanced Functionality!

#26 Post by jduartedj » Fri Dec 03, 2010 8:07 pm

Here Rock5 it must be something like this:

at the end function pauseCallback use:

Code: Select all

while(true) do
   yrest(10);
   if( keyPressed(key.VK_CONTROL) and keyPressed(key.VK_W) ) then
        (code to go back)
   end
end
this is what MM uses for keytesting/pausing.... and pauseCallback is the function that is called (on rom-bot) on pause so....

I havent tested it anyway, I'm just hinting a shot at this.

(Could this work?)
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Enhanced Functionality!

#27 Post by jduartedj » Fri Dec 03, 2010 8:22 pm

jduartedj wrote:

Code: Select all

while(true) do
   yrest(10);
   if( keyPressed(key.VK_CONTROL) and keyPressed(key.VK_W) ) then
        (code to go back)
   end
end
OOPSS this disables PAUSE (CTRL+L) need to break it or maybe call [EDIT:]exit on CTRL+L
EDIT2: FIXED but resume isn't working either .... - this does it as CTRL+C doesn't need to be specified

Code: Select all

	while(true) do
		yrest(10);
		if( keyPressed(key.VK_CONTROL) and keyPressed(key.VK_W) ) then
			printf("Code to execute\n");
		end
		if( keyPressed(key.VK_CONTROL) and keyPressed(key.VK_L) ) then
			exitCallback();
			break;
		end

	end
I have realised this works fully with:

Code: Select all

		if( keyPressed(settings.hotkeys.START_BOT.key) ) then --Settings is Is always loaded here
			printf("Press DEL again.\n");
			break;
		end
include but this is not supposed to be here at all :S
Basically I'm doing MM's work for it! this evaluation is supposed to be done in MM like Admin said.
Also this code requires pressing DEL twice and only works after the settings are loaded (which makes sense btw).
This code is very sloppy because it generates useless trash (duplicates) and I can't bypass that....
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Enhanced Functionality!

#28 Post by rock5 » Sat Dec 04, 2010 12:18 am

This is getting over the head for me but I'm sure Administrator will work it out.
  • 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
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Enhanced Functionality!

#29 Post by jduartedj » Sat Dec 04, 2010 3:30 pm

After a way-too-big amount of effort I was able to workaround and do sucessfully make the bot return to the waypoint list and start another waypoint file.

But like admin said this change has to be done at MM level.
This workaround is very sloppy and messy.

first I used:

Code: Select all

	while(true) do
		yrest(10);
		if( keyPressed(key.VK_CONTROL) and keyPressed(key.VK_W)) then
			printf("Press DEL twice, flag set to %s\n", player.free_flag1);
			player.free_flag1 = true
			return;
		end
		if( keyPressed(key.VK_CONTROL) and keyPressed(key.VK_L)) then
			exitCallback();
			return;
		end
		if( keyPressed(settings.hotkeys.START_BOT.key) ) then
			printf("Press DEL again.\n");
			return;
		end
	end
at the end on function pauseCallback() in functions.lua file

then I had to put this:

Code: Select all

		if player.free_flag1  == true then  --my code
			__WPL=nil;
			printf("Restarting... %s\n", player.free_flag1);
			player.free_flag1 = false;
			return botting(); --tail call
		end
at the beggining of

Code: Select all

while(true) do
in the bot.lua file

and finally add:

Code: Select all

function botting()
after

Code: Select all

		-- end of local function list_waypoint_files()
and put:

Code: Select all

end --end of botting
botting();
at the end of main().

Works but not so great... so I DON''T advise ppl to use it!
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Enhanced Functionality!

#30 Post by jduartedj » Sat Dec 04, 2010 4:03 pm

2 - Include the Waypoint path file in the title bar!
By including this:

Code: Select all

		if (__WPL) then --test if not nil use "and option==true" to set it optional
			if (__WPL.FileName) then --test if not nil either in case of wander
				waypoint = "<"..__WPL.FileName.."> ";
			end
		end
on function timedSetWindowName(profile) of functions.lua inside the Existing IF, adding

Code: Select all

local waypoint=" "
before such IF and replacing displayname argument of sprintf for waypoint..displayname I get the name of the waypoint file on the title bar. My suggestion is to make this optional but I don't know whats the take on this matter by Admin or any RoM Bot developer.

EDIT:
use this instead it's better, but if you use wander then it'll show <<NONE>>:

Code: Select all

		if (__WPL) then --not nil use "and option =true" to set it optional
				waypoint = "<"..__WPL:getFileName().."> ";
		end
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

Post Reply

Who is online

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