Scanner.txt: Difference between revisions
m (→Scanner.txt Macro: updated index message) |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 19: | Line 19: | ||
== Scanner.txt Macro == | == Scanner.txt Macro == | ||
message "Scanner macro Loaded" | message ">>>Scanner macro Loaded<<<" | ||
//------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||
// scanner.txt version 3.2. | // scanner.txt version 3.2.2 (Array-fied) | ||
//------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||
// Description: (AKA "A Quick Reply") | // Description: (AKA "A Quick Reply") | ||
Line 28: | Line 28: | ||
// The addition of arrays means additional scans can be added without writing a | // The addition of arrays means additional scans can be added without writing a | ||
// new conditional check for the phrase. | // new conditional check for the phrase. | ||
// It allows one to | // It allows one to auto reply to a boat seller. | ||
// Now it also can display trainer rank counts and duvin free in the sidebar. | // Now it also can display trainer rank counts and duvin free in the sidebar. | ||
// | |||
//The biggest feature is ease of adding things to scan for: now, you can easily | |||
// add a set of scanned items and macros to call by numbering them | |||
//(placeholders 1 is for quick adds/copies without triggering an error: | |||
// ''"set checkText[#]" "{text to look for}"'' | |||
// ''"set reaction[#]" "macro to call"'' //note: must be callable see Macros* | |||
// | |||
//------------------------------------Usage------------------------------------- | //------------------------------------Usage------------------------------------- | ||
// "goscan" to start and "noscan" to stop. | // "goscan" to start and "noscan" to stop. | ||
Line 39: | Line 46: | ||
// SCROLL DOWN for Thinkgroup instructions | // SCROLL DOWN for Thinkgroup instructions | ||
//------------------------------------Setup------------------------------------- | //------------------------------------Setup------------------------------------- | ||
// Add "include " | // Add "include "scannner.txt"" and "@login call GoScan" to | ||
// your default macro file if you want it to | // your default macro file if you want it to start automatically. | ||
//------------------------------------Credit------------------------------------ | //------------------------------------Credit------------------------------------ | ||
// Reye for the Idea, X for the syntax check and suggestions, | // Reye for the Idea, X for the syntax check and suggestions, | ||
Line 48: | Line 55: | ||
set ssTarget "" //you must keep these variables outside of the functions and macros | set ssTarget "" //you must keep these variables outside of the functions and macros | ||
set myStone "Sungem" // set this to | set myStone "Sungem" // set this to Sunstone, Suncrystal or Sungem | ||
set scanBreak 0 //they need to be global | set scanBreak 0 //they need to be global | ||
set fitem "" | |||
set scanText "" | set scanText "" | ||
set timeStamps 1 // Set this to zero if you don't use timestamps** | set timeStamps 1 // Set this to zero if you don't use timestamps** | ||
Line 58: | Line 64: | ||
set keepAlive 0 | set keepAlive 0 | ||
set feedback 1 //useful for debug & more spam in your sidebar | set feedback 1 //useful for debug & more spam in your sidebar | ||
//Gives you feedback "tc target: @player" as well, set to 0 to avoid message spam | |||
set pointer 1 // pointer to current scanned phrase | set pointer 1 // pointer to current scanned phrase | ||
set cap | set cap 68 //must equal checkText/reaction array total | ||
set checkText[2] "thinks to you, " | set checkText[2] "thinks to you, " | ||
Line 78: | Line 85: | ||
set checkText[16] "pesky" | set checkText[16] "pesky" | ||
set checkText[17] "Paula Freshland says, \"Ah, " | set checkText[17] "Paula Freshland says, \"Ah, " | ||
set checkText[68] @my.name " has fallen to " | |||
set reaction[2] "ThinkTargetSet" | set reaction[2] "ThinkTargetSet" | ||
Line 96: | Line 104: | ||
set reaction[16] "copyright" | set reaction[16] "copyright" | ||
set reaction[17] "RentBoat" | set reaction[17] "RentBoat" | ||
set reaction[68] "notMorphed" | |||
/* ***** Trainer Messages ***** */ | /* ***** Trainer Messages ***** */ | ||
Line 653: | Line 662: | ||
copyright | copyright | ||
{ | { | ||
"/narrate “pesky” ©1998–į Super Chicken" | "/narrate “pesky” ©1998–į Super Chicken\r" | ||
} | } | ||
*please report any error messages. | *please report any error messages. |
Latest revision as of 09:07, 23 November 2024
Scanner.txt is a new version of tc_macro.txt with a name change because of focus change and a large rewrite into arrays to remove the repetitive conditionals
The biggest feature is ease of adding things to scan for: now, you can easily add a set of scanned items and macros to call by numbering them (placeholders 1 is for quick adds/copies without triggering an error:
"set checkText[#]" "{text to look for}" "set reaction[#]" "macro to call" //note: must be callable see Macros*
Currently the total of actions and reactions is at 67. If you add more, make sure to update the cap global variable.
- If you are using this on a Windows machine, change the 3 letter extension to .mac: Scanner.mac
- if the reaction[#] is not a callable macro, it will throw an error into your sidebar.
For instance all the boat sellers in Puddleby trigger the "RentBoat" macro to save time/typing/switching from mouse to KB, you can add other shortcuts such as chain snaps trigger rechains, kudzu outages trigger bag swaps, etc. Suggest some in the Sentinel’s Macros forum.
An important thing to note with all scanning macros is that they cannot scan each line of the text log if they come in at the same time. This means there is always a chance something else will come in at the same time & make the macro fail to detect the trigger words. Due to game’s logging/messaging & macro architecture there is no way for players to script around this issue. So, please accept that all Scanner macros can easily miss something that should trigger a reaction. Until a GMs decides to allow line-by-line scanning, this will always be the case. (Note: this limit prevents easy botting, so it is not likely to change—we’ve asked, and you can too, if you wish. thanks.)
Scanner.txt Macro[edit]
message ">>>Scanner macro Loaded<<<" //------------------------------------------------------------------------------ // scanner.txt version 3.2.2 (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. // It allows one to auto reply to a boat seller. // Now it also can display trainer rank counts and duvin free in the sidebar. // //The biggest feature is ease of adding things to scan for: now, you can easily // add a set of scanned items and macros to call by numbering them //(placeholders 1 is for quick adds/copies without triggering an error: // "set checkText[#]" "{text to look for}" // "set reaction[#]" "macro to call" //note: must be callable see Macros* // //------------------------------------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 "scannner.txt"" and "@login call GoScan" to // your default macro file if you want it to start 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) //------------------------------------------------------------------------------ set ssTarget "" //you must keep these variables outside of the functions and macros set myStone "Sungem" // set this to Sunstone, Suncrystal or Sungem set scanBreak 0 //they need to be global set fitem "" 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 //Gives you feedback "tc target: @player" as well, set to 0 to avoid message spam set pointer 1 // pointer to current scanned phrase set cap 68 //must equal checkText/reaction array total set checkText[2] "thinks to you, " set checkText[3] "Captain Barnac says, \"Ah, " set checkText[4] "Paul Deckand says, \"Ah, " set checkText[5] "Bear Knuckle says, \"Ah, " set checkText[67] "Fird Lirden says, \"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 checkText[17] "Paula Freshland says, \"Ah, " set checkText[68] @my.name " has fallen to " set reaction[2] "ThinkTargetSet" set reaction[3] "RentBoat" set reaction[4] "RentBoat" set reaction[5] "RentBoat" set reaction[67] "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" set reaction[17] "RentBoat" set reaction[68] "notMorphed" /* ***** Trainer Messages ***** */ set checkText[18] "You have much to learn." set reaction[18] "rankA" rankA message "0-9" set checkText[19] "It is good to see you." set reaction[19] "rankB" rankB message "10–19" set checkText[20] "Your persistence is paying off." set reaction[20] "rankC" rankC message "20–29" set checkText[21] "You are progressing well." set reaction[21] "rankD" rankD message "30–39" set checkText[22] "You are a good pupil of mine." set reaction[22] "rankE" rankE message "40–49" set checkText[23] "You are one of my better pupils." set reaction[23] "rankF" rankF message "50–99" set checkText[24] "You keep me on my toes." set reaction[24] "rankG" rankG message "100–149" set checkText[25] "It is hard to find more to teach you." set reaction[25] "rankH" rankH message "150–199" set checkText[26] "Teaching you is a challenge." set reaction[26] "rankI" rankI message "200–249" set checkText[27] "There is not much more I can teach you." set reaction[27] "rankJ" rankJ message "250–299" set checkText[28] "Teaching you has taught me much." set reaction[28] "rankK" rankK message "300–349" set checkText[29] "You have attained tremendous skill." set reaction[29] "rankL" rankL message "350–399" set checkText[30] "We are nearly equals." set reaction[30] "rankM" rankM message "400–449" set checkText[31] "You may be proud of your accomplishment." set reaction[31] "rankN" rankN message "450–499" set checkText[32] "You are becoming a master of our art." set reaction[32] "rank0" rank0 message "500–549" set checkText[60] "You are becoming a master of your art." set reaction[60] "rank60" rank60 message "500–549" set checkText[33] "Your dedication is commendable." set reaction[33] "rankP" rankP message "550–599" set checkText[34] "You show great devotion to your studies." set reaction[34] "rankQ" rankQ message "600–649" set checkText[35] "You are a credit to our craft." set reaction[35] "rankR" rankR message "650–699" set checkText[36] "Few indeed are your peers." set reaction[36] "rankS" rankS message "700–749" set checkText[37] "Your devotion to the craft is exemplary." set reaction[37] "rankT" rankT message "750–799" set checkText[38] "It is always good to greet a respected colleague." set reaction[38] "rankU" rankU message "800–899" set checkText[39] "You are truly a grand master." set reaction[39] "rankV" rankV message "900–999" set checkText[40] "Let us search for more we might learn together." set reaction[40] "rankW" rankW message "1000–1250" set checkText[41] "Your persistence is an example to us all." set reaction[41] "rankX" rankX message "1250–1499" set checkText[42] "Your skill astounds me." set reaction[42] "rankY" rankY message "1500–1749" set checkText[43] "You have progressed further than most." set reaction[43] "rankZ" rankZ message "1750–1999" set checkText[44] "You are nearly peerless." set reaction[44] "rankAA" rankAA message "2000–2249" set checkText[45] "You are a model of dedication." set reaction[45] "rankBB" rank2BB message "2250–2499" set checkText[46] "You have achieved mastery." set reaction[46] "rankCC" rankCC message "2500–2749" set checkText[47] "You are enlightened." set reaction[47] "rankDD" rankDD message "2750–2999" set checkText[48] "Your command of our craft is inspiring." set reaction[48] "rankEE" rankEE message "3000–3249" set checkText[49] "All commend your dedication to our craft." set reaction[49] "rankF" rankFF message "3250–3499" set checkText[50] "I marvel at your skill." set reaction[50] "rankGG" rankGG message "3500–3749" set checkText[51] "You walk where few have tread." set reaction[51] "rankHH" rankHH message "3750–3999" set checkText[52] "Few stones are unturned in your path." set reaction[52] "rankII" rankII message "4000–4249" set checkText[53] "Your footsteps guide the dedicated." set reaction[53] "rankJJ" rankJJ message "4250–4499" set checkText[54] "You chart a way through the unknown." set reaction[54] "rankKK" rankKK message "4500–4749" set checkText[55] "Your path illuminates the wilderness." set reaction[55] "rankLL" rankLL message "4750–4999" set checkText[56] "????????" set reaction[56] "messunknown" messunknown message "5000–" set checkText[57] "Your path is ablaze with glory." set reaction[57] "rankMM" rankMM message "6000–" set checkText[58] "????–????" set reaction[58] "rankunknown" rankunknown message "You are enlightened beyond measure." set checkText[59] "There is nothing I can teach you." set reaction[59] "maxed" maxed message "MAXED" /* ***** Duvin ***** */ set checkText[60] "You have the training to study only the most familiar creatures" set reaction[60] "duvinA" duvinA message "1–2" set checkText[61] "You have the training to study familiar creatures" set reaction[61] "duvinB" duvinB message "3-4" set checkText[62] "You have the training to study more unusual creatures" set reaction[62] "duvinC" duvinC message "5–14" set checkText[63] "You have the training to study several creatures" set reaction[63] "duvinD" duvinD message "15–24" set checkText[64] "You have the training to study quite a few creatures" set reaction[64] "duvinE" duvinE message "25–34" set checkText[65] "You have the training to study many creature" set reaction[65] "duvinF" duvinF message "35–49" set checkText[66] "You have the training to study a great variety of creatures" set reaction[66] "duvinG" duvinG message "50+" "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.txt On•••" message "for settings type \"goscan ?\"." pause 10 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 10 message "Type \"ts <name> [message]\" sets the target and sends them a message if you include one." pause 10 message "Type \"/feedback\" to toggle macro feedback off|on." pause 5 message "OR \"/set feedback <?|1|on|0|off>" pause 10 message "Type \"noscan\" to stop." end if call Scanner label SCANMONITOR if keepAlive == 1 pause 5 set keepAlive 0 pause 50 goto SCANMONITOR else if keepAlive == 2 set scanBreak 1 else pause 100 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] if feedback ==1 message ">>>index [" pointer "] found<<<" end if 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 allows 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 5 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 end if "/thinkto " @selplayer.simple_name " " @text "\r" if modeVerbose == 1 call ThinkToAction end if pause 2 if fitem != "" if fitem != @my.forehead_item "\equip " fitem "\r" end if end if } "tc" { if @my.forehead_item != myStone setglobal fitem @my.forehead_item "/equip " myStone "\r" set fromTT 1 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 != "" if fitem != @my.forehead_item "\equip " fitem "\r" end if 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 != "" if fitem != @my.forehead_item "\equip " fitem "\r" end if 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** */ reaction { call reaction[pointer] } RentBoat { set namePer @my.name set namePer + "." if scanText.word[me] == namePer "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 if @my.right_item == "Great Sword" "/equip " rightItem " \r" end if } isMorphed { if scanText < "you assume the shape of a vile cricket" setglobal my.right_item rightItem "/equip Great Sword \r" end if setglobal morphed 1 } placeholder { message "placeholder" } copyright { "/narrate “pesky” ©1998–į Super Chicken\r" }
- please report any error messages.