runforhelp.mac and others - "ALWAYS ON" Macro's.

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

icon
Official loudmouth
Official loudmouth
Posts: 158
Joined: Fri Jun 14, 2002 2:59 pm
Location: ...
Contact:

runforhelp.mac and others - "ALWAYS ON" Macro's.

Post by icon » Thu Jun 20, 2002 1:09 pm

Ok, I suck at this, I will admit it freely, but I'm attempting to come up with a series of macro's that are intended to always be running... to give more info or add more to the game. They are always running, but don't actually do anything until they are needed.

I have written an example macro that I am 99% sure will *NOT* work, so don't actually try it. Corrections and improvements are always welcome. Hell, if someone doesn't correct and improve this, then I probably wont be able to figure out how to write the next few.

Here it goes. This one is supposed to always be running, but only actually makes a check or does anything if $combat == TRUE... meaning you are in a fight. Even then it doesn't actually do anything until your HP drops below your targets... or is equal to. Which is not what I wanted but oh well. Here goes:

Code: Select all

| -RunForHelp.mac- |

Sub Main
  :Checking
    /if $combat == TRUE              // If you are fighting...
      /if n $hp(cur) <= $target(hp)  // AND IF your hp is < or = targets
        /goto :RunLikeHell           // Then go to the :RunLikeHell part
    /if n %hp(cur) > $target(hp)     // IF your current HP is more then targets
      /goto :StayPut                 // Jump to :StayPut
  :StayPut                              
    /echo Your HP:  $hp(cur) / $hp(max)    // Say to user: "Your HP:  xxx / xxx"
    /echo %t's HP:  $target(hp)            // Say to user: "a_gnoll_pup's HP:  xxx"
  :RunLikeHell
    /target Guard                    // Target the nearest guard.
    /face                            // Face that guard.
    /press NumLock                   // Run to that guard
    /if $char(class) == "Bard"       // IF you are a bard
      /if n $char(level) >= 5        // AND IF you are above level 4
        /cast 1                      // Cast first song (assumes speed song)
/return
Now as you can see it's slapshod, buggy, and I probably loaded it with mistaken assumptions and misconceptions on how to write certain parts of a macro.

What I *wanted* it to do, was always be running, and if it happens to notice you are in a fight, every... oh... 5 seconds or 10 seconds or so it would report your current HP, and your target's current HP... and if you are both around 25% health, and you have the same HP, or you have less then your target, the macro will automatically target the nearest Guard or Sentinal or Dragoon or whatever and run to it and cower behind it.

Now obvious this doesn't even come close, so I'm going to need some help improving, rewriting, or at least clearing up misconceptions on how to do these things :-).

Thanks in advance

- Icon
In memory of [b][color=darkblue]MasTerKeyZ[/b][/color].

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Thu Jun 20, 2002 1:26 pm

Salutations,
I edited the macro, this should work...

Code: Select all

|     -RunForHelp.mac-     |
| By Icon                  |
| Edited to work by l124rd |

Sub Main
  :Checking
   /if $combat == TRUE /if n $hp(cur) <= $target(hp) /goto :RunLikeHell
   /if n %hp(cur)>target(hp) /goto :StayPut
   /delay 50
   /goto :checking

  :StayPut                             
   /echo Your HP:  $hp(cur) / $hp(max)
   /echo $target(name)'s HP:  $target(hp)
   /goto :checking

  :RunLikeHell
   /target Guard
   /face
   /sendkey down up
   :runloop
    /face
    /if $char(class) == "Bard" /if n $char(level) >= 5 /cast 1
    /if $target(distance)>=15 /goto :runloop

/return

icon
Official loudmouth
Official loudmouth
Posts: 158
Joined: Fri Jun 14, 2002 2:59 pm
Location: ...
Contact:

Post by icon » Thu Jun 20, 2002 1:44 pm

Thanks a bunch L124RD!

I wasn't aware I could nest multiple commands on the same line like that. That simplifies things, I was getting sick of indenting so damn far :P

Anyway, also might wanna include a couple more checks... like if it did NOT target a guard, it should NOT take off running. It should hit ESC before trying to target the guard. It should attempt to target more then just "guard", if that doesn't work it should also try for "sentinal" and "dragoon" and any other NPC prefixes that count as a guard. Not to mention this particular macro would be hell for everfrost, since a few times you'd end up running directly at the Gnoll Guards outside of BB :-/

Or even inside BB, there's the gnoll guardsmans everywhere that this macro would run you to.

Also, it should be able to so something like /checkforbuff "Spirit of Wolf" and if that returns TRUE then skip, if it returns FALSE then /target me /cast "Spirit of Wolf".

