Uberflex replacement

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

Uberflex replacement

#1 Post by rock5 » Wed Apr 28, 2010 6:45 am

Now that addons like Uberflex and nbuff are dead and buried in the new patch, I thought it would be good to revisit the idea of using rombot in a supporting capacity.

Before I try and tackle something like this I need some questions answered. But first let me explain how I envision it working.
  • I could use use a waypoint file and put all the coding in the onload event.
  • It will loop in the onload event and never leave the onload event while it is running.
  • It will use the skill and buff settings already defined in the profile.
  • It will constantly check the players health and buffs and caste heals and buffs and drinking pots as needed, basically what it usually does out of combat.
  • If it detects you have entered combat it will start using all skills to attack the target then loot it.
  • If you target a mob manually it should not automatically attack it (or maybe it could, with an optional setting) instead I need a way to send a signal from ingame to attack the current mob.
Firstly, does this sound feasible?
Could you give me any pointers as to which current functions I could use and any advice on how I could proceed?
Do you know how I can send a signal to my script? Some sort of macro I guess.
  • 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
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Uberflex replacement

#2 Post by Administrator » Wed Apr 28, 2010 12:25 pm

The problem is that I think it would require some modification (even if it's only a small codecave) to effectively get a list of all nearby players or even just party members. If you're able to figure out a pointer chain for party members, then let me know. I'm trying to avoid any client modification if at all possible.

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

Re: Uberflex replacement

#3 Post by rock5 » Wed Apr 28, 2010 2:23 pm

Administrator wrote:The problem is that I think it would require some modification (even if it's only a small codecave) to effectively get a list of all nearby players or even just party members. If you're able to figure out a pointer chain for party members, then let me know. I'm trying to avoid any client modification if at all possible.
Sorry you've lost me. Who said anything about nearby players?

I don't think I'm asking rombot to do anything it doesn't already do.

All movements and targeting would be done manually and rombot would do the rest as it always does.

I was thinking I could use functions directly. Functions like player:update(), player:fight(), player:loot(), player:rest()

Actually what would happen if I put something like this in the onload event?

Code: Select all

while (true) do
    player:rest(1)
    if( player.Battling == true) then
         player:fight()
    end
end
Looked so simple I had to give it a go, and sure enough it worked. It buffed me and attacked when battle started. Otherwise doesn't move.

Now, for a way to signal it to attack. Some kind of variable or something? Lets try;

Code: Select all

while (true) do
	player:rest(1)
	local trigger=RoMScript("RBTrigger")
	if( player.Battling == true) or trigger=="go" then
		player:fight()
		RoMScript("RBTrigger=nil")
	end
end
Yep that attacks when I press my ingame macro 'RBTrigger="go"' but for some reason RBTrigger never changes back to nil.

So what do you think so far? Do you know why RBTrigger doesn't change? Is there any better way to do any of this?
  • 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
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Uberflex replacement

#4 Post by Administrator » Wed Apr 28, 2010 3:10 pm

Sorry, I misunderstood. I thought you were talking about a full assist bot (one that follows and assists the character you control). What you are suggesting should be able to be done, but might require a lot of modification. I'll give it some thought.

As for your second question, I think it's because of how RoMScript works. You can't assign variables like that in a table*. A workaround is as follows:

Code: Select all

		RoMScript("}variable=value;a={");
Perhaps I'll add a function to only send commands and not return results for issues like this.


*By using "variable=value" inside a table, you are actually creating a dictionary. This will change the key pair for the table; not variables at global (or local) scope.

Perk
Posts: 25
Joined: Fri Dec 18, 2009 12:36 pm

Re: Uberflex replacement

#5 Post by Perk » Wed Apr 28, 2010 3:51 pm

I am very excited that something like this looks do-able and may be in the works!!


thanks!! :)

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

Re: Uberflex replacement

#6 Post by rock5 » Thu Apr 29, 2010 1:09 am

I'm so proud. :D It's working brilliantly.

Below is my script so far.

-- When on --
When the script is running and on it buffs itself and fights back when something attacks it.

-- Attacking --
Once you have set up the "go" macro in game with the following command, you can use it to start attacks or toggle attack mode.

The "go" macro:

Code: Select all

/script RBTrigger="go"
There is 1 user option "isToggle".
When it is false, the "go" macro will start an attack on the current target. It has to be pressed each time.
When it is true, it acts as a attack mode toggle. So the "go" macro turns attack on or off. When on, it automatically attacks anything targeted by the user.

-- Start and Stopping script --
If you want to pause the script, you can use the END and DELETE keys as usual.

Optionally you can also use another macro to stop and start the script.

The "on" macro:

Code: Select all

/script RBTrigger="on"
Note: Just to repeat, you don't need this macro to use this script because it starts in an on state by default.

-- The script --

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<onLoad>
	-- Rock5's Uberflex replacement----------------------
	-- Version 1.0

	-- User Options ------------------------------------
	local isToggle = true
	-- Like uberflex. false- have to trigger each attack
	--                true - trigger turns on/off attack mode
	----------------------------------------------------

	local assistOn = true	-- Used to turn on or off the script
	local attack = false 	-- start with attack off

	while (true) do
		local trigger = RoMScript("RBTrigger")
		if trigger == "on" then
			assistOn = (not assistOn)       -- Toggle on state
			RoMScript("}RBTrigger=nil;a={") -- Reset trigger
		end

		if assistOn == true then            -- Script is on
			player:rest(1)
			if trigger == "go" then
				if isToggle == false then attack = true -- Attack!
				else attack = (not attack) end          -- Toggle attack
				RoMScript("}RBTrigger=nil;a={")         -- Resets trigger
			end
			if( player.Battling == true) or (attack == true) then
				player:fight()
			end
		end
	end
	</onLoad>
</waypoints>
So enjoy.
  • 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

rfehr
Posts: 9
Joined: Thu Apr 29, 2010 6:48 am

Re: Uberflex replacement

#7 Post by rfehr » Thu Apr 29, 2010 6:52 am

Hi rock5,

Could you short explane how to install/use your code?

kind regrads
rfehr

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

Re: Uberflex replacement

#8 Post by rock5 » Thu Apr 29, 2010 7:25 am

rfehr wrote:Hi rock5,

Could you short explane how to install/use your code?

kind regrads
rfehr
For those of you new to rombot the basic instructions are as follows (assumes rombot is already installed and setup);

1. Copy the main script into a text file and save it in the waypoints folder of rombot with an extension of xml, for eg. Rock5.xml
2. Edit the "isToggle" option to your prefered attack method.
3. In game, create at least the "go" macro and assign it to an action button.
4. Start the game. Start micromacro and launch the bot then load the above script as the waypoint file.
5. Press your in game macro to attack or toggle attack mode depending on the value set to "isToggle".

If this description is still too vague for you, you should read up on the rombot basics.
I suggest the following.
Official rombot thread:
http://www.solarstrike.net/phpBB3/viewt ... f=21&t=163
and my favorite, the rombot wiki:
http://www.solarstrike.net/wiki/index.p ... le=RoM_Bot
Last edited by rock5 on Thu Apr 29, 2010 11:49 pm, edited 1 time in total.
  • 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

Perk
Posts: 25
Joined: Fri Dec 18, 2009 12:36 pm

Re: Uberflex replacement

#9 Post by Perk » Thu Apr 29, 2010 8:48 am

reinstalling rom bot tonight to give it a try!! sounds very interesting!! cant wait to give it a go!!

ConcernedCitizen
Posts: 13
Joined: Tue Apr 27, 2010 9:31 pm

Re: Uberflex replacement

#10 Post by ConcernedCitizen » Thu Apr 29, 2010 10:15 pm

I must be dumb.. cause I
1) copied your script into the waypoints folder(Charactername.xml).
2) created a macro for the /script RBTrigger="go" ....
3) I set isToggle, in the Charactername.xml file, to FALSE since I want to do my own fighting, just want the script to do my buffs, potions... I modifed my character profile to not run any attack spells
4) fire up rom/bot.lua and use Charactername.xml as my waypoint file.. and it seems to just lock up...
5) In game, nothing happens...

