[MacroMod] Periodic Trade Messages Macro

Discussion in 'Basic Tutorials' started by 3point, Aug 9, 2015.

  1. Monkeyz505

    Monkeyz505 Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Feb 11, 2013
    Messages:
    1,734
    Trophy Points:
    32,140
    Gender:
    Male
    EcoDollars:
    $0
    Ratings:
    +512
    An amazing creation :D Thank you, 3point!
     
  2. Monkeyz505

    Monkeyz505 Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Feb 11, 2013
    Messages:
    1,734
    Trophy Points:
    32,140
    Gender:
    Male
    EcoDollars:
    $0
    Ratings:
    +512
    *NOTE*
    Do not try to edit or mess with the scripts unless you know what you're doing. You will probably end up breaking it, and if you try running a command you could get kicked for spam.

    I learned the hard way...
     
  3. zr2002

    zr2002 Nub Moderator
    Resident ⛰️ Ex-EcoLeader ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Aug 17, 2014
    Messages:
    5,474
    Trophy Points:
    63,660
    Gender:
    Male
    EcoDollars:
    $0
    Ratings:
    +3,161
    @3point14mp I added some stuff in code to get something like this:




    Tested it, works 100%

    If you want it you can pm me in-game :D
    Changes to True if you are advertising
    Changes to False if not
    Changes to False onJoinGame

    Thanks to @314 for helping me with this before this came out with my own macro xD
     
    #23 zr2002, Aug 17, 2015
    Last edited: Aug 17, 2015
  4. stoler202

    stoler202 Builder
    Builder ⛰️ Ex-President ⚒️⚒️

    Joined:
    Aug 3, 2012
    Messages:
    1,701
    Trophy Points:
    32,660
    EcoDollars:
    $0
    Ratings:
    +471
    So, can anyone tell me how people write these scripts?
     
  5. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,963
    Trophy Points:
    87,660
    EcoDollars:
    $27,000,000
    Ratings:
    +4,866
    :X3:
    Search for "Minecraft macro tutorial". Alternatively, ask one of the two Pis to write a script. :p
     
  6. ScarabCoder

    ScarabCoder Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Sep 12, 2015
    Messages:
    305
    Trophy Points:
    15,790
    Gender:
    Male
    Ratings:
    +235
    Very cool!
    How in the world did you get those custom commands with a macro though? I MUST KNOW!
     
  7. Turt201444444444

    Builder ⛰️ Ex-President ⚒️⚒️

    Joined:
    Apr 15, 2014
    Messages:
    1,067
    Trophy Points:
    26,590
    Gender:
    Male
    Ratings:
    +1,101
    I changed it to "created by turt" and whenever I start advertising it says "get some ****** cash motha ******
     
  8. kkenmots02

    kkenmots02 Builder
    Builder ⛰️ Ex-Resident ⚒️

    Joined:
    Jan 7, 2014
    Messages:
    153
    Trophy Points:
    19,740
    Gender:
    Male
    Ratings:
    +40
    i r8 8/8 m8 best thing on my macro pl8 :p
     
  9. Joshuwat

    Joshuwat Builder
    Builder ⛰️ Ex-President ⚒️⚒️

    Joined:
    Oct 23, 2015
    Messages:
    510
    Trophy Points:
    14,090
    Gender:
    Male
    EcoDollars:
    $0
    Ratings:
    +602
    @3point14mp, whenever I press the macro key so the ad stops, I can't show it again because it thinks it still has not been 3 minutes. It always stops around 129 seconds. If you could fix this, please do!

    Here is a screenshot of /ad info.


    and here of the key I pressed and /ad info
     
    #29 Joshuwat, Jan 18, 2016
    Last edited: Jan 18, 2016
  10. RealRichNixon

    RealRichNixon Pres. Richard Nixon by day, GameAdmin by night.
    Mythic ⚔️ I ⚔️ Game Admin EcoLegend ⛰️⛰️⛰️⛰️ Ex-President ⚒️⚒️ Prestige ⭐ II ⭐ Premium Upgrade

    Joined:
    Oct 17, 2013
    Messages:
    1,138
    Trophy Points:
    68,910
    Gender:
    Male
    Ratings:
    +395
    10/10 macro
     
  11. Heptik

    Heptik Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Oct 17, 2015
    Messages:
    63
    Trophy Points:
    10,400
    Gender:
    Male
    Ratings:
    +16
    I love this macro - it is super useful! :)
     
  12. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,963
    Trophy Points:
    87,660
    EcoDollars:
    $27,000,000
    Ratings:
    +4,866
    I am going to post here because it is still relevant and not even off the first page:

    There are two problems with this macro.
    1. The rules were changed from 180 to 300 seconds.
    2. /Ch qm is not available for everyone.

    I was requested to update the script, I hope @3point14mp doesn't mind that I am posting my updated version here. Both of the problems above have been fixed - which makes the thread quite relevant again.

    Code:
    $${
    IF(@#trade_time<=300)
       SET(@#trade_time,300)
    ENDIF
    IF(%KEYNAME%=="onJoinGame")
        SET(@#trade_failsafe,0)
        UNSET(@tradead)
    ELSEIF(%KEYNAME%!="onSendChatMessage")
        IF(@tradead);
            LOG("&7[Tr] &eYou stopped advertising.")
            UNSET(@tradead)
        ELSE
            IF((%@#trade_failsafe%>=1) && (%@#trade_failsafe%<300))
                LOG("&7[Tr] &cYou have recently advertised under 5 minutes ago.")
            ELSE
                LOG("&7[Tr] &aYou started advertising.")
                SET(@tradead)
                #i=1
                DO()
                    IF(@tradead==false)
                        UNSET(@trade_breaknow)
                        DO()
                        INC(@#trade_failsafe)
                        WAIT(1000ms)
                        IF(@trade_breaknow)
                            UNSET(@trade_breaknow)
                            BREAK
                        ENDIF
                        WHILE(@#trade_failsafe<=300)
                        BREAK
                    ENDIF
                    @#trade_failsafe=#i
                    IF(#i==1)
                       ECHO("/ch tr")
                       WAIT(1000ms)
                        IF(@&tradead1!="")
                            ECHO("%@&tradead1%")
                        ENDIF
                       WAIT(1000ms)
                        IF(@&tradead2!="")
                            ECHO("%@&tradead2%")
                        ENDIF
                       WAIT(1000ms)
                       ECHO("/ch g")
                    ENDIF
                    WAIT(1000ms)
                    INC(#i)
                    IF(#i>%@#trade_time%)
                        #i=1
                    ENDIF
                LOOP
            ENDIF
        ENDIF
    ELSE
        IFMATCHES(%CHAT%, "^/help (ad|ads)")
            FILTER
            LOG(" &e---- &6Help: ad &e-- &6Page &c1 &6of &c1 &e----")
            LOG("&7&lAutomated Advertisements Macro v1.0")
            LOG("&7&oDeveloped by 3point14mp")
            LOG("&3/ad set 1 &bmsg &7- sets your first-line ad message")
            LOG("&3/ad set 2 &bmsg &7- sets your second-line ad message")
            LOG("&3/ad clear &7- clears your stored ad messages")
            LOG("&3/ad clear 1 &7- clears your first-line ad message")
            LOG("&3/ad clear 2 &7- clears your second-line ad message")
            LOG("&3/ad time &bseconds &7- sets time between each ad (minimum 300)")
            LOG("&3/ad info &7- displays stored ads and the status of your macro")
        ENDIF
        IFMATCHES(%CHAT%, "^/ad set 1$")
            FILTER
            LOG("&fSets your first of two allowable trade ads.")
            LOG("&f/ad set 1 <message>")
        ENDIF
        IFMATCHES(%CHAT%, "^/ad set 2$")
            FILTER
            LOG("&fSets your second allowable trade ad.")
            LOG("&f/ad set 2 <message>")
        ENDIF
        IFMATCHES(%CHAT%, "^/ad set 1 ")
            FILTER
            MATCH(%CHAT%, "^/ad set 1 (.+)",{&newad})
            @&tradead1=%&newad%
            LOG("&7[Tr] &b&oFirst-line Trade Ad Set To")
            LOG("&7[Tr] &f%&newad%")
            @#trade_failsafe=0
            @trade_breaknow=true
        ENDIF
        IFMATCHES(%CHAT%, "^/ad set 2 ")
            FILTER
            MATCH(%CHAT%, "^/ad set 2 (.+)",{&newad})
            @&tradead2=%&newad%
            LOG("&7[Tr] &b&oSecond-line Trade Ad Set To:")
            LOG("&7[Tr] &f%&newad%")
            @#trade_failsafe=0
            @trade_breaknow=true
        ENDIF
        IFMATCHES(%CHAT%, "^/ad clear$")
            FILTER
            @&tradead1=""
            @&tradead2=""
            LOG("&7[Tr] &dCleared First/Second-line Trade Ads")
            @#trade_failsafe=0
            @trade_breaknow=true
        ENDIF
        IFMATCHES(%CHAT%, "^/ad clear 1$")
            FILTER
            @&tradead1=""
            LOG("&7[Tr] &dCleared First-line Trade Ad")
            @#trade_failsafe=0
            @trade_breaknow=true
        ENDIF
        IFMATCHES(%CHAT%, "^/ad clear 2$")
            FILTER
            @&tradead2=""
            LOG("&7[Tr] &dCleared Second-line Trade Ad")
            @#trade_failsafe=0
            @trade_breaknow=true
        ENDIF
        IFMATCHES(%CHAT%, "^/ad time$")
            FILTER
            LOG("&fSets the time between ads. Must be at least 300 seconds.")
            LOG("&f/adtime <seconds>")
        ENDIF
        IFMATCHES(%CHAT%, "^/ad time ")
            FILTER
            MATCH(%CHAT%,"^/ad time (.+)",{&newtime})
            SET(#newtime,%&newtime%)
            IF(#newtime<300)
                LOG("&7[Tr] &cError: Must keep ads at least &e300 &cseconds apart")
            ELSE
                @#trade_time=%#newtime%
                LOG("&7[Tr] &aSet time between ads to &e%#newtime% &aseconds")
            ENDIF
        ENDIF
        IFMATCHES(%CHAT%, "^/ad info")
            FILTER
            IF((@&tradead1=="") && (@&tradead2==""))
                LOG("&7[Tr] You do not currently have any trade ad messages.")
            ELSE
                LOG("&7[Tr] Your planned ad messages are")
                IF(@&tradead1!="")
                    SPLIT(" ","%@&tradead1%",&split[])
                    FOR(#j,4,75)
                        IF(&split[%#j%]=="");
                           BREAK;
                       ENDIF
                        SET(&split[%#j%],"&7%&split[%#j%]%)
                    NEXT
                    JOIN(" ","&split[]",&t1)
                    LOG("&7[Tr] &fFirst-line: &7%&t1%")
                ENDIF
                IF(@&tradead2!="")
                    SPLIT(" ","%@&tradead2%",&split2[])
                    FOR(#j,4,75)
                        IF(&split2[%#j%]==""); BREAK; ENDIF
                        SET(&split2[%#j%],"&7%&split2[%#j%]%)
                    NEXT
                    JOIN(" ","&split2[]",&t2)
                    LOG("&7[Tr] &fSecond-line: &7%&t2%")
                ENDIF
                LOG("&7[Tr] &6Scheduled time between ads: &e%@#trade_time% &6seconds")
                IF((%@#trade_failsafe%>0) && (%@#trade_failsafe%<=300))
                    LOG("&7[Tr] &6Status: &cYour last automated ad was &e%@#trade_failsafe% &cseconds ago")
                ELSE
                    LOG("&7[Tr] &6Status: &aMacro ready to use")
                ENDIF
            ENDIF
        ENDIF
    ENDIF
    }$$
    
     
  13. AdmiralD

    AdmiralD IsleTradingCo
    President ⛰️⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ V ⭐ Premium Upgrade

    Joined:
    Jul 26, 2013
    Messages:
    6,105
    Trophy Points:
    97,160
    Gender:
    Male
    Ratings:
    +4,290
    any chance you could get one to:
    if @Expipiplusone auto shutdown for 15 minutes? :D
    or if player posts (not just expip) sooner than 15 minutes - /ignore player x? :roflmao:
     
  14. Expipiplusone

    Expipiplusone Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Sep 13, 2014
    Messages:
    1,592
    Trophy Points:
    37,590
    Gender:
    Male
    Ratings:
    +778
    15 minutes? When was this changed? I knew it was changed from 5 to 10, and I updated as soon as I noticed; now I checked the wiki and it says 5 mins again :confused:
    (btw, I don't use this macro, so you can't disable me from here :p I use one I wrote myself which cycles through different messages advertising for different stuff, so my messages appear again after something like 70 minutes or more, depending on the base delay and the amount of different messages)
     
  15. ScopicX

    ScopicX Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Jan 19, 2016
    Messages:
    1,233
    Trophy Points:
    17,290
    Gender:
    Male
    Ratings:
    +854
    I know this was 5 months ago...but does this still work? Whenever I do /help ad, it doesn't do anything.
     
  16. Monkeyz505

    Monkeyz505 Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Feb 11, 2013
    Messages:
    1,734
    Trophy Points:
    32,140
    Gender:
    Male
    EcoDollars:
    $0
    Ratings:
    +512
    It does, but it uses /ch qm tr, which you need patron rank to use.
     
  17. GoatsRMeLife

    GoatsRMeLife Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️

    Joined:
    Jun 7, 2016
    Messages:
    441
    Trophy Points:
    13,690
    Gender:
    Male
    EcoDollars:
    $0
    Ratings:
    +342

    Use 314 code that I have quoted
     
  18. samiwarbler

    samiwarbler Sheep Queen
    Mayor ⛰️⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ I ⭐ Premium Upgrade

    Joined:
    Oct 25, 2014
    Messages:
    1,023
    Trophy Points:
    49,410
    Gender:
    Female
    Ratings:
    +552
    I used that code myself, but something still isn't working. I have patron, but it still keeps telling me I've already advertised in the last five minutes.
     
  19. DanieliMurphy

    DanieliMurphy Builder
    Builder ⛰️ Ex-President ⚒️⚒️

    Joined:
    Apr 30, 2014
    Messages:
    786
    Trophy Points:
    22,440
    Gender:
    Male
    EcoDollars:
    $0
    Ratings:
    +163
    Does this still work?
     
  20. GoatsRMeLife

    GoatsRMeLife Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️

    Joined:
    Jun 7, 2016
    Messages:
    441
    Trophy Points:
    13,690
    Gender:
    Male
    EcoDollars:
    $0
    Ratings:
    +342