Looking for some Macro Help

Discussion in 'Renaissance Discussion' started by Savage, May 16, 2015.

  1. Savage

    Savage Well-Known Member
    UO:R Donor

    Joined:
    Jan 23, 2015
    Messages:
    270
    Likes Received:
    350
    I'm not great with macros, but I want to learn.(Scroll down to my next Post for a better explanation)

    Ive figured out how to get "for loop" to work, but I'm having trouble getting a "system message" to cut the X number in "for loop" short and move on.

    The Macro is going to be a Fishing Trainer for new fishers, and it needs to run like a "sports car", not the "Yugo" macro I posted and gmed 3 fishers with.

    This is the base code of one cast with for loop working like it should:
    Code:
    Assistant.Macros.ForAction|15
    Assistant.Macros.DoubleClickTypeAction|3520|True
    Assistant.Macros.WaitForTargetAction|3
    Assistant.Macros.TargetRelLocAction|0|-4
    Assistant.Macros.PauseAction|00:00:09
    Assistant.Macros.EndForAction
    That casts 15 times in Rel Loc then moves on.

    What I would like it to do is cast up to 15 times unless the fish are not biting, and move on if not biting.

    I tried adding in-
    for loop=15
    (cast)
    if sys message=biting(fish not biting)
    end if(also tried removing end if keep end for)
    end for(also tried removing end for keep end if)

    Tried-opposite sys message
    for loop=15
    (cast)
    if sys message=a fish(pull a fish)
    if sys message=you fish awhile(no fish)
    else
    if sys message=biting(fish not biting)
    end if/ or end for(and both like above)

    I guess i should be asking IF the for loop can be cut short? or am I going about it all wrong?

    Teach me, or set me on the right path please.

    I am reading Criss's guide to Razor macros, but I seem to need more tutelage.
    Last edited: May 17, 2015
  2. Aris

    Aris Active Member

    Joined:
    Jan 27, 2013
    Messages:
    144
    Likes Received:
    199
    Don't fish in a for loop. The macro should loop by calling itself repeatedly.

    1) fish
    2) check sysmessage and handle condition of they aren't biting, move the boat and pause Long enough for boat to move and issue a stop.
    3) regardless of sysmessage outcome, at the end have the macro execute itself.
  3. Russell

    Russell Well-Known Member

    Joined:
    Feb 12, 2013
    Messages:
    762
    Likes Received:
    385
    or just make it simple...

    double click (fishing pole)
    wait fr target
    target relative location
    pause (whatever the fishing timer is)
    say: forward one
    !loop
  4. Aris

    Aris Active Member

    Joined:
    Jan 27, 2013
    Messages:
    144
    Likes Received:
    199
    As Russell shows there's a basic way to do it or you can get fancy. Once you tinker around with it and get comfortable, feel free to message me if you'd like to add to it. I run a chain of macros that can determine if the boat is stuck, tries to navigate out of it or change direction near shore, and also will hide and wait until it's safe when hostiles are nearby. The autopilot can be quite boring but let's you just fish and handles everything else for you.
  5. Savage

    Savage Well-Known Member
    UO:R Donor

    Joined:
    Jan 23, 2015
    Messages:
    270
    Likes Received:
    350
    Thank you Aris and Russell for replying, I probably should have explained a little more. Simple macros I can handle, this is for a Fishing Dock trainer 30-99.9 skill AFK with no walking involved(sync).

    My goal is a no boat(afk gump) Dock Fishing Trainer that can be easily modified for any dock or land peninsula.

    I have several working macros I used to GM 3 fishers now, but they are very long (26kb-30kb). They fish out 6-8 different spots on a Dock(20 casts per spot) those macros have to be used where they were made. The macro I am trying to build would have 6-8 Target Rel casts to set and use on any dock, which is why I want to use "for loop".
    I have a working version now that uses "for loop" X 15, the problem I have is sometimes the fish don't bite after 7 casts.( Example-another fisher in the same area)
    I can't seem to get sys message="the fish don't seem to be biting here" to stop the "for loop" short of 15 casts and go to the next spot.

    Either I'm not setting the "sys-message" in the right spot with "for loop" or it just may not work with it in one macro. I can use it like it is, but I would like it to be more intelligent.

    The only other Idea I had was to use 6-8 short macros(one for each spot) and have it "call up" the next spot when it was done.
  6. Russell

    Russell Well-Known Member

    Joined:
    Feb 12, 2013
    Messages:
    762
    Likes Received:
    385
    double click (fishing pole)
    wait for target
    target relative location
    pause 7 seconds?
    if system message "are not biting"
    pause 45 minutes...in milliseconds
    end if
    !loop

    that would work for siting at a single dock none stop to gm but would take a lot of time as your wasting about 40 minutes waiting for the resources to refresh. you wouldnt really even need the system message timeout because the macro wont time out from no fish biting and you wouldnt get an afk gump until gm so...

    double click (fishing pole)
    wait for target
    target relative location
    pause 7 seconds?
    !loop

    that would work just as well. If you are going to just stand in one spot find somewhere you can hit 2-3 8x8 from that spot to maximize the gains per resource refresh

    double click (fishing pole)
    wait for target
    target relative location 1
    pause 7 seconds?
    double click (fishing pole)
    wait for target
    target relative location 1
    pause 7 seconds?
    double click (fishing pole)
    wait for target
    target relative location 1
    pause 7 seconds?
    double click (fishing pole)
    wait for target
    target relative location 1
    pause 7 seconds?
    double click (fishing pole)
    wait for target
    target relative location 1
    pause 7 seconds?
    double click (fishing pole)
    wait for target
    target relative location 2
    pause 7 seconds?
    double click (fishing pole)
    wait for target
    target relative location 2
    pause 7 seconds?
    double click (fishing pole)
    wait for target
    target relative location 2
    pause 7 seconds?
    double click (fishing pole)
    wait for target
    target relative location 2
    pause 7 seconds?
    double click (fishing pole)
    wait for target
    target relative location 2
    pause 7 seconds?
    !loop

    many more advanced ways you can set up recalling from dock to dock or add walking in you macro
    Last edited: May 17, 2015
    Savage likes this.
  7. Savage

    Savage Well-Known Member
    UO:R Donor

    Joined:
    Jan 23, 2015
    Messages:
    270
    Likes Received:
    350
    Thanks Russell!
  8. El Horno

    El Horno Well-Known Member
    UO:R Subscriber

    Joined:
    Aug 4, 2014
    Messages:
    3,612
    Likes Received:
    4,899
    an alternative to the walking dysync problem is to use a boats "forward one, back one, left one, etc". These work flawlessly. Then you could have a macro with relative positions that anyone can use w/o changing anything as long as they can get their boat in your exact starting position. Either way this would be an easy macro to write and could be set up to only fish shallow water.

    I have made hour long mining loops that work on boats just moving 1 tile at a time using boat commands, and absolute targets for each vein.
  9. Savage

    Savage Well-Known Member
    UO:R Donor

    Joined:
    Jan 23, 2015
    Messages:
    270
    Likes Received:
    350
    Thanks El Horno. I do like the starting position thing.

    The macros I'm using now are about 20 minutes long now full circle. The only reason I'm trying to keep it dock based is so it can be used fully afk with no gumps all the way to 99.9. That and maybe to save a new player the cost of a Ship until they have 10k to spare.

    When I made my fishers I didn't want to just run a macro waiting for fish to re-spawn in one spot. I tried walking but threw it out of sync, so I added teleport(which didn't use that many regs) and all three moved around the dock all night long without wasting time waiting for re-spawn.

    I thought it was a good idea, I just want to clean it up and make it more user friendly for use anywhere on land. I have several working versions now, one that can be easily modified.
    Maybe I'm just trying to make a tool no one needs, lol

Share This Page