ThankGroup: Difference between revisions
From CLUMP
Jump to navigationJump to search
m (minor typo fix) |
m (—updated macro) |
||
(16 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
/* ---------------------------------------------------------------------- | |||
| shareMultiple Version 1.1.3 | ThankGroup Version 2.5.3 | | |||
------------------------------- Description ----------------------------- | |||
Shares | Shares is an expansion of the default /share command to accept multiple names, to ease sharing and thanking groups of people. | ||
---------------------------------- Usage -------------------------------- | |||
##### type "/th?" for online help | |||
type: | type: | ||
sh [name*] [name] [name] [name] [name] | |||
to share up to your maximum number of people. | |||
*You can type partial names as you can with the default share command. | |||
/ths | |||
to build thank list of shares in and out | |||
/tn | |||
to thank the next person on the list | |||
/ath | |||
"sh" "/share " @text "\r" | to automatically thank and set through the list | ||
---------------------------------- Setup ---------------------------------- | |||
Add the line below to your default macro file: | |||
include "Shares.txt" | |||
Note: to work properly you might have to remove the line | |||
"sh" "/share " @text "\r" from your default macros file. | |||
or you can use other built in triggers: | |||
"shm" & "/shm" | "shm" & "/shm" | ||
------------------------------ Feedback/Info ------------------------------ | |||
This macro makes a list of people to thank numerous ways. Then you can call the AutoThank if you want to thank a person every 4 minutes (set with "delay" global. the delay by default is just over 4 minutes, 1200 Frames). | |||
**Thank Options controls several options. including just a number ("/tho 3") will set the person at that position in the list (3 in this case) as the next exile to thank. With " | |||
The Default Triggers are listed below, feel free to edit them. A short description is listed next to each trigger. | |||
** Thank Options controls several options. including just a number ("/tho 3") will set the person at that position in the list (3 in this case) as the next exile to thank. With "debug" set to 0 or 1 it will allow debug messages to show up and allow you to load a default list of people to thank into the ThankGroup by activating the default share shortcut,"sh", which you can set in listA below. With the "off" option ("/tho off") it turns off the AutoThank loop. | |||
*The v.2.1.3 comment format is as follows: | |||
<<m_macroname>> (default trigger|s <required text> [optional text]) short description. | |||
** the single less than some text and greater than denotes strings so when you see "/thg [message]" | ** the single less than some text and greater than denotes strings so when you see "/thg [message]" | ||
** the vertical bar "|" is used to denote valid options (arguments) the macro accepts | |||
** all macros are prefixed with "m_" in the file for quick searching and avoiding false hits from "call <macro>" | |||
** global variable have their type & [:specific function] in tech speak | |||
---------------------- | along with a short description | ||
If you find any bugs or have suggestions, contact noivad either in game or | |||
at his mac dot com address. This macro is "/Thank-ware." | |||
------------------------- version change notes -------------------------- | |||
v.2.1.2 "ThankRandom" was added by request of Rroot (REMOVED 2.5) | |||
v.2.1.3 *fixed a small bug that threw an error, but didn't stop the macro | |||
*Added <<tags>> to functions and comments | |||
*Added ThankHelp macro | |||
v.2.1.4 Added ability to remove a person from the list with /thgc <number> | |||
*Added ThankGroup Help "/thh" or "/thgh" | |||
v2.1.5 bug fixes to list behavior broken in 2.1.4 feature addition | |||
v.2.1.6-7 bug fix for increment not working. | |||
v2.3 fixes moveUp bug. ThankRandom is Broken & has been | |||
v.2.5.2 & 1.1.2 won't add people that are already on list | |||
----------------------------------------------------------------------- */ | |||
/****** Share Triggers ******/ | |||
"sh" call shareMultiList //changes /share to add multiple people | "sh" call shareMultiList //changes /share to add multiple people | ||
"/shm" call shareMultiList // also adds to myTG | "/shm" call shareMultiList // also adds to myTG | ||
"shm" call shareMultiList //{{m_shareMultiList}} | "shm" call shareMultiList //{{m_shareMultiList}} | ||
/****** Thank Group Triggers ******/ | |||
/****** Thank Group Triggers ******/ | |||
"/moveup" call moveUp //removes players who are now offline | |||
"/th?" call ThankHelp //Online ThankGroup command help | "/th?" call ThankHelp //Online ThankGroup command help | ||
"/ath" call AutoThank //Starts an Automatic thank loop | "off" to stop | "/ath" call AutoThank //Starts an Automatic thank loop | "off" to stop | ||
Line 62: | Line 68: | ||
"/thga" call AddToThankGroup // Adds a person to ThankGroup list | "/thga" call AddToThankGroup // Adds a person to ThankGroup list | ||
"/thgwho" call WhoAmIThanking // Shows the ThankGroup list | "/thgwho" call WhoAmIThanking // Shows the ThankGroup list | ||
"/thg?" call WhoAmIThanking // | "/thg?" call WhoAmIThanking // | ||
"/thgc" call ClearThankGroup //Clears out ThankGroup | "/thgc" call ClearThankGroup //Clears out ThankGroup | ||
"/thgh" call ThankHelp //Online ThankGroup command help | "/thgh" call ThankHelp //Online ThankGroup command help | ||
"/ | "/thgm" call ThankMessage //sets the message given with karma | ||
"/thm" call ThankMessage | |||
"/thh" call ThankHelp //Online ThankGroup command help | "/thh" call ThankHelp //Online ThankGroup command help | ||
"/thn" call ThankNext // Thanks next person in the list | "/thn" call ThankNext // Thanks next person in the list | ||
"/tho" call ThankOptions // see ** Above or {{m_ThankOptions}} below | "/tho" call ThankOptions // see ** Above or {{m_ThankOptions}} below | ||
"/thr" call ThankRandom // See * Above | //"/thr" call ThankRandom // BROKEN: See * Above | ||
"/ths" call ThankSharers //loads | "/ths" call ThankSharers //loads shares into thank list | ||
"/tn" call ThankNext //Thanks the next person on list | "/tn" call ThankNext //Thanks the next person on list | ||
set debug 0 //<<debug>> (bool:toggle) turns on and off debugging | set debug 0 //<<debug>> (bool:toggle) turns on and off debugging | ||
set modeverbose 1 //first trigger will remind people how to use. set to 0 to turn off | |||
set theMessage " Thank you " //<<EditMe>> your default message | set theMessage " Thank you " //<<EditMe>> your default message | ||
set myThankGroup[0] "" // | set myThankGroup[0] "" //in case thankTarget is set to 0 | ||
set listA " | set listA "Talin Silky Klur Natas Shadowfire" //EDIT to your friends | ||
/* | |||
set slotG 1 // | /* ---- Do not Edit below this line if not Familiar with Macros ---- */ | ||
set currentIndex | |||
set thankTotal | set slotG 1 //<<slotG>> (int:index) is the pointer for the list | ||
set currentIndex 1 //which slot is current | |||
set thankTarget 1 //internal current index | |||
set ATH 0 // | set thankTotal 0 //<<thankTotal>> (int:sum) <<!=DO_NOT_EDIT>> {?}Number in list | ||
set delay 1201 // | set ATH 0 //<<ATH>> (bool:toggle) controls automatic thanking | ||
set delay 1201 //<<delay>> (int:timer) controls pause between {{m_AutoThank}} | |||
set ht[0] "There is no entry here" | set ht[0] "There is no entry here" | ||
set ent 0 | set ent 0 | ||
set initSwitch 0 | set initSwitch 0 | ||
/* ******************** shareMultiple v1.1.3 *********************** */ | |||
//<<m_shareMultiList>> (sh|/shm|shm <name> [name]) shares & adds to list | |||
shareMultiList | shareMultiList | ||
{ | { | ||
setglobal ht[sh] "*'sh|/shm|shm | setglobal ht[sh] "*'sh|/shm|shm <name> [name]' shares & adds exiles to list" | ||
setglobal ht[1] "*'sh|/shm|shm <name> [name]' shares & adds exiles to list | setglobal ht[1] "*'sh|/shm|shm <name> [name]' shares & adds exiles to list" | ||
if | if slotG < 1 | ||
setglobal slotG 1 | |||
end if | end if | ||
if @text != "" | |||
set count 0 | |||
label LOOP | |||
if count <= @text.num_words | |||
"/select " @text.word[count] " \r" | |||
if @selplayer.simple_name == "" | |||
set count + 1 | |||
label | goto LOOP | ||
if count < @text.num_words | end if | ||
"/ | "/share " @selplayer.simple_name " \r" | ||
if debug == 1 | if debug == 1 | ||
pause 1 | message "*attempted share with " @text.word[count] " in LOOP" | ||
message " | end if | ||
pause 1 | |||
if "No player named " < @env.textLog | |||
set count + 1 | |||
goto LOOP | |||
end if | |||
set i 1 | |||
LABEL COMPARELOOP | |||
//ADDED 20220625 EXPERIMENTAL trying to search array for string | |||
if myThankGroup != "" | |||
//message "myThankGroup:" myThankGroup | |||
if myThankGroup < @selplayer.simple_name | |||
message @selplayer.simple_name "in myThankGroup" | |||
end if | |||
end if | end if | ||
set count + 1 | //ABOVE ADDED | ||
if myThankGroup[i] == @selplayer.simple_name | |||
message "* " @selplayer.name " already in list SKIPPING" | |||
set count + 1 | |||
pause 25 | |||
goto LOOP | |||
else | |||
if i < thankTotal | |||
set i + 1 | |||
goto COMPARELOOP | |||
end if | |||
setglobal myThankGroup[slotG] @selplayer.simple_name | |||
pause 1 | |||
if debug == 1 | |||
message "* [" slotG "]" myThankGroup[slotG] " added to thank group." | |||
end if | |||
setglobal slotG + 1 | |||
setglobal thankTotal + 1 | |||
if count < @text.num_words | |||
set count + 1 | |||
end if | |||
pause 25 | |||
goto LOOP | |||
end if | |||
end if | end if | ||
else | |||
"/share\r" | |||
end if | end if | ||
label END | label END | ||
} | } | ||
/ | |||
/************************ Thank Group v2.5.3 *************************/ | |||
//<<m_ThankGroup>> (/thg [message]) Thanks exile|s in list (activates AutoThank) | |||
ThankGroup | ThankGroup | ||
{ | { | ||
setglobal ht[thg] "'/thg [message]' Sets the default message & activates AutoThank (i.e '/thg thanks for the hunt!'). '/thg /reset' clears the list." | setglobal ht[thg] "'/thg [message]' Sets the default message & activates AutoThank (i.e '/thg thanks for the hunt!'). '/thg /reset' clears the list." | ||
setglobal ht[2] "'/thg [message]' Sets the default message & activates AutoThank (i.e '/thg thanks for the hunt!'). '/thg /reset' clears the list." | setglobal ht[2] "'/thg [message]' Sets the default message & activates AutoThank (i.e '/thg thanks for the hunt!'). '/thg /reset' clears the list." | ||
if @text == "reset" | if @text == "reset" | ||
call ClearThankGroup | call ClearThankGroup | ||
Line 139: | Line 184: | ||
goto END | goto END | ||
else if @text == ? | else if @text == ? | ||
message thga | |||
message theMessage | |||
else | else | ||
if @text != "" | if @text != "" | ||
Line 150: | Line 196: | ||
label END | label END | ||
} | } | ||
// | |||
//<<m_AddToThankGroup>> (/thga <name> [name]) adds exile|s to list | |||
AddToThankGroup | AddToThankGroup | ||
{ | { | ||
setglobal ht[thga] "'/thga | setglobal ht[thga] "'/thga <name> [name]' adds exile|s to list" | ||
setglobal ht[3] "'/thga | setglobal ht[3] "'/thga <name> [name]' adds exile|s to list" | ||
set num_people @text.num_words //gets the number of names to add (only use one word names for accuracy) | |||
set slot 0 //must start one less than total to add | |||
if debug == 1 | if debug == 1 | ||
message "slotG=" slotG | message "slotG=" slotG | ||
end if | end if | ||
if @text == ? | if @text == ? | ||
message ht[thga] | |||
end if | end if | ||
label | label ADDLOOP | ||
if slot < num_people / | if slot <= num_people | ||
"/select " @text.word[slot] "\r" | |||
if debug == 1 | |||
message "@selplayer.simple_name: " @selplayer.simple_name | |||
end if | |||
pause 1 | |||
if @env.textLog < "No player named " | |||
if debug == 1 | |||
message "* " @text.word[slot] " NOT FOUND" | |||
end if | |||
set slot + 1 | |||
goto ADDLOOP | |||
else if @selplayer.simple_name == "" | |||
if debug == 1 | |||
message "* " @text.word[slot] " EMPTY" | |||
end if | |||
set slot + 1 | |||
goto ADDLOOP | |||
else | |||
set i 0 | |||
LABEL COMPARELOOP | |||
if myThankGroup[i] == @selplayer.simple_name | |||
message "* " @selplayer.name " already in list SKIPPING" | |||
set slot + 1 | |||
goto ADDLOOP | |||
else | |||
if i < thankTotal | |||
set i + 1 | |||
goto COMPARELOOP | |||
end if | |||
setglobal myThankGroup[slotG] @selplayer.simple_name | |||
if debug == 1 | |||
message "*myThankGroup[" slotG "]= " myThankGroup[slotG] | |||
end if | |||
pause 1 | |||
set slot + 1 | |||
setglobal slotG + 1 | |||
setglobal thankTotal + 1 | |||
if debug == 1 | |||
message "thank total: " thankTotal | |||
end if | |||
goto ADDLOOP | |||
end if | |||
end if | end if | ||
end if | end if | ||
if modeverbose == 1 | |||
call WhoAmIThanking | call WhoAmIThanking | ||
end if | |||
label END | label END | ||
} | } | ||
// | |||
//<<m_ClearThankGroup>> (/thgc) clears and resets list | |||
ClearThankGroup | ClearThankGroup | ||
{ | { | ||
setglobal ht[thgc] "'/thgc [num]' clears and resets list, with a number it removes that entry in the list" | setglobal ht[thgc] "'/thgc [num]' clears and resets list, with a number it removes that entry in the list" | ||
setglobal ht[4] "'/thgc [num]' clears and resets list, with a number it removes that entry in the list" | setglobal ht[4] "'/thgc [num]' clears and resets list, with a number it removes that entry in the list" | ||
if @text == "" | |||
message "Clearing thank group" | message "Clearing thank group" | ||
setglobal thankTarget | setglobal thankTarget 1 | ||
setglobal counted 0 | setglobal counted 1 //NEW2021 was 0 | ||
setglobal thankTotal 1 | setglobal thankTotal 1 | ||
setglobal myThankGroup "" | setglobal myThankGroup "" | ||
setglobal slotG 1 | setglobal slotG 1 | ||
message thankTarget "*" counted "*" thankTotal "*" myThankGroup "*" slotG "*" | message thankTarget "*" counted "*thanktotal:" thankTotal "*" myThankGroup "*slotG:" slotG "*" | ||
else if @text == 0 | else if @text == 0 | ||
setglobal currentIndex @text | setglobal currentIndex @text | ||
Line 208: | Line 283: | ||
else if @text > 0 | else if @text > 0 | ||
if @text <= thankTotal | if @text <= thankTotal | ||
setglobal currentIndex @text | setglobal currentIndex @text //CurrentIndex used by moveUp | ||
call moveUp | call moveUp | ||
end if | end if | ||
Line 214: | Line 289: | ||
label END | label END | ||
} | } | ||
// | |||
//<<m_ThankNext>> (/tn [message]) actually does the thanking | |||
ThankNext | |||
{ | { | ||
if | if initSwitch == 1 | ||
setglobal ht[tn] "/tn [message]' manually thanks the next person and sets the message" | |||
goto END | |||
end if | |||
if thankTotal < 1 | |||
message "*ThankNext*no one in thank list, adding shares in (/ths)**" | |||
call ThankSharers | |||
setglobal modeverbose 1 | |||
end if | |||
if thankTarget < 1 //protects against out of bounds array calls | |||
setglobal thankTarget 1 | setglobal thankTarget 1 | ||
else | else if thankTarget > thankTotal | ||
setglobal thankTarget 1 | setglobal thankTarget 1 | ||
end if | end if | ||
"/select " myThankGroup[thankTarget] "\r" | |||
if @text == "" | if @text == "" | ||
"/select " myThankGroup[thankTarget] "\r" | |||
call ThankMessage | |||
"/thank " @selplayer.name " " theMessage " :)\r" | |||
else | else | ||
"/thank " myThankGroup[thankTarget] " " @text "\r" | "/thank " myThankGroup[thankTarget] " " @text "\r" | ||
end if | end if | ||
pause 1 | pause 1 | ||
set tocheck @env.TextLog | |||
// | set tocheck @env.TextLog | ||
if tocheck < "You have no karma to give" | |||
//checks log for failure | |||
if tocheck < "You have no karma to give." | |||
if debug == 1 | if debug == 1 | ||
message "* Unable to give karma to " myThankGroup[thankTarget] " holding place." | message "**m_ThankNext:Unable to give karma to " myThankGroup[thankTarget] " holding place." | ||
end if | end if | ||
else if tocheck < "is not in the lands" | else if tocheck < "is not in the lands." | ||
if debug == 1 | if debug == 1 | ||
message "*Unable to give karma (No Target) | message "*m_ThankNext:Unable to give karma (No Target):Advancing" | ||
end if | end if | ||
setglobal | setglobal missingTarget 1 | ||
call moveUp | |||
call | |||
if debug == 1 | if debug == 1 | ||
message " | message "tht/tot:" thankTarget ":ThankTotal:" thankTotal | ||
end if | end if | ||
else if thankTarget < thankTotal | |||
else if | call thankFeedback //20220625 EDIT switched order | ||
call | setglobal thankTarget + 1 //20220625 EDIT switched order | ||
else | else if thankTarget >= thankTotal | ||
call | call thankFeedback //20220625 EDIT switched order | ||
setglobal thankTarget 1 //20220625 EDIT switched order | |||
end if | end if | ||
label END | label END | ||
} | } | ||
WhoAmIThanking // | |||
thankFeedback | |||
{ | |||
if debug == 1 | |||
message "*thanking " myThankGroup[thankTarget] "/thh for help" | |||
setglobal modeverbose 0 | |||
end if | |||
} | |||
WhoAmIThanking //<<m_WhoAmIThanking>> (/thgwho)|(/thg?) outputs the myTG | |||
{ | { | ||
if initSwitch == 1 | if initSwitch == 1 | ||
Line 293: | Line 367: | ||
call ClearThankGroup | call ClearThankGroup | ||
end if | end if | ||
if thankTotal | if thankTotal < 1 | ||
message "**The thank group is empty. Try /ths or /thga <name> [name] to add people" | message "**The thank group is empty. Try /ths or /thga <name> [name] to add people" | ||
goto END | goto END | ||
else | else | ||
message "*My thank group is currently: " | message "*My thank group is currently: " | ||
setglobal counted 1 | setglobal counted 1 //must be 1 for start of array 20220621 | ||
label LOOPSTART | |||
if counted <= thankTotal | |||
if counted < | |||
if counted == thankTarget | if counted == thankTarget | ||
message "[" counted "]*" myThankGroup[counted] | message "[" counted "]*" myThankGroup[counted] | ||
Line 313: | Line 386: | ||
end if | end if | ||
label END | label END | ||
} | } | ||
/****** SHARERS *******/ | |||
// <<m_ThankSharers>> | |||
ThankSharers // (/ths) adds all people sharing you to the list | ThankSharers // (/ths) adds all people sharing you to the list | ||
{ | { | ||
if initSwitch == 1 | if initSwitch == 1 | ||
setglobal ht[ths] "'/ths' adds all people sharing you to the list" | |||
goto END | |||
end if | |||
set count 0 | |||
set countB 0 | |||
set i 0 | |||
set j 0 | |||
if debug == 1 | |||
message "ThankShares In: " @my.shares_in.num_words | |||
message "Shares in are " @my.shares_in | |||
message "ThankShares Out:" @my.shares_out.num_words | |||
message "Shares out are " @my.shares_out | |||
message "thankTotal: " thankTotal | |||
message "myThankGroup:" myThankGroup | |||
end if | end if | ||
set | |||
label LOOP0 | |||
if count <= @my.shares_in.num_words | |||
"/select " @my.shares_in.word[count] " \r" | |||
if @selplayer.simple_name == "" | |||
set count + 1 | |||
goto LOOP0 | |||
else if debug == 1 | |||
message "(L0)Start: select exile" @selplayer.simple_name | |||
end if | |||
pause 1 | |||
set i 1 | |||
LABEL COMPARELOOP | |||
if debug == 1 | if debug == 1 | ||
message " | //message "(L0C1) ThankGroup[" i "]" myThankGroup[i] | ||
end if | end if | ||
if myThankGroup[i] == @selplayer.simple_name | |||
if | message "*" @selplayer.name "in list (L0) SKIPPING" | ||
set count + 1 | |||
set | |||
goto LOOP0 | goto LOOP0 | ||
else if i < thankTotal | |||
set i + 1 | |||
//message "i:" i | |||
goto COMPARELOOP | |||
end if | end if | ||
setglobal myThankGroup[slotG] @selplayer.simple_name | |||
pause 1 | |||
if debug == 1 | if debug == 1 | ||
message "* [" slotG "]" myThankGroup[slotG] " added to thank group. (L0)" | |||
end if | |||
setglobal slotG + 1 | |||
setglobal thankTotal + 1 | |||
if count < @my.shares_in.num_words | |||
set count + 1 | |||
goto LOOP0 | |||
end if | end if | ||
pause 25 | |||
end if | end if | ||
label LOOP2 | |||
if countB <= @my.shares_out.num_words | |||
"/select " @my.shares_out.word[countB] " \r" | |||
if @selplayer.simple_name == "" | |||
set countB + 1 | |||
goto LOOP2 | |||
else | |||
else | if debug == 1 | ||
if | message "(L2)Start: select exile" @selplayer.simple_name | ||
message " | |||
end if | end if | ||
end if | end if | ||
set | pause 1 | ||
set | set j 1 | ||
if | LABEL COMPARELOOP2 | ||
message "* | if debug == 1 | ||
//message "(L2C2) ThankGroup[" j "]" myThankGroup[j] | |||
end if | |||
if myThankGroup[j] == @selplayer.simple_name | |||
message "*" @selplayer.name "in list (L2) SKIPPING" | |||
set countB + 1 | |||
goto LOOP2 | |||
else if j < thankTotal | |||
set j + 1 | |||
//message "j:" j | |||
goto COMPARELOOP2 | |||
end if | |||
setglobal myThankGroup[slotG] @selplayer.simple_name | |||
pause 1 | |||
if debug == 1 | |||
message "* [" slotG "]" myThankGroup[slotG] " added to thank group. (L2)" | |||
end if | |||
setglobal slotG + 1 | |||
setglobal thankTotal + 1 | |||
if countB < @my.shares_out.num_words | |||
set countB + 1 | |||
goto LOOP2 | |||
end if | end if | ||
pause 25 | |||
end if | |||
label END | label END | ||
if debug == 1 | |||
call WhoAmIThanking | |||
end if | |||
} | } | ||
// | |||
//<<m_ThankOptions>> (/tho) sets tTarget to 0|number or switches debugging on | |||
ThankOptions | ThankOptions | ||
{ | { | ||
Line 405: | Line 526: | ||
end if | end if | ||
else | else | ||
message "*That number won't work. The highest number you can set it currently: " | message "*That number won't work. The highest number you can set it currently: " thankTarget | ||
pause 7 | pause 7 | ||
message "*Blame Polerand! ;)" | message "*Blame Polerand! ;)" | ||
Line 412: | Line 533: | ||
set words @text.word[count] | set words @text.word[count] | ||
set counter 1 | set counter 1 | ||
label MESSAGEBUILDER | label MESSAGEBUILDER | ||
if counter > words | if counter > words | ||
Line 418: | Line 538: | ||
message "the message is now: " theMessage | message "the message is now: " theMessage | ||
else | else | ||
set interim.word[counter] | set interim.word[counter] @text.word[counter] " " | ||
set counter + 1 | set counter + 1 | ||
goto MESSAGEBUILDER | goto MESSAGEBUILDER | ||
Line 425: | Line 545: | ||
label END | label END | ||
} | } | ||
// AutoThank 1.0 "/ath" | // AutoThank 1.0 "/ath" | ||
AutoThank // | AutoThank //<<m_AutoThank>> (/ath ["0"|"off"]) turns on*|off automatic thanks | ||
{ | { | ||
if initSwitch == 1 | if initSwitch == 1 | ||
Line 438: | Line 560: | ||
setglobal ATH 0 | setglobal ATH 0 | ||
goto ENDoff | goto ENDoff | ||
end if | end if | ||
setglobal ATH 1 | setglobal ATH 1 | ||
label LOOPA | |||
label LOOPA | |||
if ATH == 1 | if ATH == 1 | ||
pause delay | pause delay | ||
if thankTarget < | if thankTarget <= thankTotal | ||
call ThankNext | call ThankNext | ||
goto LOOPA | goto LOOPA | ||
else | else | ||
message "***You are out of people to thank.***" | message "***You are out of people to thank.***" | ||
message "***To Add more type /thga <name> [name] ..." | message "***To Add more type /thga <name> [name] ..." | ||
end if | end if | ||
end if | end if | ||
label ENDoff | label ENDoff | ||
message "*AutoThank is Off" | message "*AutoThank is Off" | ||
label END | label END | ||
} | } | ||
// | |||
//<<m_BuildDefault>> List Building Function | |||
BuildDefault | BuildDefault | ||
{ | { | ||
if initSwitch == 1 | if initSwitch == 1 | ||
setglobal ht[thb] "'/thb' builds the thank list using | setglobal ht[thb] "'/thb' builds the thank list using the default in Friends" | ||
goto END | goto END | ||
end if | end if | ||
label LOOPA | label LOOPA | ||
if count | if count > listA.num_words | ||
setglobal myThankGroup[slotG] listA.word[count] | setglobal myThankGroup[slotG] listA.word[count] | ||
if debug == 1 | if debug == 1 | ||
Line 479: | Line 600: | ||
pause 20 | pause 20 | ||
goto LOOPA | goto LOOPA | ||
end if | end if | ||
label END | label END | ||
} | } | ||
// | |||
// *m_moveUp* Reorganizes the thankgroup List triggered by ClearThankGroup '/thgc 0' | |||
moveUp | moveUp | ||
{ | { | ||
message "**moving up | if thankTotal > 0 | ||
setglobal currentIndex thankTarget | |||
label DECLOOP | message "currentIndex:" currentIndex "exile to thank " myThankGroup[currentIndex] | ||
setglobal cIndexPlus currentIndex // | message "**moving up**thankTotal:" thankTotal "*" | ||
if | |||
setglobal | label DECLOOP | ||
setglobal cIndexPlus currentIndex | |||
setglobal cIndexPlus + 1 //CRITICAL: moves to next exile on list | |||
if cIndexPlus > thankTotal | |||
message "*m_moveUp*cIndexPlus Exceeds thankTotal" | |||
//setglobal myThankGroup[currentIndex] "" //20220619 edit from currentIndex //20220703 EDIT bug check! | |||
if debug == 1 | |||
message "*Thanklist reorganized* '/thg?' to see it (or '/set debug 1'" | |||
end if | |||
setglobal cIndexPlus thankTotal | |||
else if currentIndex == thankTotal //20220625 ADDED | |||
if myThankGroup[cIndexPlus] != "" | |||
setglobal myThankGroup[currentIndex] myThankGroup[cIndexPlus] | |||
setglobal currentIndex + 1 | |||
goto DECLOOP | |||
end if | |||
if thankTarget == currentIndex | |||
message " [" currentIndex "]* " myThankGroup[currentIndex] | |||
else | |||
message " [" currentIndex "] " myThankGroup[currentIndex] | |||
end if | |||
else //overwrites current exile | |||
if myThankGroup[cIndexPlus] != "" | |||
setglobal myThankGroup[currentIndex] myThankGroup[cIndexPlus] | |||
end if | |||
if myThankGroup[currentIndex] == myThankGroup[cIndexPlus] | |||
if thankTarget == currentIndex | |||
message " [" currentIndex "]* " myThankGroup[currentIndex] | |||
else | |||
message " [" currentIndex "] " myThankGroup[currentIndex] | |||
end if | |||
end if | |||
setglobal currentIndex + 1 | |||
goto DECLOOP | |||
end if | |||
setglobal thankTotal - 1 | |||
setglobal slotG - 1 | |||
end if | end if | ||
if thankTotal < currentIndex | |||
if | if debug == 1 | ||
message "mTG[cI]" myThankGroup[currentIndex] currentIndex | |||
end if | end if | ||
if | setglobal currentIndex 1 | ||
end if | |||
} | |||
else | |||
//<<m_ThankMessage>> (/thm|/thgm) Sets and|or shows the message | |||
ThankMessage | |||
end if | { | ||
setglobal | if @text == "/m" | ||
message theMessage | |||
else if @text == "/message" | |||
message theMessage | |||
else if @text == "?" | |||
message theMessage | |||
else if @text == "" | |||
random | |||
setglobal theMessage " because why not? " | |||
or | |||
setglobal theMessage " Thanks " | |||
or | |||
setglobal theMessage " Thank you " | |||
or | |||
setglobal theMessage " Thankx " | |||
or | |||
setglobal theMessage " Why? Because we like you " | |||
or | |||
setglobal theMessage " not that it really matters, but here's some good karma " | |||
or | |||
setglobal theMessage " Woo! Woo! " | |||
or | |||
setglobal theMessage " got Karma? " | |||
or | |||
setglobal theMessage " hu! hu! " | |||
or | |||
setglobal theMessage " a GK a day keeps the departs away " | |||
end random | |||
else if @text != "" | |||
setglobal theMessage @text | |||
end if | end if | ||
} | } | ||
// | |||
//<<m_ThankHelp>> {/thgh|/?th|/thh }Lists how to control macro | |||
ThankHelp | ThankHelp | ||
{ | { | ||
Line 521: | Line 705: | ||
call InitThG | call InitThG | ||
if @text == "overview" | if @text == "overview" | ||
message "*ThankGroup builds a list of exiles to thank." | message "*Shares.txt::ThankGroup builds a list of exiles to thank." | ||
message "*/type '/th? quickstart' for a basic command list" | message "*/type '/th? quickstart' for a basic command list" | ||
message "*The <commands> are: sh, ath, thb, thg, thga, thgc, thgwho, tho, thr, ths, tn and are preceded with a slash '/'" | message "*The <commands> are: sh, ath, thb, thg, thga, thgc, thgwho, tho, thr, ths, tn and are preceded with a slash '/'" | ||
Line 528: | Line 712: | ||
message "*'/thga' and their names (with no spaces) to add people" | message "*'/thga' and their names (with no spaces) to add people" | ||
message "*'/thg' followed by any message to send to the group." | message "*'/thg' followed by any message to send to the group." | ||
message "*'/tn' to thank the next person manually" | message "*'/tn' to thank the next person manually" | ||
message "*'/ath 0' or '/tho off' to stop the macro" | message "*'/ath 0' or '/tho off' to stop the macro" | ||
Line 537: | Line 719: | ||
else if @text != "" | else if @text != "" | ||
if @text == "sh" | if @text == "sh" | ||
message ht[1] | message " " ht[1] | ||
else if @text == "thg" | else if @text == "thg" | ||
message | message " " ht[2] | ||
else if @text == "thgc" | else if @text == "thgc" | ||
message | message " " ht[4] | ||
else if @text == "th?" | else if @text == "th?" | ||
message "*************************" | message "*************************" | ||
message "*Universal Self Destruct Activated*" | message "*Universal Self Destruct Activated*" | ||
message "*************************" | message "*************************" | ||
message "*10..." | message "*10..." | ||
pause 3 | |||
message "*Now you've done it!*" | |||
pause 2 | pause 2 | ||
message "*9..." | message "*9..." | ||
pause | pause 5 | ||
message "*8..." | message "*8..." | ||
pause | pause 5 | ||
message "*7..." | message "*7..." | ||
pause | pause 5 | ||
message "*6..." | message "*6..." | ||
pause | pause 5 | ||
message "*5..." | message "*5..." | ||
pause | pause 5 | ||
message "*4..." | message "*4..." | ||
pause | pause 5 | ||
message "*3..." | message "*3..." | ||
pause | pause 5 | ||
message "*2..." | message "*2..." | ||
pause | pause 5 | ||
message "*1..." | message "*1..." | ||
pause | pause 5 | ||
message "*0" | message "*0" | ||
message "*BOOM!*" | message "*BOOM!*" | ||
else | else | ||
setglobal ent @text | |||
message ht[ent] | message ht[ent] | ||
end if | end if | ||
Line 581: | Line 759: | ||
message "*type '/th? overview' or 'th? quickstart' for instuctions" | message "*type '/th? overview' or 'th? quickstart' for instuctions" | ||
message "*more information is available in the macro file 'Shares.txt'" | message "*more information is available in the macro file 'Shares.txt'" | ||
message "*thanks for trying this macro. Feedback is welcome" | //message "*thanks for trying this macro. Feedback is welcome" | ||
end if | end if | ||
label END | label END | ||
} | } | ||
InitThG | |||
InitThG | |||
{ | { | ||
if initSwitch == 1 | if initSwitch == 1 | ||
Line 596: | Line 775: | ||
call ThankNext | call ThankNext | ||
call ThankOptions | call ThankOptions | ||
// call ThankRandom | |||
call ThankSharers | call ThankSharers | ||
end if | end if | ||
setglobal initSwitch 0 | setglobal initSwitch 0 | ||
} | } | ||
==Debug== | |||
"/debug" | |||
{ | { | ||
if debug == 0 | |||
setglobal debug 1 | |||
message " | message "´debug activated." | ||
message " | else | ||
setglobal debug 0 | |||
message "´debug deactivated." | |||
end if | |||
} | } |
Latest revision as of 07:58, 12 July 2022
/* ---------------------------------------------------------------------- | shareMultiple Version 1.1.3 | ThankGroup Version 2.5.3 | ------------------------------- Description ----------------------------- Shares is an expansion of the default /share command to accept multiple names, to ease sharing and thanking groups of people. ---------------------------------- Usage -------------------------------- ##### type "/th?" for online help type: sh [name*] [name] [name] [name] [name] to share up to your maximum number of people. *You can type partial names as you can with the default share command. /ths to build thank list of shares in and out /tn to thank the next person on the list /ath to automatically thank and set through the list ---------------------------------- Setup ---------------------------------- Add the line below to your default macro file: include "Shares.txt" Note: to work properly you might have to remove the line "sh" "/share " @text "\r" from your default macros file. or you can use other built in triggers: "shm" & "/shm" ------------------------------ Feedback/Info ------------------------------ This macro makes a list of people to thank numerous ways. Then you can call the AutoThank if you want to thank a person every 4 minutes (set with "delay" global. the delay by default is just over 4 minutes, 1200 Frames). The Default Triggers are listed below, feel free to edit them. A short description is listed next to each trigger. ** Thank Options controls several options. including just a number ("/tho 3") will set the person at that position in the list (3 in this case) as the next exile to thank. With "debug" set to 0 or 1 it will allow debug messages to show up and allow you to load a default list of people to thank into the ThankGroup by activating the default share shortcut,"sh", which you can set in listA below. With the "off" option ("/tho off") it turns off the AutoThank loop. *The v.2.1.3 comment format is as follows: <<m_macroname>> (default trigger|s <required text> [optional text]) short description. ** the single less than some text and greater than denotes strings so when you see "/thg [message]" ** the vertical bar "|" is used to denote valid options (arguments) the macro accepts ** all macros are prefixed with "m_" in the file for quick searching and avoiding false hits from "call <macro>" ** global variable have their type & [:specific function] in tech speak along with a short description If you find any bugs or have suggestions, contact noivad either in game or at his mac dot com address. This macro is "/Thank-ware." ------------------------- version change notes -------------------------- v.2.1.2 "ThankRandom" was added by request of Rroot (REMOVED 2.5) v.2.1.3 *fixed a small bug that threw an error, but didn't stop the macro *Added <<tags>> to functions and comments *Added ThankHelp macro v.2.1.4 Added ability to remove a person from the list with /thgc <number> *Added ThankGroup Help "/thh" or "/thgh" v2.1.5 bug fixes to list behavior broken in 2.1.4 feature addition v.2.1.6-7 bug fix for increment not working. v2.3 fixes moveUp bug. ThankRandom is Broken & has been v.2.5.2 & 1.1.2 won't add people that are already on list ----------------------------------------------------------------------- */ /****** Share Triggers ******/ "sh" call shareMultiList //changes /share to add multiple people "/shm" call shareMultiList // also adds to myTG "shm" call shareMultiList //Template:M shareMultiList /****** Thank Group Triggers ******/ "/moveup" call moveUp //removes players who are now offline "/th?" call ThankHelp //Online ThankGroup command help "/ath" call AutoThank //Starts an Automatic thank loop | "off" to stop "/thb" call BuildDefault //Builds the default or saved list "/thg" call ThankGroup //Thanks the next person on the list "/thga" call AddToThankGroup // Adds a person to ThankGroup list "/thgwho" call WhoAmIThanking // Shows the ThankGroup list "/thg?" call WhoAmIThanking // "/thgc" call ClearThankGroup //Clears out ThankGroup "/thgh" call ThankHelp //Online ThankGroup command help "/thgm" call ThankMessage //sets the message given with karma "/thm" call ThankMessage "/thh" call ThankHelp //Online ThankGroup command help "/thn" call ThankNext // Thanks next person in the list "/tho" call ThankOptions // see ** Above or Template:M ThankOptions below //"/thr" call ThankRandom // BROKEN: See * Above "/ths" call ThankSharers //loads shares into thank list "/tn" call ThankNext //Thanks the next person on list set debug 0 //<<debug>> (bool:toggle) turns on and off debugging set modeverbose 1 //first trigger will remind people how to use. set to 0 to turn off set theMessage " Thank you " //<<EditMe>> your default message set myThankGroup[0] "" //in case thankTarget is set to 0 set listA "Talin Silky Klur Natas Shadowfire" //EDIT to your friends /* ---- Do not Edit below this line if not Familiar with Macros ---- */ set slotG 1 //<<slotG>> (int:index) is the pointer for the list set currentIndex 1 //which slot is current set thankTarget 1 //internal current index set thankTotal 0 //<<thankTotal>> (int:sum) <<!=DO_NOT_EDIT>> {?}Number in list set ATH 0 //<<ATH>> (bool:toggle) controls automatic thanking set delay 1201 //<<delay>> (int:timer) controls pause between Template:M AutoThank set ht[0] "There is no entry here" set ent 0 set initSwitch 0 /* ******************** shareMultiple v1.1.3 *********************** */ //<<m_shareMultiList>> (sh|/shm|shm <name> [name]) shares & adds to list shareMultiList { setglobal ht[sh] "*'sh|/shm|shm <name> [name]' shares & adds exiles to list" setglobal ht[1] "*'sh|/shm|shm <name> [name]' shares & adds exiles to list" if slotG < 1 setglobal slotG 1 end if if @text != "" set count 0 label LOOP if count <= @text.num_words "/select " @text.word[count] " \r" if @selplayer.simple_name == "" set count + 1 goto LOOP end if "/share " @selplayer.simple_name " \r" if debug == 1 message "*attempted share with " @text.word[count] " in LOOP" end if pause 1 if "No player named " < @env.textLog set count + 1 goto LOOP end if set i 1 LABEL COMPARELOOP //ADDED 20220625 EXPERIMENTAL trying to search array for string if myThankGroup != "" //message "myThankGroup:" myThankGroup if myThankGroup < @selplayer.simple_name message @selplayer.simple_name "in myThankGroup" end if end if //ABOVE ADDED if myThankGroup[i] == @selplayer.simple_name message "* " @selplayer.name " already in list SKIPPING" set count + 1 pause 25 goto LOOP else if i < thankTotal set i + 1 goto COMPARELOOP end if setglobal myThankGroup[slotG] @selplayer.simple_name pause 1 if debug == 1 message "* [" slotG "]" myThankGroup[slotG] " added to thank group." end if setglobal slotG + 1 setglobal thankTotal + 1 if count < @text.num_words set count + 1 end if pause 25 goto LOOP end if end if else "/share\r" end if label END } /************************ Thank Group v2.5.3 *************************/ //<<m_ThankGroup>> (/thg [message]) Thanks exile|s in list (activates AutoThank) ThankGroup { setglobal ht[thg] "'/thg [message]' Sets the default message & activates AutoThank (i.e '/thg thanks for the hunt!'). '/thg /reset' clears the list." setglobal ht[2] "'/thg [message]' Sets the default message & activates AutoThank (i.e '/thg thanks for the hunt!'). '/thg /reset' clears the list." if @text == "reset" call ClearThankGroup goto END else if @text == "/reset" call ClearThankGroup goto END else if @text == ? message thga message theMessage else if @text != "" setglobal theMessage @text end if end if pause 1 call AutoThank message ending thanks label END } //<<m_AddToThankGroup>> (/thga <name> [name]) adds exile|s to list AddToThankGroup { setglobal ht[thga] "'/thga <name> [name]' adds exile|s to list" setglobal ht[3] "'/thga <name> [name]' adds exile|s to list" set num_people @text.num_words //gets the number of names to add (only use one word names for accuracy) set slot 0 //must start one less than total to add if debug == 1 message "slotG=" slotG end if if @text == ? message ht[thga] end if label ADDLOOP if slot <= num_people "/select " @text.word[slot] "\r" if debug == 1 message "@selplayer.simple_name: " @selplayer.simple_name end if pause 1 if @env.textLog < "No player named " if debug == 1 message "* " @text.word[slot] " NOT FOUND" end if set slot + 1 goto ADDLOOP else if @selplayer.simple_name == "" if debug == 1 message "* " @text.word[slot] " EMPTY" end if set slot + 1 goto ADDLOOP else set i 0 LABEL COMPARELOOP if myThankGroup[i] == @selplayer.simple_name message "* " @selplayer.name " already in list SKIPPING" set slot + 1 goto ADDLOOP else if i < thankTotal set i + 1 goto COMPARELOOP end if setglobal myThankGroup[slotG] @selplayer.simple_name if debug == 1 message "*myThankGroup[" slotG "]= " myThankGroup[slotG] end if pause 1 set slot + 1 setglobal slotG + 1 setglobal thankTotal + 1 if debug == 1 message "thank total: " thankTotal end if goto ADDLOOP end if end if end if if modeverbose == 1 call WhoAmIThanking end if label END } //<<m_ClearThankGroup>> (/thgc) clears and resets list ClearThankGroup { setglobal ht[thgc] "'/thgc [num]' clears and resets list, with a number it removes that entry in the list" setglobal ht[4] "'/thgc [num]' clears and resets list, with a number it removes that entry in the list" if @text == "" message "Clearing thank group" setglobal thankTarget 1 setglobal counted 1 //NEW2021 was 0 setglobal thankTotal 1 setglobal myThankGroup "" setglobal slotG 1 message thankTarget "*" counted "*thanktotal:" thankTotal "*" myThankGroup "*slotG:" slotG "*" else if @text == 0 setglobal currentIndex @text call moveUp else if @text > 0 if @text <= thankTotal setglobal currentIndex @text //CurrentIndex used by moveUp call moveUp end if end if label END } //<<m_ThankNext>> (/tn [message]) actually does the thanking ThankNext { if initSwitch == 1 setglobal ht[tn] "/tn [message]' manually thanks the next person and sets the message" goto END end if if thankTotal < 1 message "*ThankNext*no one in thank list, adding shares in (/ths)**" call ThankSharers setglobal modeverbose 1 end if if thankTarget < 1 //protects against out of bounds array calls setglobal thankTarget 1 else if thankTarget > thankTotal setglobal thankTarget 1 end if "/select " myThankGroup[thankTarget] "\r" if @text == "" "/select " myThankGroup[thankTarget] "\r" call ThankMessage "/thank " @selplayer.name " " theMessage " :)\r" else "/thank " myThankGroup[thankTarget] " " @text "\r" end if pause 1 set tocheck @env.TextLog //checks log for failure if tocheck < "You have no karma to give." if debug == 1 message "**m_ThankNext:Unable to give karma to " myThankGroup[thankTarget] " holding place." end if else if tocheck < "is not in the lands." if debug == 1 message "*m_ThankNext:Unable to give karma (No Target):Advancing" end if setglobal missingTarget 1 call moveUp if debug == 1 message "tht/tot:" thankTarget ":ThankTotal:" thankTotal end if else if thankTarget < thankTotal call thankFeedback //20220625 EDIT switched order setglobal thankTarget + 1 //20220625 EDIT switched order else if thankTarget >= thankTotal call thankFeedback //20220625 EDIT switched order setglobal thankTarget 1 //20220625 EDIT switched order end if label END } thankFeedback { if debug == 1 message "*thanking " myThankGroup[thankTarget] "/thh for help" setglobal modeverbose 0 end if } WhoAmIThanking //<<m_WhoAmIThanking>> (/thgwho)|(/thg?) outputs the myTG { if initSwitch == 1 setglobal ht[thgwho] "'/thgwho|/thg? [reset|/reset]' shows the list or optionally resets it" goto END end if if @text == "reset" call ClearThankGroup else if @text == "/reset" call ClearThankGroup end if if thankTotal < 1 message "**The thank group is empty. Try /ths or /thga <name> [name] to add people" goto END else message "*My thank group is currently: " setglobal counted 1 //must be 1 for start of array 20220621 label LOOPSTART if counted <= thankTotal if counted == thankTarget message "[" counted "]*" myThankGroup[counted] else message "[" counted "]" myThankGroup[counted] end if setglobal counted + 1 goto LOOPSTART end if end if label END } /****** SHARERS *******/ // <<m_ThankSharers>> ThankSharers // (/ths) adds all people sharing you to the list { if initSwitch == 1 setglobal ht[ths] "'/ths' adds all people sharing you to the list" goto END end if set count 0 set countB 0 set i 0 set j 0 if debug == 1 message "ThankShares In: " @my.shares_in.num_words message "Shares in are " @my.shares_in message "ThankShares Out:" @my.shares_out.num_words message "Shares out are " @my.shares_out message "thankTotal: " thankTotal message "myThankGroup:" myThankGroup end if label LOOP0 if count <= @my.shares_in.num_words "/select " @my.shares_in.word[count] " \r" if @selplayer.simple_name == "" set count + 1 goto LOOP0 else if debug == 1 message "(L0)Start: select exile" @selplayer.simple_name end if pause 1 set i 1 LABEL COMPARELOOP if debug == 1 //message "(L0C1) ThankGroup[" i "]" myThankGroup[i] end if if myThankGroup[i] == @selplayer.simple_name message "*" @selplayer.name "in list (L0) SKIPPING" set count + 1 goto LOOP0 else if i < thankTotal set i + 1 //message "i:" i goto COMPARELOOP end if setglobal myThankGroup[slotG] @selplayer.simple_name pause 1 if debug == 1 message "* [" slotG "]" myThankGroup[slotG] " added to thank group. (L0)" end if setglobal slotG + 1 setglobal thankTotal + 1 if count < @my.shares_in.num_words set count + 1 goto LOOP0 end if pause 25 end if label LOOP2 if countB <= @my.shares_out.num_words "/select " @my.shares_out.word[countB] " \r" if @selplayer.simple_name == "" set countB + 1 goto LOOP2 else if debug == 1 message "(L2)Start: select exile" @selplayer.simple_name end if end if pause 1 set j 1 LABEL COMPARELOOP2 if debug == 1 //message "(L2C2) ThankGroup[" j "]" myThankGroup[j] end if if myThankGroup[j] == @selplayer.simple_name message "*" @selplayer.name "in list (L2) SKIPPING" set countB + 1 goto LOOP2 else if j < thankTotal set j + 1 //message "j:" j goto COMPARELOOP2 end if setglobal myThankGroup[slotG] @selplayer.simple_name pause 1 if debug == 1 message "* [" slotG "]" myThankGroup[slotG] " added to thank group. (L2)" end if setglobal slotG + 1 setglobal thankTotal + 1 if countB < @my.shares_out.num_words set countB + 1 goto LOOP2 end if pause 25 end if label END if debug == 1 call WhoAmIThanking end if } //<<m_ThankOptions>> (/tho) sets tTarget to 0|number or switches debugging on ThankOptions { if initSwitch == 1 setglobal ht[tho] "'/tho [<number>||debug 0|1||off||message <message>]' sets next person thanked to 0|<number>, switches debugging on or off, turns on or off AutoThanking, or sets a new message" goto END end if if @text == "" setglobal thankTarget 0 call WhoAmIThanking else if @text.word[0] == "debug" if @text.word[1] < 2 setglobal debug @text.word[1] end if if debug == 1 message "*Debugging is on" else if debug == 0 message "*Debugging is off" end if else if @text.word[0] == "off" setglobal ATH 0 else if @text.word[0] == "on" call AutoThank else if @text.word[0] > 0 if @text.word[0] <= thankTotal setglobal thankTarget @text.word[0] end if else message "*That number won't work. The highest number you can set it currently: " thankTarget pause 7 message "*Blame Polerand! ;)" end if else if @text.word[0] == "message" set words @text.word[count] set counter 1 label MESSAGEBUILDER if counter > words setglobal theMessage interim message "the message is now: " theMessage else set interim.word[counter] @text.word[counter] " " set counter + 1 goto MESSAGEBUILDER end if end if label END } // AutoThank 1.0 "/ath" AutoThank //<<m_AutoThank>> (/ath ["0"|"off"]) turns on*|off automatic thanks { if initSwitch == 1 setglobal ht[ath] "'/ath [0|off]' turns off automatic thanks. With no arguments it turns it on." goto END end if if @text.word[0] == "off" setglobal ATH 0 goto ENDoff else if @text.word[0] == "0" setglobal ATH 0 goto ENDoff end if setglobal ATH 1 label LOOPA if ATH == 1 pause delay if thankTarget <= thankTotal call ThankNext goto LOOPA else message "***You are out of people to thank.***" message "***To Add more type /thga <name> [name] ..." end if end if label ENDoff message "*AutoThank is Off" label END } //<<m_BuildDefault>> List Building Function BuildDefault { if initSwitch == 1 setglobal ht[thb] "'/thb' builds the thank list using the default in Friends" goto END end if label LOOPA if count > listA.num_words setglobal myThankGroup[slotG] listA.word[count] if debug == 1 pause 1 message "*" myThankGroup[slotG] " added to thankgroup." end if set count + 1 setglobal slotG + 1 setglobal thankTotal + 1 pause 20 goto LOOPA end if label END } // *m_moveUp* Reorganizes the thankgroup List triggered by ClearThankGroup '/thgc 0' moveUp { if thankTotal > 0 setglobal currentIndex thankTarget message "currentIndex:" currentIndex "exile to thank " myThankGroup[currentIndex] message "**moving up**thankTotal:" thankTotal "*" label DECLOOP setglobal cIndexPlus currentIndex setglobal cIndexPlus + 1 //CRITICAL: moves to next exile on list if cIndexPlus > thankTotal message "*m_moveUp*cIndexPlus Exceeds thankTotal" //setglobal myThankGroup[currentIndex] "" //20220619 edit from currentIndex //20220703 EDIT bug check! if debug == 1 message "*Thanklist reorganized* '/thg?' to see it (or '/set debug 1'" end if setglobal cIndexPlus thankTotal else if currentIndex == thankTotal //20220625 ADDED if myThankGroup[cIndexPlus] != "" setglobal myThankGroup[currentIndex] myThankGroup[cIndexPlus] setglobal currentIndex + 1 goto DECLOOP end if if thankTarget == currentIndex message " [" currentIndex "]* " myThankGroup[currentIndex] else message " [" currentIndex "] " myThankGroup[currentIndex] end if else //overwrites current exile if myThankGroup[cIndexPlus] != "" setglobal myThankGroup[currentIndex] myThankGroup[cIndexPlus] end if if myThankGroup[currentIndex] == myThankGroup[cIndexPlus] if thankTarget == currentIndex message " [" currentIndex "]* " myThankGroup[currentIndex] else message " [" currentIndex "] " myThankGroup[currentIndex] end if end if setglobal currentIndex + 1 goto DECLOOP end if setglobal thankTotal - 1 setglobal slotG - 1 end if if thankTotal < currentIndex if debug == 1 message "mTG[cI]" myThankGroup[currentIndex] currentIndex end if setglobal currentIndex 1 end if } //<<m_ThankMessage>> (/thm|/thgm) Sets and|or shows the message ThankMessage { if @text == "/m" message theMessage else if @text == "/message" message theMessage else if @text == "?" message theMessage else if @text == "" random setglobal theMessage " because why not? " or setglobal theMessage " Thanks " or setglobal theMessage " Thank you " or setglobal theMessage " Thankx " or setglobal theMessage " Why? Because we like you " or setglobal theMessage " not that it really matters, but here's some good karma " or setglobal theMessage " Woo! Woo! " or setglobal theMessage " got Karma? " or setglobal theMessage " hu! hu! " or setglobal theMessage " a GK a day keeps the departs away " end random else if @text != "" setglobal theMessage @text end if } //<<m_ThankHelp>> {/thgh|/?th|/thh }Lists how to control macro ThankHelp { setglobal hEntry 0 set initSwitch 1 call InitThG if @text == "overview" message "*Shares.txt::ThankGroup builds a list of exiles to thank." message "*/type '/th? quickstart' for a basic command list" message "*The <commands> are: sh, ath, thb, thg, thga, thgc, thgwho, tho, thr, ths, tn and are preceded with a slash '/'" message "type '/th? <command> for more info on each command" else if @text == "quickstart" message "*'/thga' and their names (with no spaces) to add people" message "*'/thg' followed by any message to send to the group." message "*'/tn' to thank the next person manually" message "*'/ath 0' or '/tho off' to stop the macro" message "*'/th? message' see what current message is" else if @text == "message" message "*" theMessage else if @text != "" if @text == "sh" message " " ht[1] else if @text == "thg" message " " ht[2] else if @text == "thgc" message " " ht[4] else if @text == "th?" message "*************************" message "*Universal Self Destruct Activated*" message "*************************" message "*10..." pause 3 message "*Now you've done it!*" pause 2 message "*9..." pause 5 message "*8..." pause 5 message "*7..." pause 5 message "*6..." pause 5 message "*5..." pause 5 message "*4..." pause 5 message "*3..." pause 5 message "*2..." pause 5 message "*1..." pause 5 message "*0" message "*BOOM!*" else setglobal ent @text message ht[ent] end if else message "*type '/th? overview' or 'th? quickstart' for instuctions" message "*more information is available in the macro file 'Shares.txt'" //message "*thanks for trying this macro. Feedback is welcome" end if label END } InitThG { if initSwitch == 1 call shareMultiList call AutoThank call ThankGroup call AddToThankGroup call WhoAmIThanking call ClearThankGroup call ThankNext call ThankOptions // call ThankRandom call ThankSharers end if setglobal initSwitch 0 }
Debug[edit]
"/debug" { if debug == 0 setglobal debug 1 message "´debug activated." else setglobal debug 0 message "´debug deactivated." end if }