alternate:

3) I set isToggle, in the Charactername.xml file, to TRUE. I modifed my character profile to not run any attack spells
4) fire up rom/bot.lua and use Charactername.xml as my waypoint file..
5) in game it buffs me like it should, but if I try to walk forward every 1 second it pauses me. Get messages in micromacro saying "Resting for 1 second." "finished resting for 1 second."

Perk
Posts: 25
Joined: Fri Dec 18, 2009 12:36 pm

Re: Uberflex replacement

#11 Post by Perk » Thu Apr 29, 2010 10:35 pm

works well thanks,, I would still LOVE to see my priest autohealing others though!! :P

Concerned,, start the bot as normal,, use his code above as your waypoint script..

(call it whatever you want,, make sure that waypoints are chosen in your profile,,

run rom/bot.lua to start the bot,, press delete to engage it,, now you should have to choose your waypoint file that you just created.. (If you have never run the bot or set up a profile,, you have some reading to do..)

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

Re: Uberflex replacement

#12 Post by rock5 » Thu Apr 29, 2010 11:53 pm

Perk wrote:works well thanks,, I would still LOVE to see my priest autohealing others though!! :P
Good idea. I have thought about it. I'll look into it
Perk wrote:Concerned,, start the bot as normal,, use his code above as your waypoint script..

(call it whatever you want,, make sure that waypoints are chosen in your profile,,

run rom/bot.lua to start the bot,, press delete to engage it,, now you should have to choose your waypoint file that you just created.. (If you have never run the bot or set up a profile,, you have some reading to do..)
Yes, but you should be doing some reading anyway. If you choose not to do any further reading this script is still functional. If you do some reading you reap the benefits of a well tuned profile tailored to your needs and learning things like you can specify a default waypoint file. This thread is about my script, not about how to use scripts. There are a few excellent sources of information about installing, setting up and using rombot. I couldn't hope to match their detail and accuracy. I have included links to more information in the post above anyway. Hopefully that will help.
  • 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

ConcernedCitizen
Posts: 13
Joined: Tue Apr 27, 2010 9:31 pm

Re: Uberflex replacement

#13 Post by ConcernedCitizen » Fri Apr 30, 2010 12:08 am

Well, I have set rombot up, it works flawlessly.. I give it waypoints, it walks around buffs itself, heals itself, kills mobs it autotargets, etc.... I use it all the time to farm for dailies, unattended...

I thought your script was supposed to allow it to auto buff/heal/drink potions.. I just want something that does that for me.. Ill do the fighting... You know, I go into an instance with friends and we are fighting, etc... I just want something to cast buffs on myself, and auto drink a potion... Uberflex used to do this for me.. I can do it myself, but I forget a lot of times to reinitiate my buffs or drink a potion during fights, etc...

I'm not trying to dodge reading something.. In rereading your posts, it looks like you just have the character standing in one place waiting to be attacked? Is that the case? Maybe we're on a different thought pattern.. That's not what I need/want.

GoneInsaneNZ
Posts: 1
Joined: Fri Apr 30, 2010 12:18 am

Re: Uberflex replacement

#14 Post by GoneInsaneNZ » Fri Apr 30, 2010 12:25 am

is there a way to add the command
/script macrocosm();
into the macro that happens when to bot presses the 0 key?
that way every time the bot presses the key uberflex would fire.
Or is it easier to just have another macro with it and tell the bot to spam that key as well?

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

Re: Uberflex replacement

#15 Post by Administrator » Fri Apr 30, 2010 1:03 am

GoneInsaneNZ wrote:is there a way to add the command
/script macrocosm();
into the macro that happens when to bot presses the 0 key?
that way every time the bot presses the key uberflex would fire.
Or is it easier to just have another macro with it and tell the bot to spam that key as well?

Code: Select all

RoMScript("macrocosm()");

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

Re: Uberflex replacement

#16 Post by rock5 » Fri Apr 30, 2010 3:13 am

ConcernedCitizen wrote:I must be dumb.. cause I
1) copied your script into the waypoints folder(Charactername.xml).
2) created a macro for the /script RBTrigger="go" ....
3) I set isToggle, in the Charactername.xml file, to FALSE since I want to do my own fighting, just want the script to do my buffs, potions... I modifed my character profile to not run any attack spells
4) fire up rom/bot.lua and use Charactername.xml as my waypoint file.. and it seems to just lock up...
5) In game, nothing happens...