I know /cast "Spirit of Wolf" and /checkforbuff aren't real commands, but I was looking for a Macroquest equivelent if there is one.

My master plan, eventually, is to have like 20 macro's running at all times, that check for a million different situations and act accordingly. If you are enchanter and your mez breaks... remez instantly. If it has been XXX seconds since you last mezzed a_mob_01 then remez it. If a group member falls below XXX hp, target and heal with most appropriate healing spell. etc etc etc... eventually we'll have macro's this way that can handle virtually all surprises and hassles, and leave us to do the normal playing.

Of course, having a macro for a class like Monks or Wizards that can level the charactors completely from 1 to 60, solo, in like a week of non-stop macroing.... something like that is what will eventually come of MQ... but it will be one hell of a long macro :-).

Either way, writing these "always on" AKA "emergency" macros that handle all kinds of surprises and situations will make it much easier to incorperate them into existing macros or macros we make in the future, thereby making all future macro's more and more 'foolproof' and safe.

For example, what would you do if you were on vacations for a week, and wanted to leave cheese.mac on the whole time? That would be fine and all, but what if an hour after you leave, someone blasts and kills Granger. Or better yet, someone attacks him and Granger kills him, but is now moved to a different location. Maybe even underwater. Well, my goal is to eventually have enough "if" places and checks for virtually every concievable situation, and having the macro'd charactor be able to handle almost anything thrown at him.

Of course, after that, we'd have to start teaching our macro's to speak english, so that they can talk to people they group with. :twisted:

- Icon
In memory of [b][color=darkblue]MasTerKeyZ[/b][/color].

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Thu Jun 20, 2002 1:57 pm

Salutations,
I was actually, er... working on that macro that talks with people but... shh!
Currently you cannot run more the one macro. If you run /macro runforhelp.mac and then /macro cheese.mac, you will end up exiting runforhelp.mac and running runforhelp.mac AGAIN, but (if you log things) logging under cheese.mac.log.

icon
Official loudmouth
Official loudmouth
Posts: 158
Joined: Fri Jun 14, 2002 2:59 pm
Location: ...
Contact:

Post by icon » Thu Jun 20, 2002 2:07 pm

A couple more examples that wont work in their current form, they have to be adapted to suit the needs of whatever macro they are used in.

***Something*** means a command or check that I don't know how to do.

Code: Select all

| -YourNPCHasMoved.mac- |

Sub Main
  :Checking
    /if $target(distance) > 15 /face
    /if $target(distance) > 15 /press Numlock
    /if $target(distance) <= 15 ***Do Nothing***
/return
What this one is trying to do should be obvious. Check and see if your NPC has moved out of range for whatever reason, then follow it and run to it and continue.

Code: Select all

| -YourNPCHasBeenKilled.mac- |

Sub Main
  :Checking
    /if $target(exists) == FALSE /sit
    /if $target(exists) == FALSE ***Wait for $target(exists) == TRUE***
    /when $target(exists) == TRUE /mac YourMacro.mac
/return
This one simply checks to see if your NPC has been slain or despawned or no longer exists at that time, then waits for it to respawn before running the macro you were trying to do.

Code: Select all

| -YourNPCdoesn'tTalkToYou.mac- |

Sub Main
  :Checking
    /hail %t
    /if $target(reply) == ***Faction too low*** /echo Your faction is too low for this Macro
    /if $target(reply) == ***Correct Reply** /mac YourMacro.mac
/return
This one is somewhat of a faction checker, that pretty much HAS to be tailored to a specific NPC in order to work.

These macros should be more updated and stuff, and 'smarter' before actually used.... these are just basically ideas at this point.

Does anyone else see what I'm trying to get at? I want to be able to run a macro like cheese.mac or a quest one, and do it over and over, and not even glance at my computer for a week, and when I come back it will still be doing the macro because it's smart enough to take alot of things into account.

And for safety:

Code: Select all

| -GMSendsATell.mac- |

Sub Main
  :Checking
    /if ***LastLineOfText*** == $chat(tell) /goto :RecieveTell
    /if ***LastLineOfText*** != $chat(tell) ***DoNothing***
  :RecieveTell
    /who /reply (Do a who on whoever shows up on /reply)
    /goto :CheckItOut
  :CheckItOut
    /if who == $gm /reply Sorry, I am really laggy... logging to clear lagg.
    /if who != $gm /reply Sorry, I cannot talk, I'm busy.
    /if ***No one shows up in /who list**** /reply Sorry, I am really laggy, logging to clear lagg.
    /sit
    /delay 20
    /camp
    /unload
/return
This one takes for granted that anyone who sent you a tell, but doesn't appear in /who list is an anonymous GM.

