Anyone have a working trade ad macro? I cant get https://www.ecocitycraft.com/forum/threads/macromod-periodic-trade-messages-macro.132330/ to work after seeming to install/configuring everything correctly.
314 commented further down in the thread with an up-to-date periodic trade script, he has one for non-patrons and one for patrons.
Here is the code for it, follow all the instructions as listed on the thread then post this instead for the 'Trade.txt' file 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)") LOG(" &e---- &6Help: ad &e-- &6Page &c1 &6of &c1 &e----") LOG("&7&lAutomated Advertisements Macro v1.0") LOG("&7&oDeveloped by 3point14mp, updated by 314.") 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") FILTER ENDIF IFMATCHES(%CHAT%, "^/ad set 1$") LOG("&fSets your first of two allowable trade ads.") LOG("&f/ad set 1 <message>") FILTER ENDIF IFMATCHES(%CHAT%, "^/ad set 2$") LOG("&fSets your second allowable trade ad.") LOG("&f/ad set 2 <message>") FILTER ENDIF IFMATCHES(%CHAT%, "^/ad set 1 ") 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 FILTER ENDIF IFMATCHES(%CHAT%, "^/ad set 2 ") 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 FILTER ENDIF IFMATCHES(%CHAT%, "^/ad clear$") @&tradead1="" @&tradead2="" LOG("&7[Tr] &dCleared First/Second-line Trade Ads") @#trade_failsafe=0 @trade_breaknow=true FILTER ENDIF IFMATCHES(%CHAT%, "^/ad clear 1$") @&tradead1="" LOG("&7[Tr] &dCleared First-line Trade Ad") @#trade_failsafe=0 @trade_breaknow=true FILTER ENDIF IFMATCHES(%CHAT%, "^/ad clear 2$") @&tradead2="" LOG("&7[Tr] &dCleared Second-line Trade Ad") @#trade_failsafe=0 @trade_breaknow=true FILTER ENDIF IFMATCHES(%CHAT%, "^/ad time$") LOG("&fSets the time between ads. Must be at least 300 seconds.") LOG("&f/adtime <seconds>") FILTER ENDIF IFMATCHES(%CHAT%, "^/ad time ") 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 FILTER ENDIF IFMATCHES(%CHAT%, "^/ad info") 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 FILTER ENDIF ENDIF }$$
Something I'd like to point out: My version of 3point's code still works, but it's going to violate the new trade chat rules if you set both ads.
Code: $${ IF(automessage) UNSET(automessage) STOP() ELSE SET(automessage) DO() LOG("&4&lSHUT UP") ECHO("/ch tr") WAIT(1) ECHO("AD") WAIT(1) ECHO("/ch g") LOG("&4&lSPEAK") WAIT(300) LOOP() ENDIF }$$ Heres the one I use, its kind of clunky in operation since I made it literally the day patron got /ch qm, but its a lot simpler than the others and still works well, just dont talk while the ad is being sent
you put your message in Echo("") lol, it actually doesn't even matter if I have the wait times in there, it was from when we had two ads. I was tinkering with it, and just having waits also just decreases the likelihood things get messed up