alternate:

3) I set isToggle, in the Charactername.xml file, to TRUE. I modifed my character profile to not run any attack spells
4) fire up rom/bot.lua and use Charactername.xml as my waypoint file..
5) in game it buffs me like it should, but if I try to walk forward every 1 second it pauses me. Get messages in micromacro saying "Resting for 1 second." "finished resting for 1 second."
The only difference to your setup, that I can see, is you don't have any attack spells. I'm not sure how player:fight() would react to not having any attack spells but before you target or attack anything it shouldn't be triggered. Maybe player:rest() has a problem with not having attack spells? What would happen if you ran a regular waypoint file with no attacks?

isToggle=false doesn't disable attacking only auto attacking. Whenever the bot detects you are in battle, even if you start battle manually, it will attack. The intention of isToggle=false is that after you select a target you would press the macro to start the rombot attack sequence.

My intention was to have isToggle function like the uberflex's 'Manual' switch and in this it mostly succeeds but I didn't think about those that only want this for buffs. I should be able to add another option to disable attacking so it will only buff. An added bonus to this is you should be able to leave your attack spells in your profile because they wont be used.

I'm going out now so it will be a few hours before I can work on 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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Uberflex replacement

#17 Post by rock5 » Fri Apr 30, 2010 2:30 pm

