Tc macro.mac: Difference between revisions
From CLUMP
Jump to navigationJump to search
(→Code: added version 3 macro) |
m (→Description: added link to updated macro) |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
* Quick think to group, think to clan and return call (ss who just ss'd you) are implmemented in this. | * Quick think to group, think to clan and return call (ss who just ss'd you) are implmemented in this. | ||
* Changed from Noivad's '/tcX' invocation to use 'tg' for think to group, 'tc' for think to clan and '/tgX' invocation for group management. | * Changed from Noivad's '/tcX' invocation to use 'tg' for think to group, 'tc' for think to clan and '/tgX' invocation for group management. | ||
''*Note: There is a newer version of this macro here [[Scanner.txt]] that includes trainer messages, unused duvin messages, and other features.'' | |||
==Dependencies== | ==Dependencies== | ||
Line 37: | Line 39: | ||
// SCROLL DOWN for Thinkgroup instructions | // SCROLL DOWN for Thinkgroup instructions | ||
//------------------------------------Setup------------------------------------- | //------------------------------------Setup------------------------------------- | ||
// Add "include " | // Add "include "scanner.txt"" and "@login call GoScan" to | ||
// your default macro file if you want it to strart automatically. | // your default macro file if you want it to strart automatically. | ||
//------------------------------------Credit------------------------------------ | //------------------------------------Credit------------------------------------ | ||
Line 425: | Line 427: | ||
} | } | ||
</pre> | </pre> | ||
==version 2.5.2 Code== | ==version 2.5.2 Code== | ||
<pre> | <pre> |
Latest revision as of 13:58, 21 October 2024
Description[edit]
- Noivad's adapted tc_macro for Alternate Default series of macros.
- Quick think to group, think to clan and return call (ss who just ss'd you) are implmemented in this.
- Changed from Noivad's '/tcX' invocation to use 'tg' for think to group, 'tc' for think to clan and '/tgX' invocation for group management.
*Note: There is a newer version of this macro here Scanner.txt that includes trainer messages, unused duvin messages, and other features.
Dependencies[edit]
- Global var MySunStone and Set feedback in AlternateDefault.
- GoScan and NoScan in AlternateDefault.
Usage[edit]
- Save text from code section into a file called tc_macro.mac to your /clanlord/data/macros folder.
Noteworthy Techniques[edit]
- Add shared to exiles to group - clears out current group.
- Add/remove exiles from group via selected player in playerlist or name of exile passed.
Credits[edit]
- Noivad.
version 3 Code[edit]
//------------------------------------------------------------------------------ // scanner.txt version 3 (Array-fied) //------------------------------------------------------------------------------ // Description: (AKA "A Quick Reply") // This macro allows you to quickly reply to anyone who thinks to you directly // to you. It also manages think to groups and think to clan actions by default. // The addition of arrays means additional scans can be added without writing a // new conditional check for the phrase. //------------------------------------Usage------------------------------------- // "goscan" to start and "noscan" to stop. // "goscan ?" for instructions on different commands. // "t?" give the current target, // "ts <name> [message]" sets the SSTarget and optionally sends a message // "tc <message>" to think back to the SStarget // "tt <message>" to think to selected player -- added v2.5.4 // SCROLL DOWN for Thinkgroup instructions //------------------------------------Setup------------------------------------- // Add "include "scanner.txt"" and "@login call GoScan" to // your default macro file if you want it to strart automatically. //------------------------------------Credit------------------------------------ // Reye for the Idea, X for the syntax check and suggestions, // and everyone who direct SSed me to help debug. // Originally Written in BBedit (over a decade ago) //------------------------------------------------------------------------------ include "rankcount.mac" set ssTarget "" //you must keep these variables outside of the functions and macros set myStone "Sungem" // set this to Suntone, Suncrystal or Sungem set scanBreak 0 //they need to be global set feedback 1 //Gives you feedback "tc target: @player" set scanText "" set timeStamps 1 // Set this to zero if you don't use timestamps** set playerName 0 set me 0 set keepAlive 0 set feedback 1 //useful for debug & more spam in your sidebar set pointer 1 // pointer to current scanned phrase set cap 12 //must equal checkText/reaction array total set checkText[2] "thinks to you, " set checkText[3] "Captain Barnac asks, \"Ah, " set checkText[4] "Paul Deckand asks, \"Ah, " set checkText[5] "Fird Lirden asks, \"Ah, " set checkText[6] "No item named 'bag of kudzu seedlings" set checkText[7] "* Your bag of kudzu seedlings is full." set checkText[8] "* You do not have room in your pack for anything else." set checkText[9] "You can't take things out of your pack that quickly." set checkText[10] "• You return to your normal form." set checkText[11] "•You assume the shape of " set checkText[12] "You cannot possibly use anything in your current condition." set checkText[13] "•You are already in your normal form." set checkText[14] "myThankGroup[thankTarget]" set checkText[15] "myThankGroup[thankTarget]" set checkText[16] "pesky" set reaction[2] "ThinkTargetSet" set reaction[3] "RentBoat" set reaction[4] "RentBoat" set reaction[5] "RentBoat" set reaction[6] "setBagOne" set reaction[7] "decrementBag" set reaction[8] "plantSeed" set reaction[9] "dropOrgaEye" set reaction[10] "notMorphed" set reaction[11] "isMorphed" set reaction[12] "notMorphed" set reaction[13] "morph" set reaction[14] "moveUp" set reaction[15] "placeholder" set reaction[16] "copyright" "goscan" call GoScan GoScan { message "scanner.txt activated" setglobal scanBreak 0 set @env.key_interrupts false //when you start you want it to loop set @env.click_interrupts false //these two lines makes sure it doesn't shut off if @text == "" if feedback == 1 message "•••Scanner On•••" message "for settings type \"goscan ?\"." pause 8 end if else if @text == "?" message "Type \"t?\" to find the target. "tc <message>\" to send to SStarget. \"tt <text>\" to send to selected player." pause 8 message "Type \"ts <name> [message]\" sets the target and sends them a message if you include one." pause 8 message "Type \"/feedback\" to toggle macro feedback off|on." pause 4 message "OR \"/set feedback <?|1|on|0|off>" pause 8 message "Type \"noscan\" to stop." end if call Scanner label SCANMONITOR if keepAlive == 1 pause 240 set keepAlive 0 pause 40 goto scanmonitor else if keepAlive == 2 set scanBreak 1 else pause 80 setglobal scanBreak 0 call Scanner message "*Scanner recalled" goto SCANMONITOR end if } Scanner { label SCANtop pause 1 if scanBreak == 1 goto SCANEnder else setglobal keepAlive 1 setglobal scanText @env.textLog if scanText.word[0] < "/" setglobal timeStamps 3 setglobal playerName 2 setglobal me 6 else setglobal timeStamps 1 setglobal playerName 0 setglobal me 3 end if label SCANloop if scanText < checkText[pointer] //message "*index [" pointer "] found" call reaction[pointer] else setglobal pointer + 1 if pointer > cap goto SCANnext else goto SCANloop end if end if end if label SCANnext setglobal pointer 1 pause 1 setglobal gtrainerPhrase scanText call rankcount goto SCANtop label SCANEnder set keepAlive 2 if feedback == 1 message "••Scanner Off••" end if setglobal keepAlive 0 } "noscan" { setglobal scanBreak 1 //This alows you to stop this macro without stopping other macros } ThinkTargetSet { if ssTarget != scanText.word[playerName] //w/timestamps[2] w/o[0] if scanText.word[playerName] != @my.name setglobal ssTarget scanText.word[playerName] setglobal feedback 1 //turn on feedback for new target pause 4 end if end if if feedback == 1 //this controls overall feedback //This if block turns off feedback when the target hasn't changed if feedback == 1 message "tc target: " ssTarget setglobal feedback 0 end if end if } "tt" { if @my.forehead_item != myStone setglobal fitem @my.forehead_item "/equip " myStone "\r" set fromTT 1 else setglobal fitem @my.forehead_item end if "/thinkto " @selplayer.simple_name " " @text "\r" if modeVerbose == 1 call ThinkToAction end if pause 2 if fitem != @my.forehead_item "\equip " fitem "\r" end if } "tc" { if @my.forehead_item != myStone setglobal fitem @my.forehead_item "/equip " myStone "\r" set fromTT 1 else setglobal fitem @my.forehead_item end if "/thinkto " ssTarget " " @text "\r" //such simplicity belies all the ugly stuff above if modeVerbose == 1 call ThinkToAction end if pause 2 if fitem != @my.forehead_item "\equip " fitem "\r" end if } // ==========================Think Capture Options========================== "t?" // target who? = Who is the current target? Useful if you have activated { // silent mode, if you've been afk for a Message " tc target: " ssTarget // while or if a bug in macro language } // implementation causes the target to be wrong. "ts" //target select = manually change your target and send a { //message, much like other people's "tt" macro, but this one setglobal ssTarget @text.word[0] //allows you to switch to tc messaging if feedback == 1 message "targeting: " ssTarget end if if @my.forehead_item != myStone setglobal fitem @my.forehead_item "/equip " myStone "\r" set fromTT 1 end if "/thinkto " @text "\r" if modeVerbose == 1 call ThinkToAction end if pause 2 if fitem != @my.forehead_item "\equip " fitem "\r" end if } "/feedback" //This toggles the macros between silent mode and message display mode. { //This is in case you don't want your text log or status area spammed if messageStaus == 1 setglobal feedback 0 else setglobal feedback 1 message "Messages On" end if } "ttc" "/thinkclan " @text "\r" /////////////////////////Sungem Additions////////////////////////////////// // // "/sga <name>" will add one person to the thinkgroup. SGA= SunGem Add // "/tga" will add the selected person ot the think group. TGA=Target Group Add // "/sgre <name>" will remove one person from the thinkgroup. SGRE=SunGem REmove // "/sgr" will remove the selected person from the thinkgroup.SGR=SunGem REmove // "/sgam <name1><name> will add multiple people." SGAM= SunGem Add Multiple // "/sgs" will clear your thinkgroup and added everyone you are currently // sharing with. (This sometimes fails.) SGS=SunGem Set // "/sgc" will clear your entire thinkgroup. SGC= SunGem Clear // "/sgi" inspects your Sungem // "/sgwho" will tell you who is apart of your Thinkgroup. // //////////////////////////Thinking to Groups/////////////////////////////// // // "tg <message>" thinks to your thinkgroup. // "ttc <messge>" thinks to your clan // ///////////////////////////////////////////////////////////////////// "/tga" "/useitem Sungem /add " @selplayer.simple_name "\r" "/sgr" "/useitem sungem /remove " @selplayer.simple_name "\r" "/sga" "/useitem Sungem /add " @text "\r" // SunGem Add Multiple v2 20080214 "/sgam" { set num_people @text.num_words set slot 0 label addloop if slot < num_people "/useitem sungem /add " @text.word[slot] "\r" pause 1 set slot + 1 goto addloop end if "/useitem " myStone " /who \r" } "/sgre" "/useitem sungem /remove " @text "\r" "/sgc" "/useitem sungem /clear \r" "/sgi" "/useitem sungem /inspect \r" "/sgwho" "/useitem sungem /who \r" "tg" { if @my.forehead_item != myStone setglobal fitem @my.forehead_item "/equip " myStone "\r" end if "/thinkgroup " @text "\r" } // SunGem Add Shares v2 20080214 "/sgs" { "/useitem sungem /clear \r" set shares @my.shares_out message shares set slot 1 set num_shares @my.shares_out.num_words label addloop if slot <= num_shares "/useitem Sungem /add " shares.word[slot] "\r" pause 1 set slot + 1 pause 1 goto addloop end if "/useitem " myStone " /who \r" label end } /* ** Internal Reaction Macros** */ RentBoat { set namePer @my.name set namePer + "." if scanText.word[me] == namePer pause 1 "yes\r" end if } setBagOne { setglobal bag_number 1 "/equip bag of kudzu seedlings " bag_number "\r" } decrementBag { setglobal bag_number - 1 if bag_number < 0 setglobal bag_number max_bag end if } plantSeed { "/equip Kudzu Seedling\r" pause 1 "/usei left\r" } dropOrgaEye { "/selectitem orga eye \r" "/drop orga eye \r" pause 1 } notMorphed { setglobal morphed 0 } isMorphed { setglobal morphed 1 } placeholder { message "placeholder" } copyright { "/narrate “pesky” ©1998–∞ Super Chicken" }
version 2.5.2 Code[edit]
//------------------------------------------------ // tc_macro.mac // Original by Noivad //------------------------------------------------ // Version: 2.5.2 - Modified for use with AlternateDefault series of macros // Description: (AKA "A Quick Reply") // This macro allows you to quickly reply to anyone who thinks to you directly // to you. It also manages think to groups and think to clan actions. // Usage: // Use "goscan" to start and "noscan" to stop. If you type "goscan ?" // You're receive instructions on diferent commands. // While the macro is running, entering "tl <the message>" will // /thinkto the last person who SSed you directly. // New in rev2 "t?" give the current target, "ts <name> <message>" manually sets // the target and messages. If you just type "ts <name> it just sets the target. // If the scanner stops after a time, just type "goscan" to start it back up. // // Credit: // This is Noivad's original creation. // Noivad credited: "Reye for the Idea, X for the syntax check and suggestions, // and everyone who direct SSed me to help debug." // // Revisions: // 20070211-inu: Fixed specialized group think to section to use MySunStone variable // and corrected bug (note: 20080130-can't recall what I fixed there). // 200712xx-inu: Changed call invocations for ThinkTo group from sgX series to tgX, // Think to last from tc to tl, think clan from ttc to tc, think to group from sg to tg // 20080129-inu: Modified to fit in with AlternateDefault series of macros. // 20080130-inu: Fixed header and credits. Added equip MySunStone to all think macro calls to ensure a // message is sent off. set ssTarget "" //you must keep these variables outside of the functions and macros set scanBreak 0 //they need to be global set messageStatus 1 //Gives you feedback "tl target: @player" set timeStamps 1 set playerName 0 set me 0 // ==========================Think Capture Options========================== // "/t?" - Tells you who current target is for tl (thinkto last) // "/ts <name>" - Lets you manually change the target to that passed to the macro // "/tl" - Sends a message to the person who 'thunk' to you last. // Use "/set feedback [on|off] to toggle between silent mode and message display mode. /////////////////////////Sungem Additions////////////////////////////////// // // /tga <name> = will add one person to the thinkgroup. TGA= ThinkGroup Add // /tga = will add the selected person ot the think group. TGAS=Think Group Add Selected // /tgr <name> = will remove one person from the thinkgroup. TGRE=THinkGroup REmove // /tgr = will remove the selected person from the thinkgroup.SGR=THinkGroup REmove Selected // /tgam <name1><name> = will add multiple people." TGAM= ThinkGroup Add Multiple // /tgs = will clear your thinkgroup and added everyone you are currently // sharing with. (This sometimes fails.) TGS=ThinkGroup clear and Add Shared // /tgc = will clear your entire thinkgroup. TGC= ThinkGroup Clear // /tgi = inspects your MySunStone // /tgw = will tell you who is apart of your Thinkgroup. // //////////////////////////Thinking to Groups///////////////////////// // // "tg <message>" thinks to your thinkgroup. // "tc <message>" thinks to your clan // ///////////////////////////////////////////////////////////////////// "/tl" // aka Think to last exile who SSd me directly. { if @my.forehead_item != MySunStone setglobal fitem @my.forehead_item "/equip " MySunStone "\r" set fromTT 1 else setglobal fitem @my.forehead_item end if "/thinkto " ssTarget " " @text "\r" //such simplicity belies all the ugly stuff in the Scanner section if modeVerbose == 1 call ThinkToAction end if pause 2 if fitem != @my.forehead_item "/equip " fitem "\r" end if } "/t?" // target who? = Who is the current target? Useful if you have activated { // silent mode, if you've been afk for a Message " tc target: " ssTarget // while or if a bug in macro language } // implementation causes the target to be wrong. "/ts" //target select = manually change your target and send a { //message, much like other people's "tt" macro, but this one setglobal ssTarget @text.word[0] //allows you to switch to tl messaging if messagestatus == 1 message "targeting: " ssTarget end if if @my.forehead_item != MySunStone setglobal fitem @my.forehead_item "/equip " MySunStone "\r" set fromTT 1 end if "/thinkto " @text "\r" if modeVerbose == 1 call ThinkToAction end if pause 2 if fitem != @my.forehead_item "/equip " fitem "\r" end if } "tc" //ThinkTo Clan { if @my.forehead_item != MySunStone setglobal fitem @my.forehead_item "/equip " MySunStone "\r" end if "/thinkclan " @text "\r" } "/tga" //Add passed in or selected exile to ThinkTo group { if @my.forehead_item != MySunStone setglobal fitem @my.forehead_item "/equip " MySunStone "\r" end if if @text == "" "/useitem " MySunStone " /add " @selplayer.simple_name "\r" else "/useitem " MySunStone " /add " @text "\r" end if } "/tgr" //Remove passed in or selected exile to ThinkTo group { if @my.forehead_item != MySunStone setglobal fitem @my.forehead_item "/equip " MySunStone "\r" end if if @text == "" "/useitem " MySunStone " /remove " @text "\r" else "/useitem " MySunStone " /remove " @selplayer.simple_name "\r" end if } "/tgc" //Clear ThinkTo Group { if @my.forehead_item != MySunStone setglobal fitem @my.forehead_item "/equip " MySunStone "\r" end if "/useitem " MySunStone " /clear \r" } "/tgi" // Inspect MySunStone { if @my.forehead_item != MySunStone setglobal fitem @my.forehead_item "/equip " MySunStone "\r" end if "/useitem " MySunStone " /inspect \r" } "/tgw" // List ThinkToGroup members { if @my.forehead_item != MySunStone setglobal fitem @my.forehead_item "/equip " MySunStone "\r" end if "/useitem " MySunStone " /group /who \r" } "tg" //ThinkTo Group { if @my.forehead_item != MySunStone setglobal fitem @my.forehead_item "/equip " MySunStone "\r" end if "/thinkgroup " @text "\r" } "/tgs" // clears current group and adds those you are sharing with { "/useitem " MySunStone " /clear \r" pause 1 if @text == "" "/share " @selplayer.simple_name "\r" else "/share " @text.word[0] end if pause 1 set scanText @env.textLog if scanText < "You are sharing experiences with" setglobal exile[1] scanText.word[7] if scanText.word[8] != "and" setglobal exile[2] scanText.word[8] else set skip 2 end if if scanText.word[9] != "and" setglobal exile[3] scanText.word[9] else set skip 3 end if if scanText.word[10] != "and" setglobal exile[4] scanText.word[10] else set skip 4 end if if scanText.word[11] != "and" setglobal exile[5] scanText.word[11] else set skip 5 end if if scanText.word[12] != "and" setglobal exile[6] scanText.word[12] else set skip 6 end if if scanText.word[13] != "and" setglobal exile[7] scanText.word[13] else set skip 7 end if if scanText.word[14] != "and" setglobal exile[8] scanText.word[14] else set skip 8 end if set counterLimit skip set counterLimit + 2 message counterLimit label addLoopIni pause 1 set counter 1 label addloop if counter < counterLimit if skip == counter set counter + 1 else "/useitem " MySunStone " /add " exile[counter] "\r" set counter + 1 pause 1 end if goto addloop else "/useitem " MySunStone " /who \r" end if end if label end }
Revisions[edit]
- 20070211-inu: Fixed specialized group think to section to use MySunStone variable and corrected bug (note: 20080130-can't recall what I fixed there).
- 200712xx-inu: Changed call invocations for ThinkTo group from sgX series to tgX, Think to last from tc to tl, think clan from ttc to tc, think to group from sg to tg.
- 20080129-inu: Posted. Modified to fit in with AlternateDefault series of macros. Consolidated /tgr & /tga to use passed text for group management. If no text is passed, then use selected exile in group management.
- 20080130-inu: Fixed header and credits. Added equip MySunStone to all think macro calls to ensure a message is sent off.