You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


This forum will be permanently shut down on Friday 13.07.2018
Please copy or save all important information from old forum before they will be deactivated
We have moved to new board. https://forum.runesofmagic.gameforge.com/Come join us.

1

Saturday, September 6th 2014, 2:24am

Help with condensing the macro

right now I have a macro that checks the hp of people in focus and than tell me about it I would like to condense it so I could possible add more commands to it.

Source code

1
2
3
/script if PctH("focus1")<=0.70 then SendChatMessage("heal tank!", "say") end 
/script if PctH("focus2")<=0.50 then SendChatMessage("heal offtank!", "say") end 
/script if PctH("focus3")<=0.60 then SendChatMessage("heal rogue!", "say") end

I tried to condense it to

Source code

1
/run for i=1,3 do PctH("focus",i)<=0.70 then /w Bilall heal i end 

but it couldn't understand ("focus",i) and /w parts at all.

Thanks in advance

bleedingblak

I'm here to troll you

Posts: 1,232

Location: www.youtube.com/user/ihavetourettesxx

Mood: Crying

  • Send private message

2

Saturday, September 6th 2014, 2:27am

I can't help you condense it because I'm an idiot, but what I can do is recommend an addon that increases the limit of characters for addons to 767 instead of 255.

http://www.curse.com/addons/rom/extendedmacroicons


~Fly into the distance, disappear for awhile~

3

Saturday, September 6th 2014, 5:35pm

a condensed version of the macro you have isn't going to do exactly the same thing, and to make it do the same requires more than what you posted. Using your attempt, it will heal a target if their hp is lower then 70%, which is not the same as the original 3 lines of code.



PHP Source code

1
/run for i=1,do if PctH("focus"..tostring(i))<=0.70 then SendChatMessage("Heal "..tostring(i), "WHISPER",_,"Bilall"end end


Should do what your posted example does, but again, not the same as the first 3 lines of code.



I suggest referring to http://runesofmagic.gamepedia.com/List_of_Functions when you go to make newer macros. If you want to see if there's a way to send a whisper, you can search that page for "whisper", "chat", "message", "tell" w/e until you find a result that does what you want.

This post has been edited 1 times, last edit by "BlankMinded" (Sep 6th 2014, 5:41pm)


Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

4

Sunday, September 7th 2014, 1:59am

There are many ways this could be condensed, but either you will lose some functional detail (as examplified by BlankMinded), or you will require some external support (typically in Lua form).

For this last, I suggest going over my Macro guide stickied at the top of this sub-forum (The New Macro Guide). It covers many advanced features including creating your own slash commands. The links in the guide are dated and will likely not work, but the rest is fine.

Anyway, with a bit of Lua support, your entire macro could boil down to a single slash command.
2013... The year from hell....

RoMage

rustyx is lame rogue

Posts: 2,694

Location: web

Occupation: DB Admin

Mood: Unsure

  • Send private message

5

Sunday, September 7th 2014, 9:17am

I sugest to stay away from focus, rather use Raid1 or Party1. Focus resets every time you go into instance/exit instance or move too far away from your focus.

6

Wednesday, September 17th 2014, 1:17am

Thank you all for the help

7

Friday, September 19th 2014, 11:20am

right now I have a macro that checks the hp of people in focus and than tell me about it I would like to condense it so I could possible add more commands to it.

Source code

1
2
3
/script if PctH("focus1")<=0.70 then SendChatMessage("heal tank!", "say") end 
/script if PctH("focus2")<=0.50 then SendChatMessage("heal offtank!", "say") end 
/script if PctH("focus3")<=0.60 then SendChatMessage("heal rogue!", "say") end

I tried to condense it to

Source code

1
/run for i=1,3 do PctH("focus",i)<=0.70 then /w Bilall heal i end 

but it couldn't understand ("focus",i) and /w parts at all.

Thanks in advance


Source code

1
/run a,b={.7,.5,.6},{"tank","offtank","rogue"} for i=1,3 do if PctH("focus"..i)<=a[i] then SendChatMessage("heal "..b[i].."!", "SAY") end end

That should do exactly what your first macro does.
You could replace the SendChatMessage part with

Source code

1
SendChatMessage("heal "..b[i].."!","WHISPER",0,"Bilall")
if you wanted to whisper to Bilall ^^ But there might be some problems with spamming messages too often...

Source code

1
/run a,b,c={.7,.5,.6},{"tank","offtank","rogue"},"" for i=1,3 do if PctH("focus"..i)<=a[i] then c=c.."heal "..b[i].."!\n" end end if c~="" then SendChatMessage(c,"SAY") end
This should take care of the spamming issue xD

This post has been edited 2 times, last edit by "hoffmale" (Sep 19th 2014, 11:26am)