Obviously this one is slapshod and wont work, but by looking at my syntax, (even tho it's incorrect), you can easily figure out exactly what it's trying to do.

Hopefully you all get my point by now, and maybe even will correct and make usable my ideas. Ideas I'm good at, scripting I'm not.

Imagine that, I can code in C++, but this script is over my head. Go figure.

- Icon
In memory of [b][color=darkblue]MasTerKeyZ[/b][/color].

icon
Official loudmouth
Official loudmouth
Posts: 158
Joined: Fri Jun 14, 2002 2:59 pm
Location: ...
Contact:

Post by icon » Thu Jun 20, 2002 2:12 pm

Ok, I just read L124rd's post, and let me clarify what I mean by "Always On"... I mean macros that can be easily inserted into ANY OTHER macro no matter what it does and work just as well. They may not even be related at ALL into the macro they are used under, but this way several different things can be done at once.

Also, another feature of MacroQuest if Plazmic is listening... how about letting us run a few macro's at the same time? I could see where that could get nasty, but make the last one running always override the rest, so if one wants to keep macroing, but the last one wants to camp or "/end 1 (end the first macro)" then it supercedes the rest.

Then again, thinking about it, I'm not sure it would be all that possible. Nevermind. :roll:

- Icon
In memory of [b][color=darkblue]MasTerKeyZ[/b][/color].

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Thu Jun 20, 2002 2:33 pm

Code: Select all

| -YourNPCHasMoved.mac- |
| by Icon               |
| edited by l124rd      |
Sub Main
  :Checking
   /if n $target(distance) > 15 /goto :goto
   /goto :checking

   :goto
    /sendkey down up
    :gotoloop
     /face
     /if n $target(distance)>15 /goto :gotoloop
    /sendkey up up
    /goto :checking
/return

Code: Select all

| -YourNPCHasBeenKilled.mac- |
| by icon                    |
| Edited by l124rd           |

Sub Main
  /varset v0 0
  :Checking
   /if "$target()"=="FALSE" /if n $v0==0 /sit
   /if "$target()"=="FALSE" /if n $v0==0 /varset v0 1
   /if "$target()"=="TRUE" /if n $v0==1 /goto :mobback
   /goto :checking

  :mobback
   /stand
   /varset v0 0
   /macro yourmac.mac
   /goto :checking
/return

Code: Select all

| -YourNPCdoesn'tTalkToYou.mac- |
| by icon                       |
| Edited by l124rd              |

#chat say

Sub Main
    /hail 
    /varset v1 0
    :eventloop
     /doevents
     /varadd v1 1
     /if n $v0!=1 /if n $v1<700/goto :eventloop
     /if n $v1==700 /echo Your faction is too low for this Macro
/return

sub event_chat
 /if "$p1"=="$target(name) /goto :npcreply
 /return
 
 :npcreply 
  /varset v0 1
  /macro yourmacro.mac
/return

Code: Select all

| -GMSendsATell.mac- |
| by icon            |
| edited by l124rd   |
#chat tell

Sub Main
  :Checking
   /doevents
   /goto :checking
/return

sub event_chat
 |this doesn't work since there is no $who var yet, though i think i'll submit a feature request for it.
 |if there was a $who with that variable with that syntax it should work.
 /if n $who($p1,gm)>0 /goto :itsagm
 /if n $who($p1,gm)==0 /goto :itsnotagm
 
 :itsnotagm
  /reply I'm sorry, I'm busy, I'll talk to you later perhaps...
  /mqlog $p0 | $p1: $p2
  /return

 :itsnotagm
  /reply Sorry, I am really laggy... logging to clear lagg.
  /sit
  /delay 10
  /camp
  /endmacro
  /endmacro
/return

LincolnsAura
decaying skeleton
decaying skeleton
Posts: 1
Joined: Thu Jun 20, 2002 4:44 pm

Post by LincolnsAura » Thu Jun 20, 2002 4:47 pm

will there be a delay between the initial tell and the reply on the gmsendsatell macro? Just wondering because it would seem REAL fishy if i sent a tell to you and you replied right after with a bunch of text.....


|_ /\

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Thu Jun 20, 2002 5:52 pm

Salutations,
Currently the gmsend tell DOES NOT WORK! this is because the macro has no way to tell wether or not they are a gm. All the code works except for the $who part, this is psuedo code for the moment. currently the macro doesn't have a delay either... though that is a good idea...

icon
Official loudmouth
Official loudmouth
Posts: 158
Joined: Fri Jun 14, 2002 2:59 pm
Location: ...
Contact:

Post by icon » Sat Jun 22, 2002 4:05 pm

I thought of that too, but I figured it would be a waste of time until the macro is workable anyway :)

- Icon
In memory of [b][color=darkblue]MasTerKeyZ[/b][/color].