I've make some changes:
  • Added option to disable all attacks and only buff and heal. (Not working at the moment. Read below)
  • Used different wording to make things more clear.
  • Fixed some minor bugs in the logic.
  • Removed the option to stop and start the script with an additional macro as END and DELETE can already be used.
  • Added information messages to the micromacro window and in game chat.
The problem with the disable attack option is, when out of combat player:rest() heals and buffs you but during combat the healing and buffing is done during the player:fight() function. If you stop player:fight() from executing then you wont heal or buff yourself during battle. If you enable fighting but remove all attack spells from your profile it will run up and attack the mob with the standard attack skill.

At this stage I'm hoping the Administrator will have a look and have some suggestions as I don't know his functions as well he does.
Attachments
RBAssist1.1b.xml
(2.03 KiB) Downloaded 307 times
  • 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
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Uberflex replacement

#18 Post by Administrator » Fri Apr 30, 2010 2:51 pm

Looks good to me. Very simple and clean code. About the only suggestion I have is to call player:update() after resting to make sure that the newest information will be used for the next loop. Good work so far!

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

Re: Uberflex replacement

#19 Post by rock5 » Fri Apr 30, 2010 10:08 pm

Administrator wrote:Looks good to me. Very simple and clean code. About the only suggestion I have is to call player:update() after resting to make sure that the newest information will be used for the next loop. Good work so far!
So can you think of any way I can buff during combat without attacking?
  • 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
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Uberflex replacement

#20 Post by Administrator » Sat May 01, 2010 4:11 am

Code: Select all

local target = player:getTarget();
player:checkSkills(false, target);

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests